mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 07:53:40 +00:00
all: move -panic=trap support to the compiler/runtime
Support for `-panic=trap` was previously a pass in the optimization pipeline. This change moves it to the compiler and runtime, which in my opinion is a much better place. As a side effect, it also fixes https://github.com/tinygo-org/tinygo/issues/4161 by trapping inside runtime.runtimePanicAt and not just runtime.runtimePanic. This change also adds a test for the list of imported functions. This is a more generic test where it's easy to add more tests for WebAssembly file properties, such as exported functions.
This commit is contained in:
committed by
Ron Evans
parent
6384ecace0
commit
ad4d722f54
@@ -40,10 +40,6 @@ func Optimize(mod llvm.Module, config *compileopts.Config) []error {
|
||||
fn.SetLinkage(llvm.ExternalLinkage)
|
||||
}
|
||||
|
||||
if config.PanicStrategy() == "trap" {
|
||||
ReplacePanicsWithTrap(mod) // -panic=trap
|
||||
}
|
||||
|
||||
// run a check of all of our code
|
||||
if config.VerifyIR() {
|
||||
errs := ircheck.Module(mod)
|
||||
|
||||
Reference in New Issue
Block a user