diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 736a836b490..9eaa29678e3 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -2788,8 +2788,14 @@ static const char *getSummaryKindName(GlobalValueSummary::SummaryKind SK) { } void AssemblyWriter::printAliasSummary(const AliasSummary *AS) { - Out << ", aliasee: ^" - << Machine.getGUIDSlot(SummaryToGUIDMap[&AS->getAliasee()]); + Out << ", aliasee: "; + // The indexes emitted for distributed backends may not include the + // aliasee summary (only if it is being imported directly). Handle + // that case by just emitting "null" as the aliasee. + if (AS->hasAliasee()) + Out << "^" << Machine.getGUIDSlot(SummaryToGUIDMap[&AS->getAliasee()]); + else + Out << "null"; } void AssemblyWriter::printGlobalVarSummary(const GlobalVarSummary *GS) { |