Add error message when failed to open output stream for native asm output. Fixes ticket #281 .

This commit is contained in:
Tomas Lindquist Olsen
2009-05-17 14:20:27 +02:00
parent b52ee2de13
commit 0a77bd9fa6

View File

@@ -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