================
@@ -4612,12 +4590,22 @@ void
ModuleBitcodeWriterBase::writePerModuleFunctionSummaryRecord(
/*WriteContextSizeInfoIndex*/ true, CallStackPos, CallStackCount);
}
+static GlobalValue::GUID getOrComputeGUID(const GlobalValue &V) {
+ auto MaybeGUID = V.getGUIDIfAssigned();
+ return MaybeGUID ? *MaybeGUID
+ : GlobalValue::getGUIDAssumingExternalLinkage(V.getName());
+}
+
// Collect the global value references in the given variable's initializer,
// and emit them in a summary record.
void ModuleBitcodeWriterBase::writeModuleLevelReferences(
const GlobalVariable &V, SmallVector<uint64_t, 64> &NameVals,
unsigned FSModRefsAbbrev, unsigned FSModVTableRefsAbbrev) {
- auto VI = Index->getValueInfo(V.getGUID());
+ // Be a little lenient here, to accomodate older files without GUIDs
----------------
orodley wrote:
Mainly for tests, but I recall from our discussions that we also want to be
backwards-compatible with old bitcode files?
https://github.com/llvm/llvm-project/pull/184065
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits