remove use of SmallVector from Path::makeUnique. Path::makeUnique
[oota-llvm.git] / lib / CodeGen / StackSlotColoring.cpp
index 62b2c49943329e9b45e335b8a04c5667e9e89259..fd25a37c6c6b07e009347c0cedba53fdd4a6d0c9 100644 (file)
@@ -22,7 +22,6 @@
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/PseudoSourceValue.h"
 #include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetMachine.h"
@@ -53,7 +52,7 @@ STATISTIC(NumStoreElim,  "Number of stores eliminated");
 STATISTIC(NumDead,       "Number of trivially dead stack accesses eliminated");
 
 namespace {
-  class VISIBILITY_HIDDEN StackSlotColoring : public MachineFunctionPass {
+  class StackSlotColoring : public MachineFunctionPass {
     bool ColorWithRegs;
     LiveStacks* LS;
     VirtRegMap* VRM;
@@ -99,6 +98,8 @@ namespace {
     
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
+      AU.addRequired<SlotIndexes>();
+      AU.addPreserved<SlotIndexes>();
       AU.addRequired<LiveStacks>();
       AU.addRequired<VirtRegMap>();
       AU.addPreserved<VirtRegMap>();      
@@ -466,10 +467,8 @@ void StackSlotColoring::RewriteInstruction(MachineInstr *MI, int OldFI,
   // Update the memory references. This changes the MachineMemOperands
   // directly. They may be in use by multiple instructions, however all
   // instructions using OldFI are being rewritten to use NewFI.
-  const Value *OldSV = MFI->isFixedObjectIndex(OldFI)
-    ? PseudoSourceValue::getFixedStack(OldFI) : PseudoSourceValue::getStack();
-  const Value *NewSV = MFI->isFixedObjectIndex(NewFI)
-    ? PseudoSourceValue::getFixedStack(NewFI) : PseudoSourceValue::getStack();
+  const Value *OldSV = PseudoSourceValue::getFixedStack(OldFI);
+  const Value *NewSV = PseudoSourceValue::getFixedStack(NewFI);
   for (MachineInstr::mmo_iterator I = MI->memoperands_begin(),
        E = MI->memoperands_end(); I != E; ++I)
     if ((*I)->getValue() == OldSV)
@@ -669,7 +668,7 @@ bool StackSlotColoring::RemoveDeadStores(MachineBasicBlock* MBB) {
     if (DCELimit != -1 && (int)NumDead >= DCELimit)
       break;
     
-    MachineBasicBlock::iterator NextMI = next(I);
+    MachineBasicBlock::iterator NextMI = llvm::next(I);
     if (NextMI == MBB->end()) continue;
     
     int FirstSS, SecondSS;