mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
builder: remove non-ThinLTO build mode
All targets now support ThinLTO so let's remove the old unused code.
This commit is contained in:
committed by
Ron Evans
parent
201592d93b
commit
488174767b
@@ -1,20 +0,0 @@
|
||||
package transform
|
||||
|
||||
import "tinygo.org/x/go-llvm"
|
||||
|
||||
// This file implements small transformations on globals (functions and global
|
||||
// variables) for specific ABIs/architectures.
|
||||
|
||||
// ApplyFunctionSections puts every function in a separate section. This makes
|
||||
// it possible for the linker to remove dead code. It is the equivalent of
|
||||
// passing -ffunction-sections to a C compiler.
|
||||
func ApplyFunctionSections(mod llvm.Module) {
|
||||
llvmFn := mod.FirstFunction()
|
||||
for !llvmFn.IsNil() {
|
||||
if !llvmFn.IsDeclaration() && llvmFn.Section() == "" {
|
||||
name := llvmFn.Name()
|
||||
llvmFn.SetSection(".text." + name)
|
||||
}
|
||||
llvmFn = llvm.NextFunction(llvmFn)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package transform_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/tinygo-org/tinygo/transform"
|
||||
"tinygo.org/x/go-llvm"
|
||||
)
|
||||
|
||||
func TestApplyFunctionSections(t *testing.T) {
|
||||
t.Parallel()
|
||||
testTransform(t, "testdata/globals-function-sections", func(mod llvm.Module) {
|
||||
transform.ApplyFunctionSections(mod)
|
||||
})
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
|
||||
target triple = "armv7em-none-eabi"
|
||||
|
||||
declare void @foo()
|
||||
|
||||
define void @bar() {
|
||||
ret void
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
|
||||
target triple = "armv7em-none-eabi"
|
||||
|
||||
declare void @foo()
|
||||
|
||||
define void @bar() section ".text.bar" {
|
||||
ret void
|
||||
}
|
||||
Reference in New Issue
Block a user