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

Michael Gottesman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 13:26:09 PST 2022


gottesmm created this revision.
gottesmm added a reviewer: aprantl.
Herald added subscribers: dexonsmith, hiraditya.
gottesmm updated this revision to Diff 400408.
gottesmm added a comment.
gottesmm updated this revision to Diff 400925.
gottesmm published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fixed a few typos/clang-formatted.


gottesmm added a comment.

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


aprantl added a comment.

This is looking good, thanks!


gottesmm added a comment.

Made changes as per review requests.


aprantl added a comment.

Thanks, looks good!



================
Comment at: llvm/lib/IR/DIBuilder.cpp:1062
 
+Instruction *DIBuilder::insertDbgAddrIntrinsic(
+    Value *V, DILocalVariable *VarInfo, DIExpression *Expr,
----------------
Is this similar enough to insertDbgValueIntrinsic and insertDbgDeclareIntrinsic that we should factor out a `insertDbgIntrinsic(IntrinsicFn *, ...)` helper?


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
llvm.dbg.addr.

rdar://83957028


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117442

Files:
  llvm/include/llvm/IR/DIBuilder.h
  llvm/lib/IR/DIBuilder.cpp
  llvm/test/DebugInfo/X86/dbg-addr.ll
  llvm/unittests/IR/DebugInfoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117442.400925.patch
Type: text/x-patch
Size: 14335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220118/dbcf9b44/attachment.bin>


More information about the llvm-commits mailing list