================ @@ -560,35 +586,50 @@ Error InstrProfSymtab::initVTableNamesFromCompressedStrings( std::bind(&InstrProfSymtab::addVTableName, this, std::placeholders::_1)); } -Error InstrProfSymtab::addFuncWithName(Function &F, StringRef PGOFuncName) { - if (Error E = addFuncName(PGOFuncName)) - return E; - MD5FuncMap.emplace_back(Function::getGUID(PGOFuncName), &F); +StringRef InstrProfSymtab::getCanonicalName(StringRef PGOName, ---------------- minglotus-6 wrote:
Unifying the two (and parameterizing the difference between instr and sample profiles like [`FunctionSamples::HasUniqSuffix`](https://github.com/llvm/llvm-project/blob/91dcf53abd34fa836a126c706f87b810d299d802/llvm/include/llvm/ProfileData/SampleProf.h#L1111) as function arguments) makes sense, and the [nfc patch](https://github.com/llvm/llvm-project/pull/81547) has a FIXME to do this. A new file named `llvm/lib/ProfileData/ProfileCommon.cpp` seems a good place for the helper function. Currently `llvm/include/llvm/ProfileData/ProfileCommon.h` contains common classes used by sample and instr profiles. https://github.com/llvm/llvm-project/pull/81051 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits