summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-07-03 01:11:43 +0000
committerTeresa Johnson <tejohnson@google.com>2018-07-03 01:11:43 +0000
commitf8182f1aef5b6ec74cbe2c1618e759f0113921ba (patch)
tree6a4ae9ee8bdce21c3601326b6cb205525e6a910a /llvm/lib/IR
parent0409a8ade790db39634701c46e6eb31f8a923b2e (diff)
downloadbcm5719-llvm-f8182f1aef5b6ec74cbe2c1618e759f0113921ba.tar.gz
bcm5719-llvm-f8182f1aef5b6ec74cbe2c1618e759f0113921ba.zip
[ThinLTO] Fix printing of aliases for distributed backend indexes
Summary: When we import an alias (which will import a copy of the aliasee), but aren't going to import the aliasee directly, the distributed backend index will not contain the aliasee summary. Handle this in the summary assembly printer by printing "null" as the aliasee. Reviewers: davidxl, dexonsmith Subscribers: mehdi_amini, inglorion, eraman, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D48699 llvm-svn: 336160
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp10
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) {
OpenPOWER on IntegriCloud