OSDN Git Service

[bindings/go] Add debug information accessors
authorAyke van Laethem <aykevanlaethem@gmail.com>
Mon, 24 Jun 2019 16:23:17 +0000 (16:23 +0000)
committerAyke van Laethem <aykevanlaethem@gmail.com>
Mon, 24 Jun 2019 16:23:17 +0000 (16:23 +0000)
commitf0bc658e541b83f11ba15456bd137edd4f415e6d
treecdab2074edc43497ccd4a9e2a8cb71037f1abb0d
parent8ae33d076e026e74f611d80a77cfbea4d451f0dc
[bindings/go] Add debug information accessors

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)

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).

Differential Revision: https://reviews.llvm.org/D63056

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364198 91177308-0d34-0410-b5e6-96231b3b80d8
bindings/go/llvm/dibuilder.go
bindings/go/llvm/ir.go