diff options
| author | Xinliang David Li <davidxl@google.com> | 2017-08-23 21:39:33 +0000 |
|---|---|---|
| committer | Xinliang David Li <davidxl@google.com> | 2017-08-23 21:39:33 +0000 |
| commit | c7c5303fa300e0d64dc402d8cd40bf24f6f4cc58 (patch) | |
| tree | 2c6b06d31d97e537e286efc096e93a32d6bf63ea | |
| parent | a845167dcaad7c099d8d29eed578565fa1d3511a (diff) | |
| download | bcm5719-llvm-c7c5303fa300e0d64dc402d8cd40bf24f6f4cc58.tar.gz bcm5719-llvm-c7c5303fa300e0d64dc402d8cd40bf24f6f4cc58.zip | |
[Profile] create a copy of profile file name from environment
Original patch by Max Moroz.
Differential Revsion: http://reviews.llvm.org/D36903
llvm-svn: 311607
| -rw-r--r-- | compiler-rt/lib/profile/InstrProfilingFile.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c index d038bb9cb5b..8ae2b7d986b 100644 --- a/compiler-rt/lib/profile/InstrProfilingFile.c +++ b/compiler-rt/lib/profile/InstrProfilingFile.c @@ -519,8 +519,10 @@ void __llvm_profile_initialize_file(void) { EnvFilenamePat = getFilenamePatFromEnv(); if (EnvFilenamePat) { - SelectedPat = EnvFilenamePat; - PNS = PNS_environment; + /* Pass CopyFilenamePat = 1, to ensure that the filename would be valid + at the moment when __llvm_profile_write_file() gets executed. */ + parseAndSetFilename(EnvFilenamePat, PNS_environment, 1); + return; } else if (hasCommandLineOverrider) { SelectedPat = INSTR_PROF_PROFILE_NAME_VAR; PNS = PNS_command_line; |

