Allow TargetMachine to refuse static code gen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4415 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-10-29 21:12:46 +00:00
parent 083ee69349
commit 6334205cb5
4 changed files with 17 additions and 9 deletions

View File

@@ -281,10 +281,14 @@ main(int argc, char **argv)
}
}
Target.addPassesToEmitAssembly(Passes, *Out);
// Run our queue of passes all at once now, efficiently.
Passes.run(*M.get());
// Ask the target to add backend passes as neccesary
if (Target.addPassesToEmitAssembly(Passes, *Out)) {
cerr << argv[0] << ": target '" << Target.TargetName
<< " does not support static compilation!\n";
} else {
// Run our queue of passes all at once now, efficiently.
Passes.run(*M.get());
}
// Delete the ostream if it's not a stdout stream
if (Out != &std::cout) delete Out;