[llvm-commits] [PATCH] Debug info utilities and printer pass

Török Edwin edwintorok at gmail.com
Thu Dec 11 03:55:03 PST 2008


On 2008-12-11 04:13, Chris Lattner wrote:
> On Dec 10, 2008, at 1:13 PM, Devang Patel wrote:
>>> 02-intrin.patch:
>>> Introduce DbgFuncStart::getDisplayName() (which refers to unmangled C
>>> ++
>>> name!), and DbgDeclareInst::getVariableName()
>>> Introduce include/llvm/Support/DebugInfo.h:
>>
>> We already have include/llvm/Analysis/DebugInfo.h, so I suggest that
>> you use another name for this new header.
>
> More strongly, why do we need this new code when we have
> llvm/Analysis/Debuginfo.h?  What does this do that
> llvm/Analysis/DebugInfo doesn't, or shouldn't do?

llvm/Analysis/DebugInfo.h doesn't search for the debug info, you have to
give it that as a parameter to the constructor.
My functions search for the llvm.dbg.stoppoint given an
Instruction*/BasicBlock*, and for llvm.dbg.declare given a Value*.
> I'd really rather make Analysis/DebugInfo.h better rather than
> introduce a new parallel way to analyze debug info.

I moved the functions to include/llvm/Analysis/DebugInfo.h, see
02-dbginfo-utils.patch.

Attachments:
01-dbginfo.patch:
-  fix getFieldAs(), it was always looking at field 6, instead of Elt!
-  DIVariable.getType() was leading to linker error: undefined reference
to DIType::DIType(GlobalVariable *GV), define the constructor

02-dbginfo-utils.patch:
- in my previous patch this was include/llvm/Support/DebugInfo.h, it
introduces:
- findStopPoint
- findBBStopPoint
- findDbgDeclare

03-pass.patch:
- the -print-dbginfo pass from my previous email, now it uses
llvm/Analysis/DebugInfo.h
- caveats: derived types are printed as "", no testcase (should I add one?)

Best regards,
--Edwin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-dbginfo.patch
Type: text/x-diff
Size: 1235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081211/67544232/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02-dbginfo-utils.patch
Type: text/x-diff
Size: 4146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081211/67544232/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03-pass.patch
Type: text/x-diff
Size: 5934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081211/67544232/attachment-0002.patch>


More information about the llvm-commits mailing list