[llvm-commits] [llvm-gcc-4.2] r93727 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp llvm-debug.h llvm-internal.h

Duncan Sands baldrick at free.fr
Tue Jan 19 00:41:34 PST 2010


Hi Evan,

>> This does a lot of work even when debug info is not turned on.  Is it  
>> possible to avoid doing anything when it isn't enabled?  Also, in .cpp  
>> files, please use "tree exp" instead of "tree_node *exp".  Also,  
>> seen_blocks should probably be named "SeenBlocks" and be a SmallPtrSet.
> 
> Does it change codegen in any way? If so, then we can't disable it without -g.

it changes the order in which alloca's are declared.  However I think with some
tweaking alloca declaration and creation of the associated debug info could be
decoupled.  It would then be harmless to turn off the block numbering when debug
info is not on.

More precisely, EmitAutomaticVariableDecl does two things: it inserts an alloca
in the entry block (before AllocaInsertionPoint), and it creates debug info for
it.  If I understand Stuart's patch right, it delays the call to
EmitAutomaticVariableDecl until you are in the right lexical block.  By removing
debug info creation logic from EmitAutomaticVariableDecl, then you can just call
EmitAutomaticVariableDecl for all variables at the start of the function like we
used to.  This takes care of creating the alloca, and removes the need to number
blocks when debug info is turned off.  Of course, there then needs to be some
separate logic to create debug info at the appropriate places, and keep track of
which alloca's had debug info generated.

Ciao,

Duncan.



More information about the llvm-commits mailing list