From cce47418c93bcd178379fa8c4df5c3327bc19802 Mon Sep 17 00:00:00 2001 From: Robert Widmann Date: Wed, 10 Apr 2019 14:19:05 +0000 Subject: [LLVM-C] Correct The Current Debug Location Accessors (Again) Summary: Resubmitting D60484 with the conflicting Go bindings renamed to avoid collisions. Reviewers: whitequark, deadalnix Subscribers: hiraditya, llvm-commits, sammccall Tags: #llvm Differential Revision: https://reviews.llvm.org/D60511 llvm-svn: 358086 --- llvm/lib/IR/Core.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'llvm/lib/IR/Core.cpp') diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 997f5330dec..44291a1784d 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -3006,6 +3006,17 @@ void LLVMDisposeBuilder(LLVMBuilderRef Builder) { /*--.. Metadata builders ...................................................--*/ +LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder) { + return wrap(unwrap(Builder)->getCurrentDebugLocation().getAsMDNode()); +} + +void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc) { + if (Loc) + unwrap(Builder)->SetCurrentDebugLocation(DebugLoc(unwrap(Loc))); + else + unwrap(Builder)->SetCurrentDebugLocation(DebugLoc()); +} + void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L) { MDNode *Loc = L ? cast(unwrap(L)->getMetadata()) : nullptr; @@ -3022,7 +3033,6 @@ void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst) { unwrap(Builder)->SetInstDebugLocation(unwrap(Inst)); } - /*--.. Instruction builders ................................................--*/ LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef B) { -- cgit v1.2.3