File tree 2 files changed +13
-12
lines changed
2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ extension IRGlobal {
34
34
35
35
/// Retrieves an indicator for the significance of a global value's address.
36
36
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) }
39
39
}
40
40
41
41
/// 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 {
237
237
/// current module but it may or may not be significant to another module;
238
238
/// only the content of the value is known to be significant within the
239
239
/// current module.
240
- // case local
240
+ case local
241
241
242
242
/// Indicates that the address of this global value is not significant to the
243
243
/// current module or any other module; only the content of the value
244
244
/// is significant globally.
245
245
case global
246
246
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
+ ]
252
252
253
- internal init ( llvm: LLVMBool ) {
253
+ internal init ( llvm: LLVMUnnamedAddr ) {
254
254
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
257
258
default : fatalError ( " unknown unnamed address kind \( llvm) " )
258
259
}
259
260
}
260
261
261
- internal var llvm : LLVMBool {
262
+ internal var llvm : LLVMUnnamedAddr {
262
263
return UnnamedAddressKind . unnamedAddressMapping [ self ] !
263
264
}
264
265
}
You can’t perform that action at this time.
0 commit comments