mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 10:43:29 +00:00
add -nobounds (similar to -gcflags=-B)
This commit is contained in:
@@ -214,6 +214,7 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||||||
MaxStackAlloc: config.MaxStackAlloc(),
|
MaxStackAlloc: config.MaxStackAlloc(),
|
||||||
NeedsStackObjects: config.NeedsStackObjects(),
|
NeedsStackObjects: config.NeedsStackObjects(),
|
||||||
Debug: !config.Options.SkipDWARF, // emit DWARF except when -internal-nodwarf is passed
|
Debug: !config.Options.SkipDWARF, // emit DWARF except when -internal-nodwarf is passed
|
||||||
|
Nobounds: config.Options.Nobounds,
|
||||||
PanicStrategy: config.PanicStrategy(),
|
PanicStrategy: config.PanicStrategy(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ type Options struct {
|
|||||||
PrintCommands func(cmd string, args ...string) `json:"-"`
|
PrintCommands func(cmd string, args ...string) `json:"-"`
|
||||||
Semaphore chan struct{} `json:"-"` // -p flag controls cap
|
Semaphore chan struct{} `json:"-"` // -p flag controls cap
|
||||||
Debug bool
|
Debug bool
|
||||||
|
Nobounds bool
|
||||||
PrintSizes string
|
PrintSizes string
|
||||||
PrintAllocs *regexp.Regexp // regexp string
|
PrintAllocs *regexp.Regexp // regexp string
|
||||||
PrintStacks bool
|
PrintStacks bool
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ type Config struct {
|
|||||||
MaxStackAlloc uint64
|
MaxStackAlloc uint64
|
||||||
NeedsStackObjects bool
|
NeedsStackObjects bool
|
||||||
Debug bool // Whether to emit debug information in the LLVM module.
|
Debug bool // Whether to emit debug information in the LLVM module.
|
||||||
|
Nobounds bool // Whether to skip bounds checks
|
||||||
PanicStrategy string
|
PanicStrategy string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -438,6 +438,10 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Nobounds {
|
||||||
|
info.nobounds = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether this function can be used in //go:wasmimport or
|
// Check whether this function can be used in //go:wasmimport or
|
||||||
|
|||||||
@@ -1514,6 +1514,7 @@ func main() {
|
|||||||
printCommands := flag.Bool("x", false, "Print commands")
|
printCommands := flag.Bool("x", false, "Print commands")
|
||||||
parallelism := flag.Int("p", runtime.GOMAXPROCS(0), "the number of build jobs that can run in parallel")
|
parallelism := flag.Int("p", runtime.GOMAXPROCS(0), "the number of build jobs that can run in parallel")
|
||||||
nodebug := flag.Bool("no-debug", false, "strip debug information")
|
nodebug := flag.Bool("no-debug", false, "strip debug information")
|
||||||
|
nobounds := flag.Bool("nobounds", false, "do not emit bounds checks")
|
||||||
ocdCommandsString := flag.String("ocd-commands", "", "OpenOCD commands, overriding target spec (can specify multiple separated by commas)")
|
ocdCommandsString := flag.String("ocd-commands", "", "OpenOCD commands, overriding target spec (can specify multiple separated by commas)")
|
||||||
ocdOutput := flag.Bool("ocd-output", false, "print OCD daemon output during debug")
|
ocdOutput := flag.Bool("ocd-output", false, "print OCD daemon output during debug")
|
||||||
port := flag.String("port", "", "flash port (can specify multiple candidates separated by commas)")
|
port := flag.String("port", "", "flash port (can specify multiple candidates separated by commas)")
|
||||||
@@ -1625,6 +1626,7 @@ func main() {
|
|||||||
SkipDWARF: *skipDwarf,
|
SkipDWARF: *skipDwarf,
|
||||||
Semaphore: make(chan struct{}, *parallelism),
|
Semaphore: make(chan struct{}, *parallelism),
|
||||||
Debug: !*nodebug,
|
Debug: !*nodebug,
|
||||||
|
Nobounds: *nobounds,
|
||||||
PrintSizes: *printSize,
|
PrintSizes: *printSize,
|
||||||
PrintStacks: *printStacks,
|
PrintStacks: *printStacks,
|
||||||
PrintAllocs: printAllocs,
|
PrintAllocs: printAllocs,
|
||||||
|
|||||||
Reference in New Issue
Block a user