aboutsummaryrefslogtreecommitdiffhomepage
path: root/transform
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-05-05 14:52:20 +0200
committerRon Evans <[email protected]>2022-05-07 17:15:35 +0200
commit5c23f6fb6c64c4de46a3cf2374490a2c3b7401f3 (patch)
treee5048ec49679778313cb3db5416bbbb0b4b3bddd /transform
parent5afb63df60427bd5ddf7adb8e2d43258c2544ce6 (diff)
downloadtinygo-5c23f6fb6c64c4de46a3cf2374490a2c3b7401f3.tar.gz
tinygo-5c23f6fb6c64c4de46a3cf2374490a2c3b7401f3.zip
all: remove support for LLVM 11 and LLVM 12
This removes a lot of backwards compatibility cruft and makes it possible to start using features that need LLVM 13 or newer. For example: * https://github.com/tinygo-org/tinygo/pull/2637 * https://github.com/tinygo-org/tinygo/pull/2830
Diffstat (limited to 'transform')
-rw-r--r--transform/globals.go14
-rw-r--r--transform/transform_test.go12
2 files changed, 0 insertions, 26 deletions
diff --git a/transform/globals.go b/transform/globals.go
index d147062bf..cc506f024 100644
--- a/transform/globals.go
+++ b/transform/globals.go
@@ -18,17 +18,3 @@ func ApplyFunctionSections(mod llvm.Module) {
llvmFn = llvm.NextFunction(llvmFn)
}
}
-
-// DisableTailCalls adds the "disable-tail-calls"="true" function attribute to
-// all functions. This may be necessary, in particular to avoid an error with
-// WebAssembly in LLVM 11.
-func DisableTailCalls(mod llvm.Module) {
- attribute := mod.Context().CreateStringAttribute("disable-tail-calls", "true")
- llvmFn := mod.FirstFunction()
- for !llvmFn.IsNil() {
- if !llvmFn.IsDeclaration() {
- llvmFn.AddFunctionAttr(attribute)
- }
- llvmFn = llvm.NextFunction(llvmFn)
- }
-}
diff --git a/transform/transform_test.go b/transform/transform_test.go
index 2296c97f5..bde1351ff 100644
--- a/transform/transform_test.go
+++ b/transform/transform_test.go
@@ -9,7 +9,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
- "strconv"
"strings"
"testing"
@@ -101,12 +100,6 @@ func fuzzyEqualIR(s1, s2 string) bool {
// stripped out.
func filterIrrelevantIRLines(lines []string) []string {
var out []string
- llvmVersion, err := strconv.Atoi(strings.Split(llvm.Version, ".")[0])
- if err != nil {
- // Note: this should never happen and if it does, it will always happen
- // for a particular build because llvm.Version is a constant.
- panic(err)
- }
for _, line := range lines {
line = strings.Split(line, ";")[0] // strip out comments/info
line = strings.TrimRight(line, "\r ") // drop '\r' on Windows and remove trailing spaces from comments
@@ -116,11 +109,6 @@ func filterIrrelevantIRLines(lines []string) []string {
if strings.HasPrefix(line, "source_filename = ") {
continue
}
- if llvmVersion < 12 && strings.HasPrefix(line, "attributes ") {
- // Ignore attribute groups. These may change between LLVM versions.
- // Right now test outputs are for LLVM 12.
- continue
- }
out = append(out, line)
}
return out