diff options
author | Ayke van Laethem <[email protected]> | 2023-02-26 14:52:56 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2023-02-26 19:22:10 +0100 |
commit | 488174767b13912e1ccc239053c47481cf8cb4da (patch) | |
tree | 341341a3608473c37044f277d69c83fe5f741fa3 /transform | |
parent | 201592d93b9d2f18d2922b851dbf611d9609767c (diff) | |
download | tinygo-488174767b13912e1ccc239053c47481cf8cb4da.tar.gz tinygo-488174767b13912e1ccc239053c47481cf8cb4da.zip |
builder: remove non-ThinLTO build mode
All targets now support ThinLTO so let's remove the old unused code.
Diffstat (limited to 'transform')
-rw-r--r-- | transform/globals.go | 20 | ||||
-rw-r--r-- | transform/globals_test.go | 15 | ||||
-rw-r--r-- | transform/testdata/globals-function-sections.ll | 8 | ||||
-rw-r--r-- | transform/testdata/globals-function-sections.out.ll | 8 |
4 files changed, 0 insertions, 51 deletions
diff --git a/transform/globals.go b/transform/globals.go deleted file mode 100644 index cc506f024..000000000 --- a/transform/globals.go +++ /dev/null @@ -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) - } -} diff --git a/transform/globals_test.go b/transform/globals_test.go deleted file mode 100644 index 1b6f243b8..000000000 --- a/transform/globals_test.go +++ /dev/null @@ -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) - }) -} diff --git a/transform/testdata/globals-function-sections.ll b/transform/testdata/globals-function-sections.ll deleted file mode 100644 index 505ba5aa5..000000000 --- a/transform/testdata/globals-function-sections.ll +++ /dev/null @@ -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 -} diff --git a/transform/testdata/globals-function-sections.out.ll b/transform/testdata/globals-function-sections.out.ll deleted file mode 100644 index e3d03ed07..000000000 --- a/transform/testdata/globals-function-sections.out.ll +++ /dev/null @@ -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 -} |