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;
|
llvm::sys::fs::OpenFlags flags = llvm::sys::fs::F_None;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||||
std::string error;
|
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);
|
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()) {
|
if (error.size()) {
|
||||||
|
#else // LLVM 3.6+
|
||||||
|
if (error) {
|
||||||
|
#endif
|
||||||
fprintf(stderr, "Error opening output file \"%s\".\n", fn);
|
fprintf(stderr, "Error opening output file \"%s\".\n", fn);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
11
module.cpp
11
module.cpp
@@ -1088,9 +1088,20 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(LLVM_3_2) || defined(LLVM_3_3) || defined(LLVM_3_4) || defined(LLVM_3_5)
|
||||||
std::string error;
|
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);
|
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()) {
|
if (error.size()) {
|
||||||
|
#else // LLVM 3.6+
|
||||||
|
if (error) {
|
||||||
|
#endif
|
||||||
|
|
||||||
fprintf(stderr, "Error opening output file \"%s\".\n", outFileName);
|
fprintf(stderr, "Error opening output file \"%s\".\n", outFileName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user