[libclc] 113/291: Fix build broken by LLVM commit r199279

Andreas Beckmann anbe at moszumanska.debian.org
Tue Sep 8 10:53:39 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 d9a654573ace0405ca1c7ef8d3dc2bdd43d8052f
Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Mon Jan 20 20:28:48 2014 +0000

    Fix build broken by LLVM commit r199279
    
    Patch by: Udo van den Heuvel
    
    Tom Stellard:
      - Added ifdef and error handling
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@199687 91177308-0d34-0410-b5e6-96231b3b80d8
---
 utils/prepare-builtins.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index 4ad21e8..bf85644 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -9,6 +9,7 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/system_error.h"
+#include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/ToolOutputFile.h"
 #include "llvm/Config/config.h"
 
@@ -34,8 +35,16 @@ int main(int argc, char **argv) {
     OwningPtr<MemoryBuffer> BufferPtr;
     if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
       ErrorMessage = ec.message();
-    else
+    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())
+        ErrorMessage = ec.message();
+      M.reset(ModuleOrErr.get());
+#else
       M.reset(ParseBitcodeFile(BufferPtr.get(), Context, &ErrorMessage));
+#endif
+    }
   }
 
   if (M.get() == 0) {

-- 
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