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 | 24934efcf6297f55238c5eb6a986dfaaffe6ea29 (patch) | |
tree | 805382b2d2a875b3de84a4b8e9d27aa81e067c21 /lib/profile | |
parent | fc10971680641fdfe828aca3065bd591f71ead3e (diff) | |
download | compiler-rt-24934efcf6297f55238c5eb6a986dfaaffe6ea29.tar.gz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile')
-rw-r--r-- | lib/profile/PGOProfiling.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/profile/PGOProfiling.c b/lib/profile/PGOProfiling.c index 6c728dd12..d82ac315c 100644 --- a/lib/profile/PGOProfiling.c +++ b/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) { |