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
This commit is contained in:
Chris Lattner
2007-12-30 23:10:15 +00:00
parent 78d34664e7
commit 8aa797aa51
40 changed files with 185 additions and 192 deletions
+8 -9
View File
@@ -40,12 +40,11 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
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 @@ void MachineOperand::print(std::ostream &OS, const TargetMachine *TM) const {
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();