================ @@ -902,12 +890,16 @@ std::error_code SampleProfileReaderExtBinaryBase::readFuncProfiles() { for (const auto &NameOffset : FuncOffsetList) { const auto &FContext = NameOffset.first; auto FName = FContext.getName(); + StringRef FNameString; + if (!useMD5()) { + FNameString = FName.stringRef(Buffer); + } // For function in the current module, keep its farthest ancestor // context. This can be used to load itself and its child and // sibling contexts. - if ((useMD5() && FuncGuidsToUse.count(std::stoull(FName.data()))) || - (!useMD5() && (FuncsToUse.count(FName) || - (Remapper && Remapper->exist(FName))))) { + if ((useMD5() && FuncGuidsToUse.count(FName.getHashCode())) || + (!useMD5() && (FuncsToUse.count(FNameString) || ---------------- huangjd wrote:
Actually regarding this, because @MatzeB mentioned the interface "StringRef ProfileFuncRef::stringRef(std::string &Buffer)" is not elegant, would it be better to just have "StringRef ProfileFuncRef::stringRef()" and only allow it being used if we know the ProfileFuncRef is representing a string for sure, and let the compiler crash if used otherwise? https://github.com/llvm/llvm-project/pull/66164 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits