================ @@ -181,20 +182,19 @@ std::string hashBlockCalls(BinaryContext &BC, const BinaryBasicBlock &BB) { /// The same as the $hashBlockCalls function, but for profiled functions. std::string -hashBlockCalls(const DenseMap<uint32_t, StringRef> &IdToFunctionName, +hashBlockCalls(const DenseMap<uint32_t, yaml::bolt::BinaryFunctionProfile *> + &IdToYamlFunction, const yaml::bolt::BinaryBasicBlockProfile &YamlBB) { - std::multiset<std::string> FunctionNames; + std::vector<std::string> FunctionNames; for (const yaml::bolt::CallSiteInfo &CallSiteInfo : YamlBB.CallSites) { - auto It = IdToFunctionName.find(CallSiteInfo.DestId); - if (It == IdToFunctionName.end()) + auto It = IdToYamlFunction.find(CallSiteInfo.DestId); + if (It == IdToYamlFunction.end()) continue; - StringRef Name = It->second; - const size_t Pos = Name.find("(*"); - if (Pos != StringRef::npos) - Name = Name.substr(0, Pos); - FunctionNames.insert(std::string(Name)); + StringRef Name = + NameResolver::removeSuffix(It->second->Name, StringRef("(*")); ---------------- aaupov wrote:
I think the intent of Maksim's comment was to hide an implementation detail (using `(*N)` suffix) in relevant component (NameResolver). https://github.com/llvm/llvm-project/pull/96596 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits