[PATCH libclc] Fix build against LLVM SVN >= r216393

Michel Dänzer michel at daenzer.net
Mon Aug 25 20:53:03 PDT 2014


From: Michel Dänzer <michel.daenzer at amd.com>

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 utils/prepare-builtins.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index 726866e..59f3999 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -95,6 +95,15 @@ int main(int argc, char **argv) {
     return 1;
   }
 
+#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6)
+  std::error_code EC;
+  UNIQUE_PTR<tool_output_file> Out
+  (new tool_output_file(OutputFilename.c_str(), EC, sys::fs::F_None));
+  if (EC) {
+    errs() << EC.message() << '\n';
+    exit(1);
+  }
+#else
   std::string ErrorInfo;
   UNIQUE_PTR<tool_output_file> Out
   (new tool_output_file(OutputFilename.c_str(), ErrorInfo,
@@ -109,6 +118,7 @@ int main(int argc, char **argv) {
     errs() << ErrorInfo << '\n';
     exit(1);
   }
+#endif // LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6)
 
   WriteBitcodeToFile(M.get(), Out->os());
 
-- 
2.1.0




More information about the llvm-commits mailing list