aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2020-07-12 19:25:36 +0200
committerRon Evans <[email protected]>2020-07-13 12:20:09 +0200
commit05495c42820e56b384cc5e92ae0ea26354fe1667 (patch)
tree011ed81922800ad4a34e245349459fad0dab7468 /transform
parentd60631551540799f4431b56d35d6e586c488c834 (diff)
downloadtinygo-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')
-rw-r--r--transform/optimizer.go2
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)