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
This commit is contained in:
Ayke van Laethem
2022-05-05 14:52:20 +02:00
committed by Ron Evans
parent 5afb63df60
commit 5c23f6fb6c
17 changed files with 18 additions and 166 deletions
-8
View File
@@ -233,14 +233,6 @@ func setHeapEnd(newHeapEnd uintptr) {
// This function can be called again when the heap size increases. The caller is
// responsible for copying the metadata to the new location.
func calculateHeapAddresses() {
if GOARCH == "wasm" {
// This is a workaround for a bug in wasm-ld: wasm-ld doesn't always
// align __heap_base and when this memory is shared through an API, it
// might result in unaligned memory. For details, see:
// https://reviews.llvm.org/D106499
// It should be removed once we switch to LLVM 13, where this is fixed.
heapStart = align(heapStart)
}
totalSize := heapEnd - heapStart
// Allocate some memory to keep 2 bits of information about every block.
+1 -12
View File
@@ -4,21 +4,10 @@
package runtime
import "unsafe"
// markGlobals marks all globals, which are reachable by definition.
//
// This implementation marks all globals conservatively and assumes it can use
// linker-defined symbols for the start and end of the .data section.
func markGlobals() {
end := globalsEnd
if GOARCH == "wasm" {
// This is a workaround for a bug in wasm-ld: wasm-ld doesn't always
// align __heap_base and when this memory is shared through an API, it
// might result in unaligned memory. For details, see:
// https://reviews.llvm.org/D106499
// It should be removed once we switch to LLVM 13, where this is fixed.
end = end &^ (unsafe.Alignof(end) - 1)
}
markRoots(globalsStart, end)
markRoots(globalsStart, globalsEnd)
}
+1 -6
View File
@@ -67,12 +67,7 @@ func SetFinalizer(obj interface{}, finalizer interface{}) {
func initHeap() {
// preinit() may have moved heapStart; reset heapptr
ptr := heapStart
if GOARCH == "wasm" {
// llvm11 and llvm12 do not correctly align the heap on wasm
ptr = align(ptr)
}
heapptr = ptr
heapptr = heapStart
}
// setHeapEnd sets a new (larger) heapEnd pointer.