[libclc] 133/291: prepare-builtins: Use std:: prefix for error_code
Andreas Beckmann
anbe at moszumanska.debian.org
Tue Sep 8 10:53:42 UTC 2015
This is an automated email from the git hooks/post-receive script.
anbe pushed a commit to branch master
in repository libclc.
commit d24beb96fe76ab3042fc933df63922bf85ed0c1a
Author: Tom Stellard <thomas.stellard at amd.com>
Date: Fri Jun 13 01:30:14 2014 +0000
prepare-builtins: Use std:: prefix for error_code
This fixes the build with with newer LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@210867 91177308-0d34-0410-b5e6-96231b3b80d8
---
utils/prepare-builtins.cpp | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index 3130d73..c7f013f 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -15,6 +15,15 @@
using namespace llvm;
+#define LLVM_350_AND_NEWER \
+ (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5))
+
+#if LLVM_350_AND_NEWER
+#define ERROR_CODE std::error_code
+#else
+#define ERROR_CODE error_code
+#endif
+
static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
@@ -37,12 +46,12 @@ int main(int argc, char **argv) {
#else
OwningPtr<MemoryBuffer> BufferPtr;
#endif
- if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
+ if (ERROR_CODE ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
ErrorMessage = ec.message();
else {
#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(BufferPtr.get(), Context);
- if (error_code ec = ModuleOrErr.getError())
+ if (ERROR_CODE ec = ModuleOrErr.getError())
ErrorMessage = ec.message();
M.reset(ModuleOrErr.get());
#else
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git
More information about the Pkg-opencl-commits
mailing list