mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Use tool_output_file in llvm-extract and llvm-link too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -116,14 +116,9 @@ int main(int argc, char **argv) {
|
||||
Passes.add(createDeadTypeEliminationPass()); // Remove dead types...
|
||||
Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls
|
||||
|
||||
// Make sure that the Output file gets unlinked from the disk if we get a
|
||||
// SIGINT
|
||||
if (OutputFilename != "-")
|
||||
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
|
||||
|
||||
std::string ErrorInfo;
|
||||
raw_fd_ostream Out(OutputFilename.c_str(), ErrorInfo,
|
||||
raw_fd_ostream::F_Binary);
|
||||
tool_output_file Out(OutputFilename.c_str(), ErrorInfo,
|
||||
raw_fd_ostream::F_Binary);
|
||||
if (!ErrorInfo.empty()) {
|
||||
errs() << ErrorInfo << '\n';
|
||||
return 1;
|
||||
@@ -136,5 +131,8 @@ int main(int argc, char **argv) {
|
||||
|
||||
Passes.run(*M.get());
|
||||
|
||||
// Declare success.
|
||||
Out.keep();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user