summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-02-20 19:52:32 +0000
committerBob Wilson <bob.wilson@apple.com>2014-02-20 19:52:32 +0000
commit96e99556ada11c393371ce769202fd9a8d1fe515 (patch)
tree1a5d5bf34aa61b1967b776bd1d4e04c3a0343c17
parent0e79c0002e550ce72f7a702916572abfaaf30ba2 (diff)
downloadbcm5719-llvm-96e99556ada11c393371ce769202fd9a8d1fe515.tar.gz
bcm5719-llvm-96e99556ada11c393371ce769202fd9a8d1fe515.zip
Add an environment variable to override the default profile output file.
Also rename the default output file from "pgo-data" to "default.profdata". The ".profdata" suffix is consistent with the name of the new llvm-profdata tool. llvm-svn: 201808
-rw-r--r--compiler-rt/lib/profile/PGOProfiling.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler-rt/lib/profile/PGOProfiling.c b/compiler-rt/lib/profile/PGOProfiling.c
index 6c728dd124d..d82ac315c25 100644
--- a/compiler-rt/lib/profile/PGOProfiling.c
+++ b/compiler-rt/lib/profile/PGOProfiling.c
@@ -56,7 +56,10 @@ void llvm_pgo_register_writeout_function(writeout_fn fn) {
}
void llvm_pgo_writeout_files() {
- OutputFile = fopen("pgo-data", "w");
+ const char *OutputName = getenv("LLVM_PROFILE_FILE");
+ if (OutputName == NULL || OutputName[0] == '\0')
+ OutputName = "default.profdata";
+ OutputFile = fopen(OutputName, "w");
if (!OutputFile) return;
while (writeout_fn_head) {
OpenPOWER on IntegriCloud