]> granicus.if.org Git - llvm/commit
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)
commit903a9622093f15dc8a118f966eea8cff15c9b240
tree6016cba08187d333d2bcb0f9cb0002f842864f6b
parent957cbf8cf70d7b908d0aec43b2838134e55b6067
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299185 91177308-0d34-0410-b5e6-96231b3b80d8
bindings/go/llvm/IRBindings.cpp
bindings/go/llvm/IRBindings.h
bindings/go/llvm/ir.go
bindings/go/llvm/ir_test.go