diff options
Diffstat (limited to 'contrib/llvm/lib/CodeGen/RegAllocFast.cpp')
| -rw-r--r-- | contrib/llvm/lib/CodeGen/RegAllocFast.cpp | 19 | 
1 files changed, 4 insertions, 15 deletions
diff --git a/contrib/llvm/lib/CodeGen/RegAllocFast.cpp b/contrib/llvm/lib/CodeGen/RegAllocFast.cpp index fd759bc372b2..c606b7b83310 100644 --- a/contrib/llvm/lib/CodeGen/RegAllocFast.cpp +++ b/contrib/llvm/lib/CodeGen/RegAllocFast.cpp @@ -212,8 +212,9 @@ int RAFast::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) {      return SS;          // Already has space allocated?    // Allocate a new stack object for this spill location... -  int FrameIdx = MF->getFrameInfo().CreateSpillStackObject(RC->getSize(), -                                                           RC->getAlignment()); +  unsigned Size = TRI->getSpillSize(*RC); +  unsigned Align = TRI->getSpillAlignment(*RC); +  int FrameIdx = MF->getFrameInfo().CreateSpillStackObject(Size, Align);    // Assign the slot.    StackSlotForVirtReg[VirtReg] = FrameIdx; @@ -304,19 +305,7 @@ void RAFast::spillVirtReg(MachineBasicBlock::iterator MI,        LiveDbgValueMap[LRI->VirtReg];      for (unsigned li = 0, le = LRIDbgValues.size(); li != le; ++li) {        MachineInstr *DBG = LRIDbgValues[li]; -      const MDNode *Var = DBG->getDebugVariable(); -      const MDNode *Expr = DBG->getDebugExpression(); -      bool IsIndirect = DBG->isIndirectDebugValue(); -      uint64_t Offset = IsIndirect ? DBG->getOperand(1).getImm() : 0; -      DebugLoc DL = DBG->getDebugLoc(); -      assert(cast<DILocalVariable>(Var)->isValidLocationForIntrinsic(DL) && -             "Expected inlined-at fields to agree"); -      MachineInstr *NewDV = -          BuildMI(*MBB, MI, DL, TII->get(TargetOpcode::DBG_VALUE)) -              .addFrameIndex(FI) -              .addImm(Offset) -              .addMetadata(Var) -              .addMetadata(Expr); +      MachineInstr *NewDV = buildDbgValueForSpill(*MBB, MI, *DBG, FI);        assert(NewDV->getParent() == MBB && "dangling parent pointer");        (void)NewDV;        DEBUG(dbgs() << "Inserting debug info due to spill:" << "\n" << *NewDV);  | 
