mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: add APIs to set and get the alignment of a pointer_to_address instruction.
Also add a getter for the `isInvariant` property.
This commit is contained in:
@@ -717,6 +717,15 @@ final public
|
||||
class PointerToAddressInst : SingleValueInstruction, UnaryInstruction {
|
||||
public var pointer: Value { operand.value }
|
||||
public var isStrict: Bool { bridged.PointerToAddressInst_isStrict() }
|
||||
public var isInvariant: Bool { bridged.PointerToAddressInst_isInvariant() }
|
||||
|
||||
public var alignment: Int? {
|
||||
let maybeAlign = bridged.PointerToAddressInst_getAlignment()
|
||||
if maybeAlign == 0 {
|
||||
return nil
|
||||
}
|
||||
return Int(exactly: maybeAlign)
|
||||
}
|
||||
}
|
||||
|
||||
final public
|
||||
|
||||
Reference in New Issue
Block a user