diff options
author | Ayke van Laethem <[email protected]> | 2020-07-12 19:25:36 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2020-07-13 12:20:09 +0200 |
commit | 05495c42820e56b384cc5e92ae0ea26354fe1667 (patch) | |
tree | 011ed81922800ad4a34e245349459fad0dab7468 /transform/optimizer.go | |
parent | d60631551540799f4431b56d35d6e586c488c834 (diff) | |
download | tinygo-05495c42820e56b384cc5e92ae0ea26354fe1667.tar.gz tinygo-05495c42820e56b384cc5e92ae0ea26354fe1667.zip |
all: fix -gc=none
This option was broken for a long time, in part because we didn't test
for it. This commit fixes that and adds a test to make sure it won't
break again unnoticed.
Diffstat (limited to 'transform/optimizer.go')
-rw-r--r-- | transform/optimizer.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/transform/optimizer.go b/transform/optimizer.go index 9c77c312d..917083ce8 100644 --- a/transform/optimizer.go +++ b/transform/optimizer.go @@ -158,7 +158,7 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i // After TinyGo-specific transforms have finished, undo exporting these functions. for _, name := range getFunctionsUsedInTransforms(config) { fn := mod.NamedFunction(name) - if fn.IsNil() { + if fn.IsNil() || fn.IsDeclaration() { continue } fn.SetLinkage(llvm.InternalLinkage) |