mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-24 00:33:12 +01:00
Add error message when failed to open output stream for native asm output. Fixes ticket #281 .
This commit is contained in:
@@ -235,7 +235,15 @@ void writeModule(llvm::Module* m, std::string filename)
|
||||
std::string err;
|
||||
{
|
||||
llvm::raw_fd_ostream out(spath.c_str(), false, err);
|
||||
write_asm_to_file(*gTargetMachine, *m, out);
|
||||
if (err.empty())
|
||||
{
|
||||
write_asm_to_file(*gTargetMachine, *m, out);
|
||||
}
|
||||
else
|
||||
{
|
||||
error("cannot write native asm: %s", err.c_str());
|
||||
fatal();
|
||||
}
|
||||
}
|
||||
|
||||
// call gcc to convert assembly to object file
|
||||
|
||||
Reference in New Issue
Block a user