Only output code if file open is successful

llvm-svn: 890
This commit is contained in:
Chris Lattner 2001-10-18 17:07:22 +00:00
parent 6c1fee9a85
commit 236f063966

View File

@ -86,8 +86,6 @@ public:
virtual bool doPassFinalization(Module *M) {
// TODO: This should be performed as a moduleCleanup function, but we don't
// have one yet!
Target.emitAssembly(M, *Out);
if (DeleteStream) delete Out;
@ -147,11 +145,11 @@ int main(int argc, char **argv) {
<< "! SKIPPING OUTPUT OF TRACE CODE\n";
delete os;
retCode = 1;
} else {
Passes.push_back(new PrintModulePass("", os,
/*deleteStream*/ true,
/*printAsBytecode*/ ! DebugTrace));
}
Passes.push_back(new PrintModulePass("", os,
/*deleteStream*/ true,
/*printAsBytecode*/ ! DebugTrace));
}
// If LLVM dumping after transformations is requested, add it to the pipeline