[cfe-commits] FW: Clang DebugInfo Patch for StopPoints.

Sanjiv.Gupta at microchip.com Sanjiv.Gupta at microchip.com
Mon May 5 06:29:42 PDT 2008


-----Original Message-----
From: Sanjiv Kumar Gupta - I00171 
Sent: Monday, May 05, 2008 6:38 PM
To: 'Chris Lattner'
Subject: RE: [cfe-commits] Clang DebugInfo Patch for StopPoints.

> It looks like clang is currently inconsistent here, but option 
> descriptions should not end with a ".".
I will cleanup other things here as well to remove the ending "."

> +  CodeGenDebugInfo *TheDebugInfo;
> Please make TheDebugInfo private and add an accessor, following the 
> lead of other instance vars in CodeGenModule.

I am renaming the class to CGDebugInfo and files to CGDebugInfo.[h,cpp]

> #include "llvm/CodeGen/MachineModuleInfo.h"
> Is there any way to avoid bringing in MachineModuleInfo.h?  
> It is a really gross header that needs a lot of cleanup.  Can you 
> avoid #including it by forward declaring what ever you need and then 
> only #including it into CodeGenDebugInfo.cpp?
> I think it is worth it, even if it means making 'SR' by a pointer 
> instead of holding the DISerializer by value.
Holding the 'SR' by pointer works.


>    // Don't bother if things are the same as last time.
>    if (CurLoc == PrevLoc && PrevBB == CurBB)
>      return;
> Why are you checking for BB equality here?

This is on the lines of llvm-gcc. 
I think the reasoning behind is that a source line may result into
multiple basic blocks and we may need to put the stoppoint in each basic

>  Wouldn't it be
> more reasonable to check that the line # is the same instead of the 
> full location?  This would emit multiple stop points for things like:
>    a = b; c = d;
> right?


> Why emit a stop point on "}"?
Again, this is on the lines of llvm-gcc. 
Also, the example http://www.llvm.org/docs/SourceLevelDebugging.html
mentions that.

1.  void foo() {
2.    int X = ...;
3.    int Y = ...;
4.    {
5.      int Z = ...;
6.      ...
7.    }
8.    ...
9.  }

call void %llvm.dbg.stoppoint( uint 7, uint 2, %llvm.dbg.compile_unit*
%llvm.dbg.compile_unit ) call void %llvm.region.end()

- Sanjiv

More information about the cfe-commits mailing list