Skip to content

Commit

Permalink
llvm: fix various crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 committed Jul 18, 2023
1 parent 9bccb34 commit f1c1eb5
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 84 deletions.
29 changes: 27 additions & 2 deletions lib/std/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1910,12 +1910,37 @@ pub const Target = struct {

pub fn stackAlignment(target: Target) u16 {
return switch (target.cpu.arch) {
.amdgcn => 4,
.x86 => switch (target.os.tag) {
.windows => 4,
else => 16,
},
.arm, .armeb, .mips, .mipsel => 8,
.aarch64, .aarch64_be, .powerpc64, .powerpc64le, .riscv64, .x86_64, .wasm32, .wasm64 => 16,
.arm,
.armeb,
.thumb,
.thumbeb,
.mips,
.mipsel,
.sparc,
.sparcel,
=> 8,
.aarch64,
.aarch64_be,
.aarch64_32,
.bpfeb,
.bpfel,
.mips64,
.mips64el,
.powerpc64,
.powerpc64le,
.riscv32,
.riscv64,
.sparc64,
.x86_64,
.ve,
.wasm32,
.wasm64,
=> 16,
else => @divExact(target.ptrBitWidth(), 8),
};
}
Expand Down
Loading

0 comments on commit f1c1eb5

Please sign in to comment.