From 555e41bbf22514ab02d634a79ac4741e24ce89b4 Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Wed, 27 Jun 2018 16:34:30 +0000 Subject: [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 `` 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 --- llvm/lib/Analysis/AliasSetTracker.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp') 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"; -- cgit v1.2.3