[llvm-dev] Metadata/DebugInfo in *.ll file

via llvm-dev
Mon, 14 Jan 2019 15:48:59 -0000

I believe the only thing you can add directly to an Instruction is the source
location (via setDebugLoc, not setMetadata).
All other instruction-related debug info is currently conveyed by debug-info
intrinsics, and the association is by one of the intrinsic operands being the
Instruction.
Is this for a front-end? Typically front-ends only add dbg.declare intrinsics,
which are attached to the alloca for the relevant variable.
--paulr

From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Norbert
Dajka via llvm-dev
Sent: Monday, January 14, 2019 9:26 AM
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] Metadata/DebugInfo in *.ll file

Hi list,

I found relevant documentation regarding DebugInfo creation in the LLVM IR
bytecode. It can be done for compileunits, functions, and other constructs, with
the help of DIBuilder class. However I can't save debug information related
to individual llvm::Instructions. I tried DebugLoc, DILocation setting directly
with setMetadata(). I tried other ways, for e.g.: insertDbgValueIntrinsic(). If
I set invalid parameters for the call, then the LLVM passes warn me, correctly,
so at least I see in the log, that LLVM tries to assign debuginfo to given
instruction. If however I set valid parameters, then I suppose, that the passes
drop the debuginfo related to an Instruction.
Do you know a surefire way to avoid the drop of instruction related debuginfo?

Thanks for your time,
Norbert
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190114/1c7efaab/attachment.html>