Skip to content

Commit da748e4

Browse files
committed
Add addrspacecast
1 parent a539cee commit da748e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/LLVM/IRBuilder.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,15 @@ public class IRBuilder {
10881088
return LLVMBuildFPCast(llvm, val.asLLVM(), type.asLLVM(), name)
10891089
}
10901090

1091+
/// Builds an address space cast instruction that converts a pointer value
1092+
/// to a given type in a different address space.
1093+
///
1094+
/// The address spaces of the value and the destination pointer types must
1095+
/// be distinct.
1096+
public func buildAddrSpaceCast(_ val: IRValue, type: IRType, name: String = "") -> IRValue {
1097+
return LLVMBuildAddrSpaceCast(llvm, val.asLLVM(), type.asLLVM(), name)
1098+
}
1099+
10911100
/// Builds a truncate instruction to truncate the given value to the given
10921101
/// type with a shorter width.
10931102
///

0 commit comments

Comments
 (0)