[llvm] r350667 - [PGO] Revert r350442 to fix commit message.

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 8 14:33:29 PST 2019


Author: xur
Date: Tue Jan  8 14:33:29 2019
New Revision: 350667

URL: http://llvm.org/viewvc/llvm-project?rev=350667&view=rev
Log:
[PGO] Revert r350442 to fix commit message.

Will re-commit it using the correct commit message.

Modified:
    llvm/trunk/lib/ProfileData/InstrProf.cpp

Modified: llvm/trunk/lib/ProfileData/InstrProf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=350667&r1=350666&r2=350667&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProf.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProf.cpp Tue Jan  8 14:33:29 2019
@@ -252,12 +252,11 @@ static StringRef stripDirPrefix(StringRe
 // data, its original linkage must be non-internal.
 std::string getPGOFuncName(const Function &F, bool InLTO, uint64_t Version) {
   if (!InLTO) {
-    StringRef FileName(F.getParent()->getSourceFileName());
-    uint32_t StripLevel = StaticFuncFullModulePrefix ? 0 : (uint32_t)-1;
-    if (StripLevel < StaticFuncStripDirNamePrefix)
-      StripLevel = StaticFuncStripDirNamePrefix;
-    if (StripLevel)
-      FileName = stripDirPrefix(FileName, StripLevel);
+    StringRef FileName = (StaticFuncFullModulePrefix
+                              ? F.getParent()->getName()
+                              : sys::path::filename(F.getParent()->getName()));
+    if (StaticFuncFullModulePrefix && StaticFuncStripDirNamePrefix != 0)
+      FileName = stripDirPrefix(FileName, StaticFuncStripDirNamePrefix);
     return getPGOFuncName(F.getName(), F.getLinkage(), FileName, Version);
   }
 




More information about the llvm-commits mailing list