void FindSafePoints(MachineFunction &MF);
void VisitCallPoint(MachineBasicBlock::iterator MI);
unsigned InsertLabel(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
+ MachineBasicBlock::iterator MI,
+ DebugLoc DL) const;
void FindStackOffsets(MachineFunction &MF);
}
unsigned MachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const {
+ MachineBasicBlock::iterator MI,
+ DebugLoc DL) const {
unsigned Label = MMI->NextLabelID();
- // N.B. we assume that MI is *not* equal to the "end()" iterator.
- BuildMI(MBB, MI, MI->getDebugLoc(),
+
+ BuildMI(MBB, MI, DL,
TII->get(TargetInstrInfo::GC_LABEL)).addImm(Label);
+
return Label;
}
++RAI;
if (FI->getStrategy().needsSafePoint(GC::PreCall))
- FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI));
+ FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI,
+ CI->getDebugLoc()));
if (FI->getStrategy().needsSafePoint(GC::PostCall))
- FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI));
+ FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI,
+ CI->getDebugLoc()));
}
void MachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {