llgo/ssa: abiMapOf
This commit is contained in:
@@ -4,6 +4,8 @@ source_filename = "main"
|
||||
@"main.init$guard" = global ptr null
|
||||
@__llgo_argc = global ptr null
|
||||
@__llgo_argv = global ptr null
|
||||
@"map[_llgo_int]_llgo_int" = linkonce global ptr null
|
||||
@_llgo_int = linkonce global ptr null
|
||||
@0 = private unnamed_addr constant [10 x i8] c"Hello %d\0A\00", align 1
|
||||
|
||||
define void @main.init() {
|
||||
@@ -13,6 +15,7 @@ _llgo_0:
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
call void @"main.init$after"()
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
@@ -26,7 +29,13 @@ _llgo_0:
|
||||
call void @"github.com/goplus/llgo/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.MakeSmallMap"()
|
||||
%3 = call i32 (ptr, ...) @printf(ptr @0, <null operand!>)
|
||||
%3 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
||||
%4 = call ptr @"github.com/goplus/llgo/internal/runtime.MapAssign"(ptr %3, ptr %2, i64 23)
|
||||
store i64 100, ptr %4, align 4
|
||||
%5 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
||||
%6 = call ptr @"github.com/goplus/llgo/internal/runtime.MapAssign"(ptr %5, ptr %2, i64 7)
|
||||
store i64 29, ptr %6, align 4
|
||||
%7 = call i32 (ptr, ...) @printf(ptr @0, <null operand!>)
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
@@ -34,4 +43,37 @@ declare void @"github.com/goplus/llgo/internal/runtime.init"()
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/internal/runtime.MakeSmallMap"()
|
||||
|
||||
define void @"main.init$after"() {
|
||||
_llgo_0:
|
||||
%0 = load ptr, ptr @_llgo_int, align 8
|
||||
%1 = icmp eq ptr %0, null
|
||||
br i1 %1, label %_llgo_1, label %_llgo_2
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
|
||||
store ptr %2, ptr @_llgo_int, align 8
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
%3 = load ptr, ptr @_llgo_int, align 8
|
||||
%4 = load ptr, ptr @_llgo_int, align 8
|
||||
%5 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
||||
%6 = icmp eq ptr %5, null
|
||||
br i1 %6, label %_llgo_3, label %_llgo_4
|
||||
|
||||
_llgo_3: ; preds = %_llgo_2
|
||||
%7 = call ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr %3, ptr %4)
|
||||
store ptr %7, ptr @"map[_llgo_int]_llgo_int", align 8
|
||||
br label %_llgo_4
|
||||
|
||||
_llgo_4: ; preds = %_llgo_3, %_llgo_2
|
||||
ret void
|
||||
}
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/internal/runtime.MapOf"(ptr, ptr)
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/internal/runtime.MapAssign"(ptr, ptr, ptr)
|
||||
|
||||
declare i32 @printf(ptr, ...)
|
||||
|
||||
Reference in New Issue
Block a user