From b7dec2139cd4aad6a9515f531177844e34c686bb Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Mon, 10 Mar 2014 19:24:35 +0000 Subject: [PATCH] llvm-c: expose unnamedaddr field of globals Patch by Manuel Jacob. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203482 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm-c/Core.h | 2 ++ lib/IR/Core.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index bd150eaaae9..50c5e3ac46f 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -1688,6 +1688,8 @@ LLVMVisibility LLVMGetVisibility(LLVMValueRef Global); void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz); LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global); void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class); +LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global); +void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr); /** * @defgroup LLVMCCoreValueWithAlignment Values with alignment diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 0c2e31a0b02..4f3d8b19755 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -1262,6 +1262,14 @@ void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class) { static_cast(Class)); } +LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global) { + return unwrap(Global)->hasUnnamedAddr(); +} + +void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr) { + unwrap(Global)->setUnnamedAddr(HasUnnamedAddr); +} + /*--.. Operations on global variables, load and store instructions .........--*/ unsigned LLVMGetAlignment(LLVMValueRef V) {