-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
This can be very similar to @breakpoint.
Lines 552 to 558 in 4789cc0
| if (builtin.os.tag == .wasi) { | |
| exit(1); | |
| } | |
| if (builtin.os.tag == .cuda) { | |
| // TODO: introduce `@trap` instead of abusing https://github.com/ziglang/zig/issues/2291 | |
| @"llvm.trap"(); | |
| } |
It should be used in the os.abort implementation for WASI because it causes runtimes to generate a nice stacktrace instead of just exiting.
If a trap is not representable in any particular target, then it can be a compile error. Most targets will have a way to lower trap, however.
This is a contributor-friendly issue for anyone wishing to gently touch many different phases of the compiler pipeline.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.