Minor fixes to avoid using invalid debugloc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjiv Gupta 2009-08-07 11:00:02 +00:00
parent b8d222def1
commit 394a1a21a1

View File

@ -236,10 +236,11 @@ void PIC16DbgInfo::BeginFunction(const MachineFunction &MF) {
// Retreive the first valid debug Loc and process it.
const DebugLoc &DL = GetDebugLocForFunction(MF);
// Emit debug info only if valid debug info is available.
if (!DL.isUnknown()) {
ChangeDebugLoc(MF, DL, true);
EmitFunctBeginDI(MF.getFunction());
}
// Set current line to 0 so that.line directive is genearted after .bf.
CurLine = 0;
}
@ -271,6 +272,9 @@ void PIC16DbgInfo::SwitchToLine(unsigned Line, bool IsInBeginFunction) {
///
void PIC16DbgInfo::EndFunction(const MachineFunction &MF) {
if (! EmitDebugDirectives) return;
const DebugLoc &DL = GetDebugLocForFunction(MF);
// Emit debug info only if valid debug info is available.
if (!DL.isUnknown())
EmitFunctEndDI(MF.getFunction(), CurLine);
}