Merge pull request #851 from Vsevolod-Livinskij/fix_216393
Fix for llvm revision 216393
This commit is contained in:
10
cbackend.cpp
10
cbackend.cpp
@@ -4945,9 +4945,19 @@ WriteCXXFile(llvm::Module *module, const char *fn, int vectorWidth,
|
||||
llvm::sys::fs::OpenFlags flags = llvm::sys::fs::F_None;
|
||||
#endif
|
||||
|
||||
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||
std::string error;
|
||||
#else // LLVM 3.6+
|
||||
std::error_code error;
|
||||
#endif
|
||||
|
||||
llvm::tool_output_file *of = new llvm::tool_output_file(fn, error, flags);
|
||||
|
||||
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||
if (error.size()) {
|
||||
#else // LLVM 3.6+
|
||||
if (error) {
|
||||
#endif
|
||||
fprintf(stderr, "Error opening output file \"%s\".\n", fn);
|
||||
return false;
|
||||
}
|
||||
|
||||
11
module.cpp
11
module.cpp
@@ -1088,9 +1088,20 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine,
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||
std::string error;
|
||||
#else // LLVM 3.6+
|
||||
std::error_code error;
|
||||
#endif
|
||||
|
||||
llvm::tool_output_file *of = new llvm::tool_output_file(outFileName, error, flags);
|
||||
|
||||
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||
if (error.size()) {
|
||||
#else // LLVM 3.6+
|
||||
if (error) {
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "Error opening output file \"%s\".\n", outFileName);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user