aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/llvm')
-rw-r--r--src/codegen/llvm/Builder.zig4
-rw-r--r--src/codegen/llvm/bindings.zig3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/codegen/llvm/Builder.zig b/src/codegen/llvm/Builder.zig
index 3e6cf31d69..cd7a0045aa 100644
--- a/src/codegen/llvm/Builder.zig
+++ b/src/codegen/llvm/Builder.zig
@@ -572,7 +572,9 @@ pub const Type = enum(u32) {
pub fn isSized(self: Type, builder: *const Builder) Allocator.Error!bool {
var visited: IsSizedVisited = .{};
- return self.isSizedVisited(&visited, builder);
+ const result = try self.isSizedVisited(&visited, builder);
+ if (builder.useLibLlvm()) assert(result == self.toLlvm(builder).isSized().toBool());
+ return result;
}
const FormatData = struct {
diff --git a/src/codegen/llvm/bindings.zig b/src/codegen/llvm/bindings.zig
index aee9cea384..2fab61d1cf 100644
--- a/src/codegen/llvm/bindings.zig
+++ b/src/codegen/llvm/bindings.zig
@@ -434,6 +434,9 @@ pub const Type = opaque {
Packed: Bool,
) void;
+ pub const isSized = LLVMTypeIsSized;
+ extern fn LLVMTypeIsSized(Ty: *Type) Bool;
+
pub const constGEP = LLVMConstGEP2;
extern fn LLVMConstGEP2(
Ty: *Type,