summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/InstrProf.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-03-28 01:16:12 +0000
committerVedant Kumar <vsk@apple.com>2016-03-28 01:16:12 +0000
commit141ed944920e969d6adc4135aa346315395614fd (patch)
tree4f2446c16f09ed40239d700a4268dc81d0735f5d /llvm/lib/ProfileData/InstrProf.cpp
parent544e4f97b3ada9e3483477c5479044f7d7f8e4c0 (diff)
downloadbcm5719-llvm-141ed944920e969d6adc4135aa346315395614fd.tar.gz
bcm5719-llvm-141ed944920e969d6adc4135aa346315395614fd.zip
[Coverage] Fix the way we load "<unknown>:func" records
When emitting coverage mappings for functions with local linkage and an unknown filename, we use "<unknown>:func" for the PGO function name. The problem is that we don't strip "<unknown>" from the name when loading coverage data, like we do for other file names. Fix that and add a test. llvm-svn: 264559
Diffstat (limited to 'llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index 2446521a5bc..045ba1a7b34 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -90,7 +90,7 @@ std::string getPGOFuncName(const Function &F, uint64_t Version) {
StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName, StringRef FileName) {
if (FileName.empty())
- return PGOFuncName;
+ FileName = "<unknown>";
// Drop the file name including ':'. See also getPGOFuncName.
if (PGOFuncName.startswith(FileName))
PGOFuncName = PGOFuncName.drop_front(FileName.size() + 1);
OpenPOWER on IntegriCloud