From a10b492ce3008cfb932ab4844424c43951dedd8c Mon Sep 17 00:00:00 2001 From: Michel Danzer Date: Thu, 28 Aug 2014 06:19:33 +0000 Subject: Fix build against LLVM SVN >= r216393 Tested-by: Aaron Watry llvm-svn: 216653 --- libclc/utils/prepare-builtins.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libclc') diff --git a/libclc/utils/prepare-builtins.cpp b/libclc/utils/prepare-builtins.cpp index 726866e2a1a..afa64a8b93c 100644 --- a/libclc/utils/prepare-builtins.cpp +++ b/libclc/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 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 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()); -- cgit v1.2.3