Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit b7dec21

Browse files
committed
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
1 parent 7806d2c commit b7dec21

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

include/llvm-c/Core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,8 @@ LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
16881688
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
16891689
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global);
16901690
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class);
1691+
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global);
1692+
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
16911693

16921694
/**
16931695
* @defgroup LLVMCCoreValueWithAlignment Values with alignment

lib/IR/Core.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,14 @@ void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class) {
12621262
static_cast<GlobalValue::DLLStorageClassTypes>(Class));
12631263
}
12641264

1265+
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global) {
1266+
return unwrap<GlobalValue>(Global)->hasUnnamedAddr();
1267+
}
1268+
1269+
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr) {
1270+
unwrap<GlobalValue>(Global)->setUnnamedAddr(HasUnnamedAddr);
1271+
}
1272+
12651273
/*--.. Operations on global variables, load and store instructions .........--*/
12661274

12671275
unsigned LLVMGetAlignment(LLVMValueRef V) {

0 commit comments

Comments
 (0)