summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMichel Danzer <michel.daenzer@amd.com>2014-08-28 06:19:33 +0000
committerMichel Danzer <michel.daenzer@amd.com>2014-08-28 06:19:33 +0000
commit2d5b8945fa27bf945c46a969e11f4bf37f542e39 (patch)
tree3c54c25cf8c1636cab411ee61a51cc7d1330c0e7 /utils
parent78264ec7d048532f617b620a1c3d790b34f45d17 (diff)
Fix build against LLVM SVN >= r216393
Tested-by: Aaron Watry <awatry@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@216653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/prepare-builtins.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index 726866e..afa64a8 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -12,6 +12,9 @@
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Config/llvm-config.h"
+#define LLVM_360_AND_NEWER \
+ (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6))
+
#define LLVM_350_AND_NEWER \
(LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5))
@@ -95,6 +98,15 @@ int main(int argc, char **argv) {
return 1;
}
+#if LLVM_360_AND_NEWER
+ std::error_code EC;
+ UNIQUE_PTR<tool_output_file> Out
+ (new tool_output_file(OutputFilename, 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 +121,7 @@ int main(int argc, char **argv) {
errs() << ErrorInfo << '\n';
exit(1);
}
+#endif // LLVM_360_AND_NEWER
WriteBitcodeToFile(M.get(), Out->os());