[llvm-commits] [llvm] r104095 - /llvm/trunk/lib/Support/Timer.cpp
Dan Gohman
gohman at apple.com
Tue May 18 18:21:35 PDT 2010
Author: djg
Date: Tue May 18 20:21:34 2010
New Revision: 104095
URL: http://llvm.org/viewvc/llvm-project?rev=104095&view=rev
Log:
Add a comment explaining why this code uses Append mode.
Modified:
llvm/trunk/lib/Support/Timer.cpp
Modified: llvm/trunk/lib/Support/Timer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=104095&r1=104094&r2=104095&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Timer.cpp (original)
+++ llvm/trunk/lib/Support/Timer.cpp Tue May 18 20:21:34 2010
@@ -61,6 +61,10 @@
if (OutputFilename == "-")
return new raw_fd_ostream(1, false); // stdout.
+ // Append mode is used because the info output file is opened and closed
+ // each time -stats or -time-passes wants to print output to it. To
+ // compensate for this, the test-suite Makefiles have code to delete the
+ // info output file before running commands which write to it.
std::string Error;
raw_ostream *Result = new raw_fd_ostream(OutputFilename.c_str(),
Error, raw_fd_ostream::F_Append);
More information about the llvm-commits
mailing list