Skip to content

Commit ed9bcec

Browse files
committed
Added back Struct(elementTypes:isPacked:) initializer
1 parent 666ff85 commit ed9bcec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/LLVM/StructType.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ public struct StructType: IRType {
2828
self.llvm = llvm
2929
}
3030

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+
3138
/// Invalidates and resets the member types of this structure.
3239
///
3340
/// - parameter types: A list of types of members of this structure.

0 commit comments

Comments
 (0)