This is an archive of the discontinued LLVM Phabricator instance.

[debug-info] Add support for llvm.dbg.addr in DIBuilder.

Authored by gottesmm on Jan 16 2022, 5:01 PM.



I based this off of the API already create for llvm.dbg.value since both
intrinsics have the same arguments at the API level.

I added some tests exercising the API a little as well as an additional small
test that shows how one can use llvm.dbg.addr to limit the PC range where an
address value is available in the debugger. This is done by calling
llvm.dbg.value with undef and the same metadata info as one used to create the


Diff Detail

Event Timeline

gottesmm created this revision.Jan 16 2022, 5:01 PM
gottesmm updated this revision to Diff 400408.Jan 16 2022, 5:15 PM

Fixed a few typos/clang-formatted.

The test failures are in compiler-rt and are not related to this commit.

This is looking good, thanks!


Is this similar enough to insertDbgValueIntrinsic and insertDbgDeclareIntrinsic that we should factor out a insertDbgIntrinsic(IntrinsicFn *, ...) helper?

gottesmm updated this revision to Diff 400925.Jan 18 2022, 11:29 AM

Made changes as per review requests.

Thanks, looks good!

gottesmm published this revision for review.Jan 18 2022, 1:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 1:26 PM
aprantl accepted this revision.Jan 18 2022, 6:07 PM
This revision is now accepted and ready to land.Jan 18 2022, 6:07 PM
This revision was landed with ongoing or failed builds.Jan 18 2022, 6:26 PM
This revision was automatically updated to reflect the committed changes.