Skip to content

Commit 545949b

Browse files
committed
Add linkage and visibility accessors to Alias
1 parent cf331e2 commit 545949b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/LLVM/Alias.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ import cllvm
55
public struct Alias: IRValue {
66
internal let llvm: LLVMValueRef
77

8+
/// Retrieves the linkage information for this alias.
9+
public var linkage: Linkage {
10+
get { return Linkage(llvm: LLVMGetLinkage(asLLVM())) }
11+
set { LLVMSetLinkage(asLLVM(), newValue.llvm) }
12+
}
13+
14+
/// Retrieves the visibility style for this alias.
15+
public var visibility: Visibility {
16+
get { return Visibility(llvm: LLVMGetVisibility(asLLVM())) }
17+
set { LLVMSetVisibility(asLLVM(), newValue.llvm) }
18+
}
19+
820
/// Retrieves the underlying LLVM value object.
921
public func asLLVM() -> LLVMValueRef {
1022
return llvm

0 commit comments

Comments
 (0)