///
void PIC16DbgInfo::ChangeDebugLoc(const MachineFunction &MF,
const DebugLoc &DL, bool IsInBeginFunction) {
- if (! EmitDebugDirectives) return;
- assert (! DL.isUnknown() && "can't change to invalid debug loc");
-
- DILocation Loc = MF.getDILocation(DL);
- MDNode *CU = Loc.getScope().getNode();
- unsigned line = Loc.getLineNumber();
+ if (!EmitDebugDirectives) return;
+ assert(!DL.isUnknown() && "can't change to invalid debug loc");
- SwitchToCU(CU);
- SwitchToLine(line, IsInBeginFunction);
+ SwitchToCU(DL.getScope(MF.getFunction()->getContext()));
+ SwitchToLine(DL.getLine(), IsInBeginFunction);
}
/// SwitchToLine - Emit line directive for a new line.