Skip to content

Commit

Permalink
[Profile] bug fix: profile dir not recursively created
Browse files Browse the repository at this point in the history
llvm-svn: 276234
  • Loading branch information
david-xl committed Jul 21, 2016
1 parent 3813619 commit e3fc4d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler-rt/lib/profile/InstrProfilingFile.c
Expand Up @@ -236,6 +236,11 @@ static void truncateCurrentFile(void) {
__llvm_profile_recursive_mkdir(Copy);
}

/* By pass file truncation to allow online raw profile
* merging. */
if (lprofCurFilename.MergePoolSize)
return;

/* Truncate the file. Later we'll reopen and append. */
File = fopen(Filename, "w");
if (!File)
Expand Down Expand Up @@ -350,8 +355,7 @@ static void parseAndSetFilename(const char *FilenamePat,
getPNSStr(PNS));
}

if (!lprofCurFilename.MergePoolSize)
truncateCurrentFile();
truncateCurrentFile();
}

/* Return buffer length that is required to store the current profile
Expand Down

0 comments on commit e3fc4d0

Please sign in to comment.