summaryrefslogtreecommitdiff
path: root/lib/profile
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
commit24934efcf6297f55238c5eb6a986dfaaffe6ea29 (patch)
tree805382b2d2a875b3de84a4b8e9d27aa81e067c21 /lib/profile
parentfc10971680641fdfe828aca3065bd591f71ead3e (diff)
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.c5
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) {