diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 8ae75f5649..a7d629e6dc 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -292,6 +292,28 @@ void FastISel::recomputeInsertPt() { ++FuncInfo.InsertPt; } +/// recomputeDebugLocForMaterializedRegs - Recompute debug location for +/// very first instruction in a basic block. All instructions emitted +/// to materialize registers do not have location information, see +/// enterLocalValueArea(), becase they may not be emited at the right +/// location. +void FastISel::recomputeDebugLocForMaterializedRegs() { + if (!getLastLocalValue()) + return; + MachineInstr *First = FuncInfo.MBB->getFirstNonPHI(); + if (!First->getDebugLoc().isUnknown()) + return; + + for (MachineBasicBlock::iterator I = FuncInfo.MBB->begin(), + E = FuncInfo.MBB->end(); I != E; ++I) { + DebugLoc DL = I->getDebugLoc(); + if (!DL.isUnknown()) { + First->setDebugLoc(DL); + return; + } + } +} + FastISel::SavePoint FastISel::enterLocalValueArea() { MachineBasicBlock::iterator OldInsertPt = FuncInfo.InsertPt; DebugLoc OldDL = DL; |