compiler: remove parentHandle from calling convention

This removes the parentHandle argument from the internal calling convention.
It was formerly used to implment coroutines.
Now that coroutines have been removed, it is no longer necessary.
This commit is contained in:
Nia Waldvogel
2021-12-31 14:53:19 -05:00
committed by Nia
parent 0c2fefa09b
commit c6ae1c58fc
38 changed files with 443 additions and 487 deletions
+14 -14
View File
@@ -7,33 +7,33 @@ target triple = "armv7em-none-eabi"
%"runtime/interrupt.handle" = type { i8*, i32, %"runtime/interrupt.Interrupt" }
%"runtime/interrupt.Interrupt" = type { i32 }
@"runtime/interrupt.$interrupt2" = private unnamed_addr constant %"runtime/interrupt.handle" { i8* bitcast (%machine.UART* @machine.UART0 to i8*), i32 ptrtoint (void (i32, i8*, i8*)* @"(*machine.UART).handleInterrupt$bound" to i32), %"runtime/interrupt.Interrupt" { i32 2 } }
@"runtime/interrupt.$interrupt2" = private unnamed_addr constant %"runtime/interrupt.handle" { i8* bitcast (%machine.UART* @machine.UART0 to i8*), i32 ptrtoint (void (i32, i8*)* @"(*machine.UART).handleInterrupt$bound" to i32), %"runtime/interrupt.Interrupt" { i32 2 } }
@machine.UART0 = internal global %machine.UART { %machine.RingBuffer* @"machine$alloc.335" }
@"machine$alloc.335" = internal global %machine.RingBuffer zeroinitializer
declare void @"runtime/interrupt.callHandlers"(i32, i8*, i8*) local_unnamed_addr
declare void @"runtime/interrupt.callHandlers"(i32, i8*) local_unnamed_addr
declare void @"device/arm.EnableIRQ"(i32, i8* nocapture readnone, i8* nocapture readnone)
declare void @"device/arm.EnableIRQ"(i32, i8* nocapture readnone)
declare void @"device/arm.SetPriority"(i32, i32, i8* nocapture readnone, i8* nocapture readnone)
declare void @"device/arm.SetPriority"(i32, i32, i8* nocapture readnone)
declare void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt")
define void @runtime.initAll(i8* nocapture readnone, i8* nocapture readnone) unnamed_addr {
define void @runtime.initAll(i8* nocapture readnone) unnamed_addr {
entry:
call void @"device/arm.SetPriority"(i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32), i32 192, i8* undef, i8* undef)
call void @"device/arm.EnableIRQ"(i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32), i8* undef, i8* undef)
call void @"device/arm.SetPriority"(i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32), i32 192, i8* undef)
call void @"device/arm.EnableIRQ"(i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32), i8* undef)
call void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt" { i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32) })
ret void
}
define void @UARTE0_UART0_IRQHandler() {
call void @"runtime/interrupt.callHandlers"(i32 2, i8* undef, i8* undef)
call void @"runtime/interrupt.callHandlers"(i32 2, i8* undef)
ret void
}
define void @NFCT_IRQHandler() {
call void @"runtime/interrupt.callHandlers"(i32 5, i8* undef, i8* undef)
call void @"runtime/interrupt.callHandlers"(i32 5, i8* undef)
ret void
}
@@ -45,22 +45,22 @@ entry:
]
switch.body2:
call void @"runtime/interrupt.callHandlers"(i32 2, i8* undef, i8* undef)
call void @"runtime/interrupt.callHandlers"(i32 2, i8* undef)
ret void
switch.body5:
call void @"runtime/interrupt.callHandlers"(i32 5, i8* undef, i8* undef)
call void @"runtime/interrupt.callHandlers"(i32 5, i8* undef)
ret void
switch.done:
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, i8* nocapture %context) {
entry:
%unpack.ptr = bitcast i8* %context to %machine.UART*
call void @"(*machine.UART).handleInterrupt"(%machine.UART* %unpack.ptr, i32 %0, i8* undef, i8* undef)
call void @"(*machine.UART).handleInterrupt"(%machine.UART* %unpack.ptr, i32 %0, i8* undef)
ret void
}
declare void @"(*machine.UART).handleInterrupt"(%machine.UART* nocapture, i32, i8* nocapture readnone, i8* nocapture readnone)
declare void @"(*machine.UART).handleInterrupt"(%machine.UART* nocapture, i32, i8* nocapture readnone)