Add new shorter predicates for testing machine operands for various types: 
e.g. MO.isMBB() instead of MO.isMachineBasicBlock().  I don't plan on 
switching everything over, so new clients should just start using the 
shorter names.

Remove old long accessors, switching everything over to use the short
accessor: getMachineBasicBlock() -> getMBB(), 
getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45464 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 0f7f6f1..fa68541 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -1226,7 +1226,7 @@
           ++OpNo;  // Skip over the ID number.
 
           if (Modifier[0]=='l')  // labels are target independent
-            printBasicBlockLabel(MI->getOperand(OpNo).getMachineBasicBlock(), 
+            printBasicBlockLabel(MI->getOperand(OpNo).getMBB(), 
                                  false, false);
           else {
             AsmPrinter *AP = const_cast<AsmPrinter*>(this);
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 4f86987..7e97223 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -172,8 +172,8 @@
         for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) {
           MachineOperand &Op = I->getOperand(op);
           if (!Op.isJumpTableIndex()) continue;
-          unsigned NewIdx = JTMapping[Op.getJumpTableIndex()];
-          Op.setJumpTableIndex(NewIdx);
+          unsigned NewIdx = JTMapping[Op.getIndex()];
+          Op.setIndex(NewIdx);
 
           // Remember that this JT is live.
           JTIsLive[NewIdx] = true;
@@ -210,14 +210,12 @@
     case MachineOperand::MO_Register:          OperandHash = Op.getReg(); break;
     case MachineOperand::MO_Immediate:         OperandHash = Op.getImm(); break;
     case MachineOperand::MO_MachineBasicBlock:
-      OperandHash = Op.getMachineBasicBlock()->getNumber();
+      OperandHash = Op.getMBB()->getNumber();
       break;
-    case MachineOperand::MO_FrameIndex: OperandHash = Op.getFrameIndex(); break;
+    case MachineOperand::MO_FrameIndex:
     case MachineOperand::MO_ConstantPoolIndex:
-      OperandHash = Op.getConstantPoolIndex();
-      break;
     case MachineOperand::MO_JumpTableIndex:
-      OperandHash = Op.getJumpTableIndex();
+      OperandHash = Op.getIndex();
       break;
     case MachineOperand::MO_GlobalAddress:
     case MachineOperand::MO_ExternalSymbol:
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp
index 772843a..c4af6a8 100644
--- a/lib/CodeGen/LiveVariables.cpp
+++ b/lib/CodeGen/LiveVariables.cpp
@@ -696,6 +696,6 @@
     for (MachineBasicBlock::const_iterator BBI = I->begin(), BBE = I->end();
          BBI != BBE && BBI->getOpcode() == TargetInstrInfo::PHI; ++BBI)
       for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2)
-        PHIVarInfo[BBI->getOperand(i + 1).getMachineBasicBlock()->getNumber()].
+        PHIVarInfo[BBI->getOperand(i + 1).getMBB()->getNumber()].
           push_back(BBI->getOperand(i).getReg());
 }
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index e5be62d..f539596 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/lib/CodeGen/MachineBasicBlock.cpp
@@ -214,9 +214,8 @@
     // Scan the operands of this machine instruction, replacing any uses of Old
     // with New.
     for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
-      if (I->getOperand(i).isMachineBasicBlock() &&
-          I->getOperand(i).getMachineBasicBlock() == Old)
-        I->getOperand(i).setMachineBasicBlock(New);
+      if (I->getOperand(i).isMBB() && I->getOperand(i).getMBB() == Old)
+        I->getOperand(i).setMBB(New);
   }
 
   // Update the successor information.  If New was already a successor, just
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 85012da..d843b27 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -40,12 +40,11 @@
   case MachineOperand::MO_MachineBasicBlock:
     return getMBB() == Other.getMBB();
   case MachineOperand::MO_FrameIndex:
-    return getFrameIndex() == Other.getFrameIndex();
+    return getIndex() == Other.getIndex();
   case MachineOperand::MO_ConstantPoolIndex:
