[cfe-commits] r53136 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Sanjiv Gupta sanjiv.gupta at microchip.com
Fri Jul 4 04:04:27 PDT 2008


Author: sgupta
Date: Fri Jul  4 06:04:26 2008
New Revision: 53136

URL: http://llvm.org/viewvc/llvm-project?rev=53136&view=rev
Log:
Fixed bugzilla bug# 2489.
This was broken when the GenerateCode function was splitted to use GenerateFunction.


Modified:
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=53136&r1=53135&r2=53136&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Fri Jul  4 06:04:26 2008
@@ -69,6 +69,16 @@
   // Emit the function body.
   EmitStmt(Body);
   
+  // Emit debug descriptor for function end.
+  CGDebugInfo *DI = CGM.getDebugInfo(); 
+  if (DI) {
+    const CompoundStmt* s = dyn_cast<CompoundStmt>(Body);
+    if (s && s->getRBracLoc().isValid()) {
+      DI->setLocation(s->getRBracLoc());
+    }
+    DI->EmitRegionEnd(CurFn, Builder);
+  }
+ 
   // Emit a return for code that falls off the end. If insert point
   // is a dummy block with no predecessors then remove the block itself.
   llvm::BasicBlock *BB = Builder.GetInsertBlock();
@@ -109,6 +119,16 @@
   
   Builder.SetInsertPoint(EntryBB);
   
+  // Emit subprogram debug descriptor.
+  CGDebugInfo *DI = CGM.getDebugInfo();
+  if (DI) {
+    CompoundStmt* body = dyn_cast<CompoundStmt>(FD->getBody());
+    if (body && body->getLBracLoc().isValid()) {
+      DI->setLocation(body->getLBracLoc());
+    }
+    DI->EmitFunctionStart(FD, CurFn, Builder);
+  }
+
   // Emit allocs for param decls.  Give the LLVM Argument nodes names.
   llvm::Function::arg_iterator AI = CurFn->arg_begin();
   





More information about the cfe-commits mailing list