[llvm-commits] [llvm] r78383 - /llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp

Sanjiv Gupta sanjiv.gupta at microchip.com
Fri Aug 7 04:00:02 PDT 2009


Author: sgupta
Date: Fri Aug  7 06:00:02 2009
New Revision: 78383

URL: http://llvm.org/viewvc/llvm-project?rev=78383&view=rev
Log:
Minor fixes to avoid using invalid debugloc.

Modified:
    llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp

Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp?rev=78383&r1=78382&r2=78383&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp Fri Aug  7 06:00:02 2009
@@ -236,10 +236,11 @@
   
   // 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::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.





More information about the llvm-commits mailing list