mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
all: add LLVM 12 support
Originally based on a PR by @QuLogic, but extended a lot to get all tests to pass.
This commit is contained in:
committed by
Ron Evans
parent
74b20ca234
commit
5127b9d65b
@@ -18,6 +18,7 @@ func TestOptimizeMaps(t *testing.T) {
|
||||
pm := llvm.NewPassManager()
|
||||
defer pm.Dispose()
|
||||
pm.AddDeadStoreEliminationPass()
|
||||
pm.AddAggressiveDCEPass()
|
||||
pm.Run(mod)
|
||||
})
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -301,13 +301,13 @@ declare i8* @llvm.coro.free(token, i8* nocapture readonly) #0
|
||||
; Function Attrs: nounwind
|
||||
declare token @llvm.coro.save(i8*) #2
|
||||
|
||||
; Function Attrs: argmemonly nounwind willreturn
|
||||
; Function Attrs: argmemonly nofree nosync nounwind willreturn
|
||||
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #3
|
||||
|
||||
; Function Attrs: argmemonly nounwind willreturn
|
||||
; Function Attrs: argmemonly nofree nosync nounwind willreturn
|
||||
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #3
|
||||
|
||||
attributes #0 = { argmemonly nounwind readonly }
|
||||
attributes #1 = { nounwind readnone }
|
||||
attributes #2 = { nounwind }
|
||||
attributes #3 = { argmemonly nounwind willreturn }
|
||||
attributes #3 = { argmemonly nofree nosync nounwind willreturn }
|
||||
|
||||
@@ -116,8 +116,9 @@ func filterIrrelevantIRLines(lines []string) []string {
|
||||
if strings.HasPrefix(line, "source_filename = ") {
|
||||
continue
|
||||
}
|
||||
if llvmVersion < 11 && strings.HasPrefix(line, "attributes ") {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user