-    return getConstantPoolIndex() == Other.getConstantPoolIndex() &&
-           getOffset() == Other.getOffset();
+    return getIndex() == Other.getIndex() && getOffset() == Other.getOffset();
   case MachineOperand::MO_JumpTableIndex:
-    return getJumpTableIndex() == Other.getJumpTableIndex();
+    return getIndex() == Other.getIndex();
   case MachineOperand::MO_GlobalAddress:
     return getGlobal() == Other.getGlobal() && getOffset() == Other.getOffset();
   case MachineOperand::MO_ExternalSymbol:
@@ -100,19 +99,19 @@
     break;
   case MachineOperand::MO_MachineBasicBlock:
     OS << "mbb<"
-       << ((Value*)getMachineBasicBlock()->getBasicBlock())->getName()
-       << "," << (void*)getMachineBasicBlock() << ">";
+       << ((Value*)getMBB()->getBasicBlock())->getName()
+       << "," << (void*)getMBB() << ">";
     break;
   case MachineOperand::MO_FrameIndex:
-    OS << "<fi#" << getFrameIndex() << ">";
+    OS << "<fi#" << getIndex() << ">";
     break;
   case MachineOperand::MO_ConstantPoolIndex:
-    OS << "<cp#" << getConstantPoolIndex();
+    OS << "<cp#" << getIndex();
     if (getOffset()) OS << "+" << getOffset();
     OS << ">";
     break;
   case MachineOperand::MO_JumpTableIndex:
-    OS << "<jt#" << getJumpTableIndex() << ">";
+    OS << "<jt#" << getIndex() << ">";
     break;
   case MachineOperand::MO_GlobalAddress:
     OS << "<ga:" << ((Value*)getGlobal())->getName();
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 1773b57..480ba93 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -174,9 +174,8 @@
   // Adjust the VRegPHIUseCount map to account for the removal of this PHI
   // node.
   for (unsigned i = 1; i != MPhi->getNumOperands(); i += 2)
-    --VRegPHIUseCount[BBVRegPair(
-                        MPhi->getOperand(i + 1).getMachineBasicBlock(),
-                        MPhi->getOperand(i).getReg())];
+    --VRegPHIUseCount[BBVRegPair(MPhi->getOperand(i + 1).getMBB(),
+                                 MPhi->getOperand(i).getReg())];
 
   // Now loop over all of the incoming arguments, changing them to copy into
   // the IncomingReg register in the corresponding predecessor basic block.
@@ -189,7 +188,7 @@
 
     // Get the MachineBasicBlock equivalent of the BasicBlock that is the
     // source path the PHI.
-    MachineBasicBlock &opBlock = *MPhi->getOperand(i).getMachineBasicBlock();
+    MachineBasicBlock &opBlock = *MPhi->getOperand(i).getMBB();
 
     // Check to make sure we haven't already emitted the copy for this block.
     // This can happen because PHI nodes may have multiple entries for the
@@ -339,7 +338,6 @@
     for (MachineBasicBlock::const_iterator BBI = I->begin(), BBE = I->end();
          BBI != BBE && BBI->getOpcode() == TargetInstrInfo::PHI; ++BBI)
       for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2)
-        ++VRegPHIUseCount[BBVRegPair(
-                            BBI->getOperand(i + 1).getMachineBasicBlock(),
-                            BBI->getOperand(i).getReg())];
+        ++VRegPHIUseCount[BBVRegPair(BBI->getOperand(i + 1).getMBB(),
+                                     BBI->getOperand(i).getReg())];
 }
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp
index 4b5c123..d736084 100644
--- a/lib/CodeGen/StrongPHIElimination.cpp
+++ b/lib/CodeGen/StrongPHIElimination.cpp
@@ -385,7 +385,7 @@
           UnionedBlocks.count(SrcInfo.DefInst->getParent())) {
         
         // add a copy from a_i to p in Waiting[From[a_i]]
-        MachineBasicBlock* From = P->getOperand(i).getMachineBasicBlock();
+        MachineBasicBlock* From = P->getOperand(i).getMBB();
         Waiting[From].insert(std::make_pair(SrcReg, DestReg));
         UsedByAnother.insert(SrcReg);
       } else {