[LLVMdev] debug stoppoint nodes with -fast option

Devang Patel dpatel at apple.com
Mon Apr 20 13:28:02 PDT 2009

On Apr 17, 2009, at 8:57 PM, vasudev wrote:

> Can we help in local variable debug info work.

Sure. Right now, llvm-gcc (and clang) front-end does not generate  
variable debug info while optimizing. On the codegen side, it is  
assumed that FastISel is used at -O0.

There are various independent tasks that can be tackled to improve the  
debug info handling by llvm tools.

- Enable llvm-gcc to emit lexical scope information, at -O0, using  
region.start and region.end intrinsics.

- Start using metadata to describe variable debug info in LLVM IR. The  
metadata helps solve "extra" use case that Dale mentioned below. Nick  
L. has started work to enable metadata support in mainline. See http://nondot.org/~sabre/LLVMNotes/EmbeddedMetadata.txt 
  for more information.

- Update LLVM IR so that each instruct optionally carry debug  

- Update DebugLoc in the code generator to include scope information.  
Right now, DwarfWriter relies on the labels created during  
SelectionDAGBuild or FastISel to emit debug information for scopes.  
Eventually we want to make DwarfWriter as simple AsmPrinter feature  
that can collect all required info from machine instructions directly.  
This first step in that direction.

- At -O0, the code generate uses labels to ensure that the schedular  
does not re-arrange code. Find a way to overcome this and rely on  
DebugLoc only for the line number information.

- Improve DwarfWriter, DebugInfo and the DebugInfo interface.


More information about the llvm-dev mailing list