summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorJakub Kuderski <kubakuderski@gmail.com>2018-06-27 16:34:30 +0000
committerJakub Kuderski <kubakuderski@gmail.com>2018-06-27 16:34:30 +0000
commit555e41bbf22514ab02d634a79ac4741e24ce89b4 (patch)
tree134795179dee07a9cdf973b2d6d62ba65cca993d /llvm/lib/Analysis/AliasSetTracker.cpp
parent7b7b5eb60ddbece40c28b54f9b94635d900c360f (diff)
downloadbcm5719-llvm-555e41bbf22514ab02d634a79ac4741e24ce89b4.tar.gz
bcm5719-llvm-555e41bbf22514ab02d634a79ac4741e24ce89b4.zip
[AliasSet] Fix UnknownInstructions printing
Summary: AliasSet::print uses `I->printAsOperand` to print UnknownInstructions. The problem is that not all UnknownInstructions have names (e.g. call instructions). When such instructions are printed, they appear as `<badref>` in AliasSets, which is very confusing, as the values are perfectly valid. This patch fixes that by printing UnknownInstructions without a name using `print` instead of `printAsOperand`. Reviewers: asbirlea, chandlerc, sanjoy, grosser Reviewed By: asbirlea Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48609 llvm-svn: 335751
Diffstat (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index 7ed23af5589..8aee81b1f1d 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -639,8 +639,12 @@ void AliasSet::print(raw_ostream &OS) const {
OS << "\n " << UnknownInsts.size() << " Unknown instructions: ";
for (unsigned i = 0, e = UnknownInsts.size(); i != e; ++i) {
if (i) OS << ", ";
- if (auto *I = getUnknownInst(i))
- I->printAsOperand(OS);
+ if (auto *I = getUnknownInst(i)) {
+ if (I->hasName())
+ I->printAsOperand(OS);
+ else
+ I->print(OS);
+ }
}
}
OS << "\n";
OpenPOWER on IntegriCloud