disentangle call operands from branch operands a bit
authorChris Lattner <sabre@nondot.org>
Thu, 17 Nov 2005 19:16:08 +0000 (19:16 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Nov 2005 19:16:08 +0000 (19:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24400 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCInstrInfo.td

index 9ef6579d304bd8974d952848a8721d9f173e276b..0b6fa5a3b3030d34571682c842e29ed7bae2d143 100644 (file)
@@ -148,10 +148,13 @@ namespace {
       if (MI->getOperand(OpNo).isImmediate()) {
         O << "$+" << MI->getOperand(OpNo).getImmedValue();
       } else {
-        printOp(MI->getOperand(OpNo),
-                TM.getInstrInfo()->isCall(MI->getOpcode()));
+        printOp(MI->getOperand(OpNo));
       }
     }
+    void printCallOperand(const MachineInstr *MI, unsigned OpNo,
+                          MVT::ValueType VT) {
+      printOp(MI->getOperand(OpNo), true);
+    }
     void printAbsAddrOperand(const MachineInstr *MI, unsigned OpNo,
                              MVT::ValueType VT) {
      O << (int)MI->getOperand(OpNo).getImmedValue()*4;
index 0b79cda8f88bd02f06c3a8e5113f051d35816ecd..7e09b4d6df4360d8ee37b4581d7a21b04e67e6ae 100644 (file)
@@ -131,6 +131,9 @@ def s16immX4  : Operand<i32> {   // Multiply imm by 4 before printing.
 def target : Operand<i32> {
   let PrintMethod = "printBranchOperand";
 }
+def calltarget : Operand<i32> {
+  let PrintMethod = "printCallOperand";
+}
 def aaddr : Operand<i32> {
   let PrintMethod = "printAbsAddrOperand";
 }
@@ -220,7 +223,7 @@ let isCall = 1,
           LR,CTR,
           CR0,CR1,CR5,CR6,CR7] in {
   // Convenient aliases for call instructions
-  def BL  : IForm<18, 0, 1, (ops target:$func, variable_ops), "bl $func", BrB>;
+  def BL  : IForm<18, 0, 1, (ops calltarget:$func, variable_ops), "bl $func", BrB>;
   def BLA : IForm<18, 1, 1, (ops aaddr:$func, variable_ops), "bla $func", BrB>;
   def BCTRL : XLForm_2_ext<19, 528, 20, 0, 1, (ops variable_ops), "bctrl", BrB>;
 }