Go binding: Add GetCurrentDebugLocation to obtain debug location from builder
authorAndrew Wilkins <axwalk@gmail.com>
Fri, 31 Mar 2017 04:59:57 +0000 (04:59 +0000)
committerAndrew Wilkins <axwalk@gmail.com>
Fri, 31 Mar 2017 04:59:57 +0000 (04:59 +0000)
commitdc0fe7abfc53a2fc77569b99888b7fd4b23e8e96
tree29f85fb46a0253e78c1ec1dc3c39e57bccd8a804
parent7b30f16c9ffa5e6a3731febd6009b2ee81ebf430
Go binding: Add GetCurrentDebugLocation to obtain debug location from builder

Summary:

Currently Go binding only has SetCurrentDebugLocation method.
I added GetCurrentDebugLocation method to IRBuilder instance.

I added this because I want to save current debug location, change debug location temporary and restore the saved one finally.
This is useful when source location jumps and goes back after while LLVM IR generation.

I also added tests for this to ir_test.go.
I confirmed that all test passed with this patch based on r298890

Patch by Ryuichi Hayashida!

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

llvm-svn: 299185
llvm/bindings/go/llvm/IRBindings.cpp
llvm/bindings/go/llvm/IRBindings.h
llvm/bindings/go/llvm/ir.go
llvm/bindings/go/llvm/ir_test.go