summaryrefslogtreecommitdiffstats
path: root/lib/Target/PIC16/PIC16DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/PIC16/PIC16DebugInfo.cpp')
-rw-r--r--lib/Target/PIC16/PIC16DebugInfo.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Target/PIC16/PIC16DebugInfo.cpp b/lib/Target/PIC16/PIC16DebugInfo.cpp
index da4e027..a223540 100644
--- a/lib/Target/PIC16/PIC16DebugInfo.cpp
+++ b/lib/Target/PIC16/PIC16DebugInfo.cpp
@@ -256,15 +256,11 @@ void PIC16DbgInfo::BeginFunction(const MachineFunction &MF) {
///
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.
OpenPOWER on IntegriCloud