aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2023-06-01 18:58:26 +0200
committerRon Evans <[email protected]>2023-06-06 11:46:16 +0200
commit4a240827cbb74a2f4892850349e37f13aa205c19 (patch)
treeb84808353ce4db56153a90b9b2c9f2545c440555 /main.go
parent92d9f856ab704ec8615fc289a07fc9e0e7443778 (diff)
downloadtinygo-4a240827cbb74a2f4892850349e37f13aa205c19.tar.gz
tinygo-4a240827cbb74a2f4892850349e37f13aa205c19.zip
main: add -internal-nodwarf flag
This can be useful during development to avoid generating debug information in IR.
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.go b/main.go
index c1980881c..64bb2f6b2 100644
--- a/main.go
+++ b/main.go
@@ -1431,6 +1431,12 @@ func main() {
printIR := flag.Bool("internal-printir", false, "print LLVM IR")
dumpSSA := flag.Bool("internal-dumpssa", false, "dump internal Go SSA")
verifyIR := flag.Bool("internal-verifyir", false, "run extra verification steps on LLVM IR")
+ // Don't generate debug information in the IR, to make IR more readable.
+ // You generally want debug information in IR for various features, like
+ // stack size calculation and features like -size=short, -print-allocs=,
+ // etc. The -no-debug flag is used to strip it at link time. But for TinyGo
+ // development it can be useful to not emit debug information at all.
+ skipDwarf := flag.Bool("internal-nodwarf", false, "internal flag, use -no-debug instead")
var flagJSON, flagDeps, flagTest bool
if command == "help" || command == "list" || command == "info" || command == "build" {
@@ -1508,6 +1514,7 @@ func main() {
PrintIR: *printIR,
DumpSSA: *dumpSSA,
VerifyIR: *verifyIR,
+ SkipDWARF: *skipDwarf,
Semaphore: make(chan struct{}, *parallelism),
Debug: !*nodebug,
PrintSizes: *printSize,