aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-13 17:45:12 +0000
committerDan Gohman <gohman@apple.com>2009-02-13 17:45:12 +0000
commit03ce042d70c423a41edca0714112a0e06b16493b (patch)
treed7b2590423cfc8182bb89c8474607588447a6d9c /lib/Transforms/Scalar/CodeGenPrepare.cpp
parente6986965691543d5415b98571801141b6a974984 (diff)
In CodeGenPrepare's debug output, use WriteAsOperand instead of
printing getName(), so that unnamed values are printed correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 12c76e8525..f2288dae3b 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -29,6 +29,7 @@
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallSet.h"
+#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
@@ -574,19 +575,28 @@ static inline OStream &operator<<(OStream &OS, const ExtAddrMode &AM) {
void ExtAddrMode::print(OStream &OS) const {
bool NeedPlus = false;
OS << "[";
- if (BaseGV)
+ if (BaseGV) {
OS << (NeedPlus ? " + " : "")
- << "GV:%" << BaseGV->getName(), NeedPlus = true;
+ << "GV:";
+ WriteAsOperand(*OS.stream(), BaseGV, /*PrintType=*/false);
+ NeedPlus = true;
+ }
if (BaseOffs)
OS << (NeedPlus ? " + " : "") << BaseOffs, NeedPlus = true;
- if (BaseReg)
+ if (BaseReg) {
OS << (NeedPlus ? " + " : "")
- << "Base:%" << BaseReg->getName(), NeedPlus = true;
- if (Scale)
+ << "Base:";
+ WriteAsOperand(*OS.stream(), BaseReg, /*PrintType=*/false);
+ NeedPlus = true;
+ }
+ if (Scale) {
OS << (NeedPlus ? " + " : "")
- << Scale << "*%" << ScaledReg->getName(), NeedPlus = true;
+ << Scale << "*";
+ WriteAsOperand(*OS.stream(), ScaledReg, /*PrintType=*/false);
+ NeedPlus = true;
+ }
OS << ']';
}