main: switch to LLVM 10

This commit also adds a bit of version independence, in particular for
external commands. It also adds the LLVM version to the `tinygo version`
command, which might help while debugging.
This commit is contained in:
Ayke van Laethem
2020-03-03 14:50:13 +01:00
committed by Ron Evans
parent 584e94ce2f
commit 0afd42c439
25 changed files with 165 additions and 118 deletions
+14 -14
View File
@@ -32,7 +32,7 @@ declare void @callMain(i8*, i8*)
declare void @enqueueTimer(%"internal/task.Task"*, i64, i8*, i8*)
define void @sleep(i64, i8*, i8* %parentHandle) {
define void @sleep(i64 %0, i8* %1, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
%task.current1 = bitcast i8* %parentHandle to %"internal/task.Task"*
@@ -40,7 +40,7 @@ entry:
ret void
}
define i32 @delayedValue(i32, i64, i8*, i8* %parentHandle) {
define i32 @delayedValue(i32 %0, i64 %1, i8* %2, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
%ret.ptr = call i8* @"(*internal/task.Task).getReturnPtr"(%"internal/task.Task"* %task.current, i8* undef, i8* undef)
@@ -50,20 +50,20 @@ entry:
ret i32 undef
}
define void @deadlock(i8*, i8* %parentHandle) {
define void @deadlock(i8* %0, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
ret void
}
define i32 @tail(i32, i64, i8*, i8* %parentHandle) {
define i32 @tail(i32 %0, i64 %1, i8* %2, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
%3 = call i32 @delayedValue(i32 %0, i64 %1, i8* undef, i8* %parentHandle)
ret i32 undef
}
define void @ditchTail(i32, i64, i8*, i8* %parentHandle) {
define void @ditchTail(i32 %0, i64 %1, i8* %2, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
%ret.ditch = call i8* @runtime.alloc(i32 4, i8* undef, i8* undef)
@@ -72,14 +72,14 @@ entry:
ret void
}
define void @voidTail(i32, i64, i8*, i8* %parentHandle) {
define void @voidTail(i32 %0, i64 %1, i8* %2, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
call void @ditchTail(i32 %0, i64 %1, i8* undef, i8* %parentHandle)
ret void
}
define i32 @alternateTail(i32, i32, i64, i8*, i8* %parentHandle) {
define i32 @alternateTail(i32 %0, i32 %1, i64 %2, i8* %3, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
%ret.ptr = call i8* @"(*internal/task.Task).getReturnPtr"(%"internal/task.Task"* %task.current, i8* undef, i8* undef)
@@ -91,7 +91,7 @@ entry:
ret i32 undef
}
define i1 @coroutine(i32, i64, i8*, i8* %parentHandle) {
define i1 @coroutine(i32 %0, i64 %1, i8* %2, i8* %parentHandle) {
entry:
%call.return = alloca i32
%coro.id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null)
@@ -133,18 +133,18 @@ cleanup: ; preds = %entry, %wakeup
br label %suspend
}
define void @doNothing(i8*, i8*) {
define void @doNothing(i8* %0, i8* %1) {
entry:
ret void
}
define void @sleepGoroutine(i8*, i8* %parentHandle) {
define void @sleepGoroutine(i8* %0, i8* %parentHandle) {
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
call void @sleep(i64 1000000, i8* undef, i8* %parentHandle)
ret void
}
define void @progMain(i8*, i8* %parentHandle) {
define void @progMain(i8* %0, i8* %parentHandle) {
entry:
%task.current = bitcast i8* %parentHandle to %"internal/task.Task"*
call void @doNothing(i8* undef, i8* undef)
@@ -185,13 +185,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
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #3
; Function Attrs: argmemonly nounwind
; Function Attrs: argmemonly 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 }
attributes #3 = { argmemonly nounwind willreturn }
+3 -3
View File
@@ -29,7 +29,7 @@ declare void @func1Uint8(i8, i8*, i8*)
declare void @func2Uint8(i8, i8*, i8*)
define void @runFunc1(i8*, i32, i8, i8* %context, i8* %parentHandle) {
define void @runFunc1(i8* %0, i32 %1, i8 %2, i8* %context, i8* %parentHandle) {
entry:
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, void (i8, i8*, i8*)* null, void (i8, i8*, i8*)* @funcInt8
@@ -45,7 +45,7 @@ fpcall.next: ; preds = %entry
ret void
}
define void @runFunc2(i8*, i32, i8, i8* %context, i8* %parentHandle) {
define void @runFunc2(i8* %0, i32 %1, i8 %2, i8* %context, i8* %parentHandle) {
entry:
br i1 false, label %fpcall.nil, label %fpcall.next
@@ -79,7 +79,7 @@ func.default: ; preds = %fpcall.next
unreachable
}
define void @sleepFuncValue(i8*, i32, i8* nocapture readnone %context, i8* nocapture readnone %parentHandle) {
define void @sleepFuncValue(i8* %0, i32 %1, i8* nocapture readnone %context, i8* nocapture readnone %parentHandle) {
entry:
switch i32 %1, label %func.default [
i32 0, label %func.nil
+2 -2
View File
@@ -94,7 +94,7 @@ entry:
store i8 1, i8* %entry.y
br label %loop
loop:
loop: ; preds = %loop, %entry
%prev.y = phi i8* [ %entry.y, %entry ], [ %prev.x, %loop ]
%prev.x = phi i8* [ %entry.x, %entry ], [ %next.x, %loop ]
%5 = getelementptr { %runtime.stackChainObject*, i32, i8*, i8*, i8*, i8*, i8* }, { %runtime.stackChainObject*, i32, i8*, i8*, i8*, i8*, i8* }* %gc.stackobject, i32 0, i32 5
@@ -108,7 +108,7 @@ loop:
%loop.done = icmp ult i8 40, %next.x.val
br i1 %loop.done, label %end, label %loop
end:
end: ; preds = %loop
store %runtime.stackChainObject* %0, %runtime.stackChainObject** @runtime.stackChainStart
ret i8* %next.x
}
+1 -1
View File
@@ -19,7 +19,7 @@ declare i32 @"runtime/interrupt.Register"(i32, i8*, i16, i8*, i8*) addrspace(1)
declare void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt") addrspace(1)
define void @"(machine.UART).Configure"(%machine.RingBuffer*, i32, i8, i8, i8* %context, i8* %parentHandle) unnamed_addr addrspace(1) {
define void @"(machine.UART).Configure"(%machine.RingBuffer* %0, i32 %1, i8 %2, i8 %3, i8* %context, i8* %parentHandle) unnamed_addr addrspace(1) {
ret void
}
+2 -2
View File
@@ -16,14 +16,14 @@ declare void @"device/arm.EnableIRQ"(i32, i8* nocapture readnone, i8* nocapture
declare void @"device/arm.SetPriority"(i32, i32, i8* nocapture readnone, i8* nocapture readnone)
define void @runtime.initAll(i8* nocapture readnone, i8* nocapture readnone) unnamed_addr {
define void @runtime.initAll(i8* nocapture readnone %0, i8* nocapture readnone %1) unnamed_addr {
entry:
call void @"device/arm.SetPriority"(i32 2, i32 192, i8* undef, i8* undef)
call void @"device/arm.EnableIRQ"(i32 2, i8* undef, i8* undef)
ret void
}
define internal void @"(*machine.UART).handleInterrupt$bound"(i32, i8* nocapture %context, i8* nocapture readnone %parentHandle) {
define internal void @"(*machine.UART).handleInterrupt$bound"(i32 %0, i8* nocapture %context, i8* nocapture readnone %parentHandle) {
entry:
%unpack.ptr = bitcast i8* %context to %machine.UART*
call void @"(*machine.UART).handleInterrupt"(%machine.UART* %unpack.ptr, i32 %0, i8* undef, i8* undef)
+1 -1
View File
@@ -37,7 +37,7 @@ define internal void @callExportedFunction(i64 %foo) {
declare void @externalCall(i64*, i8*, i32, i64*)
define void @exportedFunction(i64*) {
define void @exportedFunction(i64* %0) {
entry:
%i64 = load i64, i64* %0
call void @"exportedFunction$i64wrap"(i64 %i64)