Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
[oota-llvm.git] / lib / Target / Sparc / DelaySlotFiller.cpp
index 768b79b9fb101aa2bc4fcc717ae8c969c2a40374..00d14f2784b66cc52b37a547c60539939edcccc5 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "delayslotfiller"
 #include "Sparc.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -19,9 +20,9 @@
 #include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
-namespace {
-  Statistic FilledSlots("delayslotfiller", "Num. of delay slots filled");
+STATISTIC(FilledSlots, "Number of delay slots filled");
 
+namespace {
   struct Filler : public MachineFunctionPass {
     /// Target machine description which we query for reg. names, data
     /// layout, etc.
@@ -29,7 +30,9 @@ namespace {
     TargetMachine &TM;
     const TargetInstrInfo *TII;
 
-    Filler(TargetMachine &tm) : TM(tm), TII(tm.getInstrInfo()) { }
+    static char ID;
+    Filler(TargetMachine &tm) 
+      : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { }
 
     virtual const char *getPassName() const {
       return "SPARC Delay Slot Filler";
@@ -45,6 +48,7 @@ namespace {
     }
 
   };
+  char Filler::ID = 0;
 } // end of anonymous namespace
 
 /// createSparcDelaySlotFillerPass - Returns a pass that fills in delay
@@ -61,7 +65,7 @@ FunctionPass *llvm::createSparcDelaySlotFillerPass(TargetMachine &tm) {
 bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
   bool Changed = false;
   for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I)
-    if (TII->hasDelaySlot(I->getOpcode())) {
+    if (I->getDesc()->hasDelaySlot()) {
       MachineBasicBlock::iterator J = I;
       ++J;
       BuildMI(MBB, J, TII->get(SP::NOP));