diff options
| author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-08-07 11:00:02 +0000 | 
|---|---|---|
| committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-08-07 11:00:02 +0000 | 
| commit | 54c847cd6cc5d32e7746dbdc7625019a19aa1f44 (patch) | |
| tree | ae1fd99a30b36e6a64a2b327d1667bc6e4943ee2 /llvm/lib | |
| parent | 24ee4d0aa410a9b4ffbc4ae706b305d422e259ee (diff) | |
| download | bcm5719-llvm-54c847cd6cc5d32e7746dbdc7625019a19aa1f44.tar.gz bcm5719-llvm-54c847cd6cc5d32e7746dbdc7625019a19aa1f44.zip | |
Minor fixes to avoid using invalid debugloc.
llvm-svn: 78383
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/PIC16/PIC16DebugInfo.cpp | 14 | 
1 files changed, 9 insertions, 5 deletions
| diff --git a/llvm/lib/Target/PIC16/PIC16DebugInfo.cpp b/llvm/lib/Target/PIC16/PIC16DebugInfo.cpp index 0a44bfe2a5d..fd1940437fc 100644 --- a/llvm/lib/Target/PIC16/PIC16DebugInfo.cpp +++ b/llvm/lib/Target/PIC16/PIC16DebugInfo.cpp @@ -236,10 +236,11 @@ void PIC16DbgInfo::BeginFunction(const MachineFunction &MF) {    // Retreive the first valid debug Loc and process it.    const DebugLoc &DL = GetDebugLocForFunction(MF); -  ChangeDebugLoc(MF, DL, true); - -  EmitFunctBeginDI(MF.getFunction()); -   +  // 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,7 +272,10 @@ void PIC16DbgInfo::SwitchToLine(unsigned Line, bool IsInBeginFunction) {  ///  void PIC16DbgInfo::EndFunction(const MachineFunction &MF) {    if (! EmitDebugDirectives) return; -  EmitFunctEndDI(MF.getFunction(), CurLine); +  const DebugLoc &DL = GetDebugLocForFunction(MF); +  // Emit debug info only if valid debug info is available. +  if (!DL.isUnknown()) +    EmitFunctEndDI(MF.getFunction(), CurLine);  }  /// EndModule - Emit .eof for end of module. | 

