Add a comment explaining why this code uses Append mode.
authorDan Gohman <gohman@apple.com>
Wed, 19 May 2010 01:21:34 +0000 (01:21 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 19 May 2010 01:21:34 +0000 (01:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104095 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Timer.cpp

index 481f6ba5086da3cd95cf7c98b7abf4287babcf61..784b77cf591a6030ab1ad5bae5a64ed938be452b 100644 (file)
@@ -61,6 +61,10 @@ raw_ostream *llvm::CreateInfoOutputFile() {
   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);