mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
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.
This commit is contained in:
committed by
Ron Evans
parent
d606315515
commit
05495c4282
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user