File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1212#include " llvm/Support/ToolOutputFile.h"
1313#include " llvm/Config/llvm-config.h"
1414
15+ #define LLVM_360_AND_NEWER \
16+ (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6 ))
17+
1518#define LLVM_350_AND_NEWER \
1619 (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5 ))
1720
@@ -95,6 +98,15 @@ int main(int argc, char **argv) {
9598 return 1 ;
9699 }
97100
101+ #if LLVM_360_AND_NEWER
102+ std::error_code EC;
103+ UNIQUE_PTR<tool_output_file> Out
104+ (new tool_output_file (OutputFilename, EC, sys::fs::F_None));
105+ if (EC) {
106+ errs () << EC.message () << ' \n ' ;
107+ exit (1 );
108+ }
109+ #else
98110 std::string ErrorInfo;
99111 UNIQUE_PTR<tool_output_file> Out
100112 (new tool_output_file (OutputFilename.c_str (), ErrorInfo,
@@ -109,6 +121,7 @@ int main(int argc, char **argv) {
109121 errs () << ErrorInfo << ' \n ' ;
110122 exit (1 );
111123 }
124+ #endif // LLVM_360_AND_NEWER
112125
113126 WriteBitcodeToFile (M.get (), Out->os ());
114127
You can’t perform that action at this time.
0 commit comments