IRGlobal
public protocol IRGlobal : IRConstant
An IRGlobal
is a value, alias, or function that exists at the top level of
an LLVM module.
-
alignment
Extension methodRetrieves the alignment of this value.
Declaration
Swift
public var alignment: Alignment { get set }
-
linkage
Extension methodRetrieves the linkage information for this global.
Declaration
Swift
public var linkage: Linkage { get set }
-
visibility
Extension methodRetrieves the visibility style for this global.
Declaration
Swift
public var visibility: Visibility { get set }
-
storageClass
Extension methodRetrieves the storage class for this global declaration. For use with Portable Executable files.
Declaration
Swift
public var storageClass: StorageClass { get set }
-
unnamedAddressKind
Extension methodRetrieves an indicator for the significance of a global value’s address.
Declaration
Swift
public var unnamedAddressKind: UnnamedAddressKind { get set }
-
comdat
Extension methodRetrieves the COMDAT section for this global, if it exists.
Declaration
Swift
public var comdat: Comdat? { get set }
-
section
Extension methodRetrieves the section associated with the symbol that will eventually be emitted for this global value.
Note
GlobalAlias
values may or may not be resolvable to any particular section given the state of the IR in an arbitrary module. A return value of the empty string indicates a failed section lookup.Declaration
Swift
public var section: String { get set }
-
eraseFromParent()
Extension methodRemoves this global value from the module and deallocates it.
Note
To ensure correct removal of the global value, you must invalidate any references to it - usually by performing an
Replace All Uses With
(RAUW) operation.Warning
The native Swift object wrapping this global becomes a dangling reference once this function has been invoked. It is recommended that all references to it be dropped immediately.
Declaration
Swift
public func eraseFromParent()