diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 9fb5d66a5ac..82e2cab6056 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -3121,10 +3121,8 @@ void ModuleBitcodeWriter::writePerModuleGlobalValueSummary() { report_fatal_error("Unexpected anonymous function when writing summary"); auto *Summary = Index->getGlobalValueSummary(F); - writePerModuleFunctionSummaryRecord( - NameVals, Summary, - VE.getValueID(M.getValueSymbolTable().lookup(F.getName())), - FSCallsAbbrev, FSCallsProfileAbbrev, F); + writePerModuleFunctionSummaryRecord(NameVals, Summary, VE.getValueID(&F), + FSCallsAbbrev, FSCallsProfileAbbrev, F); } // Capture references from GlobalVariable initializers, which are outside