Fixed bug with running out of registers. Also, reinstated namespace which
[oota-llvm.git] / lib / CodeGen / RegAllocSimple.cpp
index 6220169234957888e980083e8d3912657e012af2..609eabf516101eee7937554c4854ddd3055457e4 100644 (file)
@@ -20,7 +20,7 @@
 #include "Support/Statistic.h"
 #include <map>
 
-//namespace {
+namespace {
   struct RegAllocSimple : public FunctionPass {
     TargetMachine &TM;
     MachineBasicBlock *CurrMBB;
     }
   };
 
-//}
+}
 
 unsigned RegAllocSimple::allocateStackSpaceFor(unsigned VirtReg,
                                             const TargetRegisterClass *regClass)
@@ -289,6 +289,9 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
       
       // really delete the instruction
       delete MI;
+
+      // make regs available to other instructions
+      clearAllRegs();
     }
 
     //loop over each basic block