[llvm-commits] [llvm] r64468 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Dan Gohman gohman at apple.com
Fri Feb 13 09:45:13 PST 2009


Author: djg
Date: Fri Feb 13 11:45:12 2009
New Revision: 64468

URL: http://llvm.org/viewvc/llvm-project?rev=64468&view=rev
Log:
In CodeGenPrepare's debug output, use WriteAsOperand instead of
printing getName(), so that unnamed values are printed correctly.

Modified:
    llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=64468&r1=64467&r2=64468&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Feb 13 11:45:12 2009
@@ -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 @@
 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 << ']';
 }





More information about the llvm-commits mailing list