diff options
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 94d3afa..31c9640 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -494,6 +494,9 @@ public: // are currently saved in the index in terms of GUID. forEachSummary([&](GVInfo I, bool IsAliasee) { GUIDToValueIdMap[I.first] = ++GlobalValueId; + // If this is invoked for an aliasee, we want to record the above mapping, + // but not the information needed for its summary entry (if the aliasee is + // to be imported, we will invoke this separately with IsAliasee=false). if (IsAliasee) return; auto *FS = dyn_cast<FunctionSummary>(I.second); @@ -4847,6 +4850,11 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() { // radix tree array are identified based on this order. MapVector<CallStackId, llvm::SmallVector<LinearFrameId>> CallStacks; forEachSummary([&](GVInfo I, bool IsAliasee) { + // Don't collect this when invoked for an aliasee, as it is not needed for + // the alias summary. If the aliasee is to be imported, we will invoke this + // separately with IsAliasee=false. + if (IsAliasee) + return; GlobalValueSummary *S = I.second; assert(S); auto *FS = dyn_cast<FunctionSummary>(S); |