[PATCH] D49529: [profile] Add interface to get profile filename

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 09:26:28 PDT 2018


davidxl added inline comments.


================
Comment at: lib/profile/InstrProfilingFile.c:529
+  Length = getCurFilenameLength();
+  FilenameBuf = (char *)COMPILER_RT_ALLOCA(Length + 1);
+  Filename = getCurFilename(FilenameBuf);
----------------
tejohnson wrote:
> davidxl wrote:
> > Why not directly passing the malloced buffer to getCurFilename?
> getCurFilename doesn't always use the provided FilenameBuf, only if it needs to substitute in a value to the filename pattern. If not, the FilenamePat is returned (note also that this code is modeled after __llvm_profile_get_path_prefix).
Perhaps add an additional argument to getCurFilename to force copying into the buffer?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49529





More information about the llvm-commits mailing list