simplify some code and eliminate the symbolicAddressesAreRIPRel() predicate.
[oota-llvm.git] / lib / Target / IA64 / IA64Bundling.cpp
index afe029c286453e7e10e75c8a59dd385964e368de..3a9ba6ca3f617e0ccd1c5268f39208cd30c23dde 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Duraid Madina 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.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -36,14 +36,14 @@ STATISTIC(StopBitsAdded, "Number of stop bits added");
 
 namespace {
   struct IA64BundlingPass : public MachineFunctionPass {
-    static const char ID;
+    static char ID;
     /// Target machine description which we query for reg. names, data
     /// layout, etc.
     ///
     IA64TargetMachine &TM;
 
     IA64BundlingPass(IA64TargetMachine &tm) 
-      : MachineFunctionPass((intptr_t)&ID), TM(tm) { }
+      : MachineFunctionPass(&ID), TM(tm) { }
 
     virtual const char *getPassName() const {
       return "IA64 (Itanium) Bundling Pass";
@@ -63,7 +63,7 @@ namespace {
     // 'fallthrough' code
     std::set<unsigned> PendingRegWrites;
   };
-  const char IA64BundlingPass::ID = 0;
+  char IA64BundlingPass::ID = 0;
 } // end of anonymous namespace
 
 /// createIA64BundlingPass - Returns a pass that adds STOP (;;) instructions
@@ -84,7 +84,7 @@ bool IA64BundlingPass::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
 
     for(unsigned i=0; i < CurrentInsn->getNumOperands(); i++) {
       MachineOperand &MO=CurrentInsn->getOperand(i);
-      if(MO.isRegister()) {
+      if (MO.isReg()) {
         if(MO.isUse()) { // TODO: exclude p0
           CurrentReads.insert(MO.getReg());
         }
@@ -104,7 +104,7 @@ bool IA64BundlingPass::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
     
     if(! (CurrentReads.empty() && CurrentWrites.empty()) ) {
       // there is a conflict, insert a stop and reset PendingRegWrites
-      CurrentInsn = BuildMI(MBB, CurrentInsn,
+      CurrentInsn = BuildMI(MBB, CurrentInsn, CurrentInsn->getDebugLoc(),
                             TM.getInstrInfo()->get(IA64::STOP), 0);
       PendingRegWrites=OrigWrites; // carry over current writes to next insn
       Changed=true; StopBitsAdded++; // update stats