[llvm-commits] [llvm] r63008 - in /llvm/trunk: include/llvm/CodeGen/DebugLoc.h include/llvm/CodeGen/MachineFunction.h lib/CodeGen/MachineFunction.cpp

Evan Cheng evan.cheng at apple.com
Mon Jan 26 16:44:21 PST 2009


On Jan 26, 2009, at 3:47 PM, Devang Patel wrote:

>
> On Jan 26, 2009, at 3:34 PM, Evan Cheng wrote:
>
>>
>> On Jan 26, 2009, at 1:57 PM, Devang Patel wrote:
>>
>>>
>>>
>>> Why not use SourceLineInfo directly instead of introducing  
>>> DebugLocTuple ?
>>>
>>> // 
>>> = 
>>> = 
>>> = 
>>> ----------------------------------------------------------------------= 
>>> ==//
>>> /// SourceLineInfo - This class is used to record source line  
>>> correspondence.
>>> ///
>>> class SourceLineInfo {
>>>   unsigned Line;                        // Source line number.
>>>   unsigned Column;                      // Source column.
>>>   unsigned SourceID;                    // Source ID number.
>>>   unsigned LabelID;                     // Label in code ID number.
>>> public
>>> ...
>>>
>>> SourceLineInfo is managed using UniqueVector in DwarfWriter. Is  
>>> there a known reason to use DenseMap ? I'm just curious.
>>
>>
>> Is there a way to look up the id given line, column, sourceid? It  
>> looks like DwarfWrite is just keeping a list of source lines so it  
>> can be dumped out at the end.
>
> It does not need to query, so no it does not have a way to look up  
> the id given line, column, sourceid. It has a way to look up  
> sourceid based on file name and directory, which can be reused.

It is.

>
>> There are obvious duplicates we need to get rid.
>
> Now, SourceLineInfo is nearly identical to newly added DebugLocTuple.

Yes, stuff in MachineModuleInfo should be eliminated or moved elsewhere.

>
>> I don't particularly care the way we use DwarfWriter to track debug  
>> info. It should be used to print dwarf, not managing debug info  
>> like it's doing right now.
>
> I am not sure I understand here. AFAIU, DwarfWriter's DwarfDebug  
> does not try to manage debug info.

There are basically 2 parts of debug info (in codegen). There is the  
actually dwarf writing, which obviously DwarfWriter should do. Then  
there is code that validate debug info (e.g. ValidDebugInfo), track  
file name to id mapping, map labels, etc. Some of it is in dwarf  
writer, some in machine module info. These probably should go to a  
separate class. Then we can merge DebugLoc in it. Does that make sense?

Evan
>
> -
> Devang
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090126/4244c72f/attachment.html>


More information about the llvm-commits mailing list