diff options
author | Bob Wilson <bob.wilson@apple.com> | 2014-02-20 19:52:32 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2014-02-20 19:52:32 +0000 |
commit | 96e99556ada11c393371ce769202fd9a8d1fe515 (patch) | |
tree | 1a5d5bf34aa61b1967b776bd1d4e04c3a0343c17 | |
parent | 0e79c0002e550ce72f7a702916572abfaaf30ba2 (diff) | |
download | bcm5719-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.c | 5 |
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) { |