[LLVMdev] Debug info

Devang Patel devang.patel at gmail.com
Wed Nov 4 15:40:52 PST 2009


Hi Richard,

On Wed, Nov 4, 2009 at 11:03 AM, Richard Pennington <rich at pennware.com> wrote:
> Devang Patel wrote:
>> Hi Richard,
>>
>> How do you produce this LLVM assembly? In newest form,
>> llvm.dbg.func_start intrinsic is not used.
>> -
>> Devang
>>
> Hi Devang,
>
> The assembly is disassembled from bitcode that I create.
>
> I must be using obsolete remnants of the API. I'm calling
> EmitFunctionStart(), EmitStopPoint(), etc. What should I be using?

Instead of calling EmitFunctionStart(), you keep track of lexical
scopes in a stack. And instead of calling EmitStopPoint(), you update
current location info and attach updated location info with subsequent
instructions.

See CGDebugInfo::EmitStopPoint() and CGDebugInfo::EmitFunctionStart()
in CGDebugInfo.cpp from clang.

http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?view=markup
Here,
- ATTACH_DEBUG_INFO_TO_AN_INSN is now defined.
- IRBuilder is used to build IR. IRBuilder now provides APIs to keep
track of current location info to encode debugging information. So
whenever new instruction is created, the IRBuilder automatically
attach current location info with the new instruction.

Eventually, I'll document this and remove support for
llvm.dbg.stoppoint and related intrinsics' support.

-
Devang



More information about the llvm-dev mailing list