Skip to content

Commit 932c6a7

Browse files
committed
Building a basic type now requires flags
1 parent 3d5afb9 commit 932c6a7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Sources/LLVM/DIBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,12 @@ extension DIBuilder {
645645
/// - encoding: The basic type encoding
646646
/// - size: Size of the type.
647647
public func buildBasicType(
648-
named name: String, encoding: DIAttributeTypeEncoding, size: Size
648+
named name: String, encoding: DIAttributeTypeEncoding, flags: DIFlags, size: Size
649649
) -> DIType {
650650
let radix = UInt64(self.module.dataLayout.intPointerType().width)
651651
guard let ty = LLVMDIBuilderCreateBasicType(
652652
self.llvm, name, name.count,
653-
size.valueInBits(radix: radix), encoding.llvm)
653+
size.valueInBits(radix: radix), encoding.llvm, flags.llvm)
654654
else {
655655
fatalError("Failed to allocate metadata")
656656
}

Tests/LLVMTests/BFC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ private func compileProgramBody(
259259
///
260260
/// value_t this = 0;
261261
let diDataTy = dibuilder.buildBasicType(named: "value_t",
262-
encoding: .signed,
262+
encoding: .signed, flags: [],
263263
size: builder.module.dataLayout.abiSize(of: cellType))
264264
let diPtrTy = dibuilder.buildPointerType(pointee: diDataTy,
265265
size: builder.module.dataLayout.pointerSize())

Tests/LLVMTests/DIBuilderSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class DIBuilderSpec : XCTestCase {
4040

4141
let global = builder.addGlobal("global", type: IntType.int32)
4242
global.initializer = IntType.int32.constant(5)
43-
let globalTy = debugBuilder.buildBasicType(named: "int32_t", encoding: .signed, size: Size(8))
43+
let globalTy = debugBuilder.buildBasicType(named: "int32_t", encoding: .signed, flags: [], size: Size(8))
4444

4545
// DIEXPRESSION: !{{[0-9]+}} = !DIGlobalVariableExpression(var: !{{[0-9]+}}, expr: !DIExpression())
4646
// DIEXPRESSION: !{{[0-9]+}} = distinct !DIGlobalVariable(name: "global", linkageName: "global", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: 42, type: !{{[0-9]+}}, isLocal: true, isDefinition: true)

0 commit comments

Comments
 (0)