<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>

<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Re: [cfe-commits] PATCH : Function Start Debug Info</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText20113 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Thanks Devang.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>-Sanjiv</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Devang Patel 
[mailto:dpatel@apple.com]<BR><B>Sent:</B> Fri 5/16/2008 9:35 PM<BR><B>To:</B> 
Sanjiv Kumar Gupta - I00171<BR><B>Cc:</B> 
cfe-commits@cs.uiuc.edu<BR><B>Subject:</B> Re: [cfe-commits] PATCH : Function 
Start Debug Info<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>On May 12, 2008, at 5:26 AM, Sanjiv.Gupta@microchip.com 
wrote:<BR><BR>> Please find the patch attached for generating function start 
debug <BR>> info.<BR>> Index: lib/CodeGen/CodeGenFunction.cpp<BR>> 
===================================================================<BR>> --- 
lib/CodeGen/CodeGenFunction.cpp   (revision 50963)<BR>> +++ 
lib/CodeGen/CodeGenFunction.cpp   (working copy)<BR>> @@ -11,6 
+11,7 @@<BR>>  //<BR>>  //<BR>> =<BR>> =<BR>> =<BR>> 
----------------------------------------------------------------------=<BR>> 
==//<BR>><BR>> +#include "CGDebugInfo.h"<BR>>  #include 
"CodeGenFunction.h"<BR>>  #include "CodeGenModule.h"<BR>>  
#include "clang/Basic/TargetInfo.h"<BR>> @@ -197,7 +198,15 
@@<BR>>                                           
EntryBB);<BR>><BR>>    
Builder.SetInsertPoint(EntryBB);<BR>> -<BR>> +<BR>> +  CGDebugInfo 
*DI = CGM.getDebugInfo();<BR>> +  if (DI && FD->getBody()) 
{<BR>> +      if 
(FD->getLocation().isValid())<BR>> 
+        
DI->setLocation(FD->getLocation());<BR>> +<BR>> 
+      DI->EmitFunctionStart(FD, CurFn, 
Builder);<BR>> +  }<BR>> +<BR>>    // Emit allocs 
for param decls.  Give the LLVM Argument nodes <BR>> 
names.<BR>>    llvm::Function::arg_iterator AI = 
CurFn->arg_begin();<BR>><BR>> @@ -215,6 +224,14 
@@<BR>>    // Emit the function 
body.<BR>>    EmitStmt(FD->getBody());<BR>><BR>> 
+  if (DI) {<BR>> +    CompoundStmt *CS = 
dyn_cast<CompoundStmt>(FD->getBody());<BR>> +    if 
(CS && CS->getRBracLoc().isValid())<BR>> 
+      DI->setLocation 
(CS->getRBracLoc());<BR>> +<BR>> +    
DI->EmitRegionEnd(CurFn, Builder);<BR>> +  }<BR>> +<BR><BR>Pl. 
duplicate this in GenerateObjcMethod also.  As FIXME 
says, <BR>eventually we want to factor common code between this two 
fns.<BR><BR>Pl. take care of free TypeCache FIXME sooner.<BR>Otherwise the patch 
looks ok.<BR>Thanks!<BR>-<BR>Devang<BR></FONT></P></DIV>

</BODY>
</HTML>