stage2: LLVM backend: fix const packed structs

When doing LLVM const bit shifting we must make sure the integer bit
sizes are wide enough or else LLVM gives us a poison result.
This commit is contained in:
Andrew Kelley
2021-12-27 16:59:26 -07:00
parent 3abe464b06
commit 886df772f0
5 changed files with 55 additions and 62 deletions

View File

@@ -201,6 +201,11 @@ pub const Value = opaque {
pub const addCase = LLVMAddCase;
extern fn LLVMAddCase(Switch: *const Value, OnVal: *const Value, Dest: *const BasicBlock) void;
pub inline fn isPoison(Val: *const Value) bool {
return LLVMIsPoison(Val).toBool();
}
extern fn LLVMIsPoison(Val: *const Value) Bool;
};
pub const Type = opaque {