Index: include/llvm/ProfileData/InstrProf.h =================================================================== --- include/llvm/ProfileData/InstrProf.h +++ include/llvm/ProfileData/InstrProf.h @@ -30,7 +30,7 @@ #include #include -#define INSTR_PROF_INDEX_VERSION 3 +#define INSTR_PROF_INDEX_VERSION 4 namespace llvm { class Function; Index: lib/ProfileData/InstrProf.cpp =================================================================== --- lib/ProfileData/InstrProf.cpp +++ lib/ProfileData/InstrProf.cpp @@ -74,14 +74,15 @@ std::string getPGOFuncName(StringRef RawFuncName, GlobalValue::LinkageTypes Linkage, - StringRef FileName, - uint64_t Version LLVM_ATTRIBUTE_UNUSED) { + StringRef FileName, uint64_t Version) { // Function names may be prefixed with a binary '1' to indicate // that the backend should not modify the symbols due to any platform // naming convention. Do not include that '1' in the PGO profile name. if (RawFuncName[0] == '\1') RawFuncName = RawFuncName.substr(1); + const char *Unknown = (Version <= 3 ? ":" : "__unknown__"); + const char *Sep = (Version <= 3 ? ":" : "__"); std::string FuncName = RawFuncName; if (llvm::GlobalValue::isLocalLinkage(Linkage)) { @@ -90,9 +91,9 @@ // that it will stay the same, e.g., if the files are checked out from // version control in different locations. if (FileName.empty()) - FuncName = FuncName.insert(0, ":"); + FuncName = FuncName.insert(0, Unknown); else - FuncName = FuncName.insert(0, FileName.str() + ":"); + FuncName = FuncName.insert(0, FileName.str() + Sep); } return FuncName; }