@@ -12,7 +12,6 @@ import (
1212 "strings"
1313
1414 "github.com/goplus/llgo/internal/crosscompile/compile"
15- "github.com/goplus/llgo/internal/ctxreg"
1615 "github.com/goplus/llgo/internal/env"
1716 "github.com/goplus/llgo/internal/flash"
1817 "github.com/goplus/llgo/internal/targets"
@@ -82,11 +81,6 @@ func buildEnvMap(llgoRoot string) map[string]string {
8281 return envs
8382}
8483
85- // reserveRegisterFlags returns clang flags to reserve the closure ctx register.
86- func reserveRegisterFlags (goarch string ) []string {
87- return ctxreg .ReserveFlags (goarch )
88- }
89-
9084func appendMissingFlags (dst []string , flags []string ) []string {
9185 for i := 0 ; i < len (flags ); i ++ {
9286 flag := flags [i ]
@@ -279,11 +273,6 @@ func use(goos, goarch string, wasiThreads, forceEspClang bool) (export Export, e
279273 "-Qunused-arguments" ,
280274 "-Wno-unused-command-line-argument" ,
281275 }
282- if reserve := reserveRegisterFlags (goarch ); len (reserve ) > 0 {
283- export .CCFLAGS = appendMissingFlags (export .CCFLAGS , reserve )
284- export .CFLAGS = appendMissingFlags (export .CFLAGS , reserve )
285- }
286-
287276 // Add sysroot for macOS only
288277 if goos == "darwin" {
289278 sysrootPath , sysrootErr := getMacOSSysroot ()
@@ -528,10 +517,6 @@ func UseTarget(targetName string) (export Export, err error) {
528517 cflags = append (cflags , "--target=" + config .LLVMTarget )
529518 ccflags = append (ccflags , "--target=" + config .LLVMTarget )
530519 }
531- if reserve := reserveRegisterFlags (config .GOARCH ); len (reserve ) > 0 {
532- cflags = appendMissingFlags (cflags , reserve )
533- ccflags = appendMissingFlags (ccflags , reserve )
534- }
535520 // Expand template variables in cflags
536521 expandedCFlags := env .ExpandEnvSlice (config .CFlags , envs )
537522 cflags = append (cflags , expandedCFlags ... )
0 commit comments