summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-10 18:47:59 +0000
committerDan Gohman <gohman@apple.com>2009-03-10 18:47:59 +0000
commit79fc0e9250dd1cfc2af26cd94c6310eb9032329d (patch)
tree68c5b21d187a29238c0df40dc9e190dbade507ce
parent65b2c4c3817beb0f0e456fafb921c5156d80dd00 (diff)
downloadbcm5719-llvm-79fc0e9250dd1cfc2af26cd94c6310eb9032329d.tar.gz
bcm5719-llvm-79fc0e9250dd1cfc2af26cd94c6310eb9032329d.zip
Use WriteAsOperand instead of manually decorating the name for this
debug output. This improves the printing of anonymous values. llvm-svn: 66561
-rw-r--r--llvm/lib/VMCore/PassManager.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp
index 174aa474dfb..dd035487be5 100644
--- a/llvm/lib/VMCore/PassManager.cpp
+++ b/llvm/lib/VMCore/PassManager.cpp
@@ -77,20 +77,17 @@ void PassManagerPrettyStackEntry::print(raw_ostream &OS) const {
return;
}
- std::string Name = V->getNameStr();
- if (Name.empty())
- Name = "<anonymous>";
- else if (isa<GlobalValue>(V))
- Name = "@" + Name;
- else
- Name = "%" + Name;
-
+ OS << " on ";
if (isa<Function>(V))
- OS << " on function '" << Name << "'\n";
+ OS << "function";
else if (isa<BasicBlock>(V))
- OS << " on basic block '" << Name << "'\n";
+ OS << "basic block";
else
- OS << " on value '" << Name << "'\n";
+ OS << "value";
+
+ OS << " '";
+ WriteAsOperand(OS, V, /*PrintTy=*/false, M);
+ OS << "'\n";
}
OpenPOWER on IntegriCloud