We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 666ff85 commit ed9bcecCopy full SHA for ed9bcec
Sources/LLVM/StructType.swift
@@ -28,6 +28,13 @@ public struct StructType: IRType {
28
self.llvm = llvm
29
}
30
31
+ public init(elementTypes: [IRType], isPacked: Bool = false) {
32
+ var irTypes = elementTypes.map { $0.asLLVM() as Optional }
33
+ self.llvm = irTypes.withUnsafeMutableBufferPointer { buf in
34
+ LLVMStructType(buf.baseAddress, UInt32(buf.count), isPacked.llvm)
35
+ }
36
37
+
38
/// Invalidates and resets the member types of this structure.
39
///
40
/// - parameter types: A list of types of members of this structure.
0 commit comments