From 05495c42820e56b384cc5e92ae0ea26354fe1667 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 12 Jul 2020 19:25:36 +0200 Subject: 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. --- transform/optimizer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'transform/optimizer.go') 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) -- cgit v1.2.3