[llvm-commits] [llvm] r111644 - /llvm/trunk/utils/TableGen/TableGen.cpp
Dan Gohman
gohman at apple.com
Fri Aug 20 09:45:59 PDT 2010
Author: djg
Date: Fri Aug 20 11:45:58 2010
New Revision: 111644
URL: http://llvm.org/viewvc/llvm-project?rev=111644&view=rev
Log:
Convert tablegen to use tool_output_file.
Modified:
llvm/trunk/utils/TableGen/TableGen.cpp
Modified: llvm/trunk/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=111644&r1=111643&r2=111644&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/TableGen.cpp (original)
+++ llvm/trunk/utils/TableGen/TableGen.cpp Fri Aug 20 11:45:58 2010
@@ -216,16 +216,13 @@
return 1;
std::string Error;
- raw_fd_ostream Out(OutputFilename.c_str(), Error);
+ tool_output_file Out(OutputFilename.c_str(), Error);
if (!Error.empty()) {
errs() << argv[0] << ": error opening " << OutputFilename
<< ":" << Error << "\n";
return 1;
}
- // Make sure the file gets removed if *gasp* tablegen crashes...
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
-
try {
switch (Action) {
case PrintRecords:
@@ -339,6 +336,8 @@
return 1;
}
+ // Declare success.
+ Out.keep();
return 0;
} catch (const TGError &Error) {
@@ -353,7 +352,5 @@
errs() << argv[0] << ": Unknown unexpected exception occurred.\n";
}
- if (OutputFilename != "-")
- std::remove(OutputFilename.c_str()); // Remove the file, it's broken
return 1;
}
More information about the llvm-commits
mailing list