[PATCH] D63056: [bindings/go] Add debug information accessors

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 9 02:53:48 PDT 2019


aykevl created this revision.
aykevl added reviewers: whitequark, CodaFi, pcc.
Herald added a subscriber: aprantl.
Herald added a project: LLVM.

Add debug information accessors, as provided in the following patches:

https://reviews.llvm.org/D46627 (DILocation)
https://reviews.llvm.org/D52693 metadata kind
https://reviews.llvm.org/D60481 get/set debug location on a Value
https://reviews.llvm.org/D60489 (DIScope)

If needed I can split this patch up in multiple pieces if that's easier to review. But this is the subset that is required to read debug information from the IR so it makes testing locally easier.

The API as proposed in this patch is similar to the current Value API, with a single root type and methods that are only valid for certain subclasses. I have considered just implementing generic `Line()` calls (that are valid on all DINodes that have a line) but the implementation of that got a bit awkward without support from the C API. I've also considered creating generic getters like a `Metadata.DebugLoc()` that returns a `DebugLoc`, but there is a mismatch between the Go DI nodes in the LLVM API and the actual DINode class hierarchy, so that's also hard to get right (without being confusing or breaking the API).


Repository:
  rL LLVM

https://reviews.llvm.org/D63056

Files:
  bindings/go/llvm/dibuilder.go
  ir.go

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63056.203727.patch
Type: text/x-patch
Size: 5761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190609/6686bb70/attachment.bin>


More information about the llvm-commits mailing list