diff options
| author | Rong Xu <xur@google.com> | 2019-01-08 22:33:29 +0000 |
|---|---|---|
| committer | Rong Xu <xur@google.com> | 2019-01-08 22:33:29 +0000 |
| commit | d236b0aa93b3b63b939b1ba495124ccc362dd3c7 (patch) | |
| tree | 45e10822a2459129b9eb72b27f6fe2e3664d9c4a /llvm/lib | |
| parent | 65317e1ca0700fc124612cb6659679b6d8e73601 (diff) | |
| download | bcm5719-llvm-d236b0aa93b3b63b939b1ba495124ccc362dd3c7.tar.gz bcm5719-llvm-d236b0aa93b3b63b939b1ba495124ccc362dd3c7.zip | |
[PGO] Revert r350442 to fix commit message.
Will re-commit it using the correct commit message.
llvm-svn: 350667
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index aaa8000ff2f..544a77ec20a 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -252,12 +252,11 @@ static StringRef stripDirPrefix(StringRef PathNameStr, uint32_t NumPrefix) { // 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); } |

