File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ extension IRGlobal {
3434
3535 /// Retrieves an indicator for the significance of a global value's address.
3636 public var unnamedAddressKind : UnnamedAddressKind {
37- get { return UnnamedAddressKind ( llvm: LLVMHasUnnamedAddr ( asLLVM ( ) ) ) }
38- set { LLVMSetUnnamedAddr ( asLLVM ( ) , newValue. llvm) }
37+ get { return UnnamedAddressKind ( llvm: LLVMGetUnnamedAddress ( asLLVM ( ) ) ) }
38+ set { LLVMSetUnnamedAddress ( asLLVM ( ) , newValue. llvm) }
3939 }
4040
4141 /// Retrieves the COMDAT section for this global, if it exists.
Original file line number Diff line number Diff line change @@ -237,28 +237,29 @@ public enum UnnamedAddressKind {
237237 /// current module but it may or may not be significant to another module;
238238 /// only the content of the value is known to be significant within the
239239 /// current module.
240- // case local
240+ case local
241241
242242 /// Indicates that the address of this global value is not significant to the
243243 /// current module or any other module; only the content of the value
244244 /// is significant globally.
245245 case global
246246
247- private static let unnamedAddressMapping : [ UnnamedAddressKind : LLVMBool ] = [
248- . none: LLVMBool ( 0 ) ,
249- // .local: LLVMBool(1) ,
250- . global: LLVMBool ( 1 ) ,
251- ]
247+ private static let unnamedAddressMapping : [ UnnamedAddressKind : LLVMUnnamedAddr ] = [
248+ . none: LLVMNoUnnamedAddr ,
249+ . local: LLVMLocalUnnamedAddr ,
250+ . global: LLVMGlobalUnnamedAddr ,
251+ ]
252252
253- internal init ( llvm: LLVMBool ) {
253+ internal init ( llvm: LLVMUnnamedAddr ) {
254254 switch llvm {
255- case 0 : self = . none
256- case 1 : self = . global
255+ case LLVMNoUnnamedAddr: self = . none
256+ case LLVMLocalUnnamedAddr: self = . local
257+ case LLVMGlobalUnnamedAddr: self = . global
257258 default : fatalError ( " unknown unnamed address kind \( llvm) " )
258259 }
259260 }
260261
261- internal var llvm : LLVMBool {
262+ internal var llvm : LLVMUnnamedAddr {
262263 return UnnamedAddressKind . unnamedAddressMapping [ self ] !
263264 }
264265}
You can’t perform that action at this time.
0 commit comments