Use WriteAsOperand to print GlobalAddress MachineOperands. This
authorDan Gohman <gohman@apple.com>
Fri, 6 Nov 2009 18:03:10 +0000 (18:03 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 6 Nov 2009 18:03:10 +0000 (18:03 +0000)
prints them with the leading '@'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86261 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp

index 5744c8a54552947c7115c39b418d0ede33094a61..bd1815889b4f51d6fd1ef6ab3b1f2580ce5bd111 100644 (file)
@@ -265,7 +265,8 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {
     OS << "<jt#" << getIndex() << '>';
     break;
   case MachineOperand::MO_GlobalAddress:
-    OS << "<ga:" << ((Value*)getGlobal())->getName();
+    OS << "<ga:";
+    WriteAsOperand(OS, getGlobal(), /*PrintType=*/false);
     if (getOffset()) OS << "+" << getOffset();
     OS << '>';
     break;