eliminate the TargetInstrInfo::GetInstSizeInBytes hook.
authorChris Lattner <sabre@nondot.org>
Thu, 22 Jul 2010 21:27:00 +0000 (21:27 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 22 Jul 2010 21:27:00 +0000 (21:27 +0000)
ARM/PPC/MSP430-specific code (which are the only targets that
implement the hook) can directly reference their target-specific
instrinfo classes.

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

include/llvm/Target/TargetInstrInfo.h
lib/Target/ARM/ARMBaseInstrInfo.h
lib/Target/ARM/ARMConstantIslandPass.cpp
lib/Target/MSP430/MSP430BranchSelector.cpp
lib/Target/PowerPC/PPCBranchSelector.cpp

index 6609e2aa32ad864a23e8909ee64337bfda1e7fcb..d5fe33ff88c2c059ff4699de60adad589f750c49 100644 (file)
@@ -566,13 +566,6 @@ public:
                                     const MachineBasicBlock *MBB,
                                     const MachineFunction &MF) const = 0;
 
-  /// GetInstSize - Returns the size of the specified Instruction.
-  /// 
-  virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const {
-    assert(0 && "Target didn't implement TargetInstrInfo::GetInstSize!");
-    return 0;
-  }
-
   /// Measure the specified inline asm to determine an approximation of its
   /// length.
   virtual unsigned getInlineAsmLength(const char *Str,
index 31615cc89f62e3ff4229ff271cdc185ef16c0372..20fae2e54ee73e4ab690c7a31052e3f9b20c5127 100644 (file)
@@ -224,7 +224,7 @@ public:
   virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
                              MachineBasicBlock *&FBB,
                              SmallVectorImpl<MachineOperand> &Cond,
-                             bool AllowModify) const;
+                             bool AllowModify = false) const;
   virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const;
   virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
                                 MachineBasicBlock *FBB,
index 50ba0d1760b921f95050ddba9e26d1d5562945cf..00296ee7bcbfc299d03a05620e97dc7af4813c96 100644 (file)
@@ -165,7 +165,7 @@ namespace {
     /// HasInlineAsm - True if the function contains inline assembly.
     bool HasInlineAsm;
 
-    const TargetInstrInfo *TII;
+    const ARMInstrInfo *TII;
     const ARMSubtarget *STI;
     ARMFunctionInfo *AFI;
     bool isThumb;
@@ -272,7 +272,7 @@ FunctionPass *llvm::createARMConstantIslandPass() {
 bool ARMConstantIslands::runOnMachineFunction(MachineFunction &MF) {
   MachineConstantPool &MCP = *MF.getConstantPool();
 
-  TII = MF.getTarget().getInstrInfo();
+  TII = (const ARMInstrInfo*)MF.getTarget().getInstrInfo();
   AFI = MF.getInfo<ARMFunctionInfo>();
   STI = &MF.getTarget().getSubtarget<ARMSubtarget>();
 
index 68cb342b08f45dbc0ea9103e2eeb7b5d1c0b243e..350b6751182024b9e4bac0e0805f2b15b5b5d9ac 100644 (file)
@@ -52,7 +52,7 @@ FunctionPass *llvm::createMSP430BranchSelectionPass() {
 }
 
 bool MSP430BSel::runOnMachineFunction(MachineFunction &Fn) {
-  const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo();
+  const MSP430InstrInfo *TII = (MSP430InstrInfo*)Fn.getTarget().getInstrInfo();
   // Give the blocks of the function a dense, in-order, numbering.
   Fn.RenumberBlocks();
   BlockSizes.resize(Fn.getNumBlockIDs());
index 52948c868b9c9fcd2065f33c49f524a71036af58..ab251e6b330091acc2c3d95cd9ea9ad48b39a51a 100644 (file)
@@ -53,7 +53,7 @@ FunctionPass *llvm::createPPCBranchSelectionPass() {
 }
 
 bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
-  const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo();
+  const PPCInstrInfo *TII = (PPCInstrInfo*)Fn.getTarget().getInstrInfo();
   // Give the blocks of the function a dense, in-order, numbering.
   Fn.RenumberBlocks();
   BlockSizes.resize(Fn.getNumBlockIDs());