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

Török Edwin edwintorok at gmail.com
Wed Dec 10 11:02:03 PST 2008


Hi,

[@John Criswell: this is a much improved version of SourceLocator I sent
you ages ago ;)]

01-bb.patch:
BasicBlock::getUniquePredecessor -> similar to getSinglePredecessor()
but works if there is a unique predecessor listed multiple times

02-intrin.patch:
Introduce DbgFuncStart::getDisplayName() (which refers to unmangled C++
name!), and DbgDeclareInst::getVariableName()
Introduce include/llvm/Support/DebugInfo.h:
 findStopPoint: Instruction* -> associated StopPoint*
 findBBStopPoint: BasicBlock* -> associated StopPoint*
 findDbgDeclare: Value* -> associated DbgDeclareInst*
This header may not be the best place, but if I place these in
Support/<something>.cpp I get circular dependencies with VMCore

03-pass.patch:
-print-dbg-info: An example pass that shows how to use the functions in
02-intrin.patch, and how to handle debug info in general for the purpose
of mapping LLVM IR back to original source code.
This pass can be very useful when developing other passes, because you
can see which line a certain LLVM instruction corresponds to,
and can see the unmangled name of functions.

Do you see any problems with these patches, or can I go ahead and commit
them?

Best regards,
--Edwin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-bb.patch
Type: text/x-diff
Size: 2199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081210/01395b44/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02-intrin.patch
Type: text/x-diff
Size: 5637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081210/01395b44/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03-pass.patch
Type: text/x-diff
Size: 5729 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081210/01395b44/attachment-0002.patch>


More information about the llvm-commits mailing list