File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1515
1616using namespace llvm ;
1717
18+ #define LLVM_350_AND_NEWER \
19+ (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5 ))
20+
21+ #if LLVM_350_AND_NEWER
22+ #define ERROR_CODE std::error_code
23+ #else
24+ #define ERROR_CODE error_code
25+ #endif
26+
1827static cl::opt<std::string>
1928InputFilename (cl::Positional, cl::desc(" <input bitcode>" ), cl::init(" -" ));
2029
@@ -37,12 +46,12 @@ int main(int argc, char **argv) {
3746#else
3847 OwningPtr<MemoryBuffer> BufferPtr;
3948#endif
40- if (error_code ec = MemoryBuffer::getFileOrSTDIN (InputFilename, BufferPtr))
49+ if (ERROR_CODE ec = MemoryBuffer::getFileOrSTDIN (InputFilename, BufferPtr))
4150 ErrorMessage = ec.message ();
4251 else {
4352#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
4453 ErrorOr<Module *> ModuleOrErr = parseBitcodeFile (BufferPtr.get (), Context);
45- if (error_code ec = ModuleOrErr.getError ())
54+ if (ERROR_CODE ec = ModuleOrErr.getError ())
4655 ErrorMessage = ec.message ();
4756 M.reset (ModuleOrErr.get ());
4857#else
You can’t perform that action at this time.
0 commit comments