summaryrefslogtreecommitdiff
path: root/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-19 01:21:34 +0000
committerDan Gohman <gohman@apple.com>2010-05-19 01:21:34 +0000
commit86026cd24eb8bdffdd6cf94669f98baeb87d8ef3 (patch)
treedf44b747fc48f45b1a481849d02fb701f4c80d05 /lib/Support/Timer.cpp
parent0a942dbb1e0f303191639498c35e742309f08a64 (diff)
downloadllvm-86026cd24eb8bdffdd6cf94669f98baeb87d8ef3.tar.gz
llvm-86026cd24eb8bdffdd6cf94669f98baeb87d8ef3.tar.bz2
llvm-86026cd24eb8bdffdd6cf94669f98baeb87d8ef3.tar.xz
Add a comment explaining why this code uses Append mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Timer.cpp')
-rw-r--r--lib/Support/Timer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp
index 481f6ba508..784b77cf59 100644
--- a/lib/Support/Timer.cpp
+++ b/lib/Support/Timer.cpp
@@ -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);