github.com/goplus/llgo@v0.8.3/cl/_testpy/pi/out.ll (about)

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  @"main.init$guard" = global ptr null
     5  @__llgo_argc = global ptr null
     6  @__llgo_argv = global ptr null
     7  @0 = private unnamed_addr constant [9 x i8] c"pi = %f\0A\00", align 1
     8  @__llgo_py.math = external global ptr
     9  @1 = private unnamed_addr constant [3 x i8] c"pi\00", align 1
    10  
    11  define void @main.init() {
    12  _llgo_0:
    13    %0 = load i1, ptr @"main.init$guard", align 1
    14    br i1 %0, label %_llgo_2, label %_llgo_1
    15  
    16  _llgo_1:                                          ; preds = %_llgo_0
    17    store i1 true, ptr @"main.init$guard", align 1
    18    call void @"github.com/goplus/llgo/py/math.init"()
    19    br label %_llgo_2
    20  
    21  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    22    ret void
    23  }
    24  
    25  define i32 @main(i32 %0, ptr %1) {
    26  _llgo_0:
    27    call void @Py_Initialize()
    28    store i32 %0, ptr @__llgo_argc, align 4
    29    store ptr %1, ptr @__llgo_argv, align 8
    30    call void @"github.com/goplus/llgo/internal/runtime.init"()
    31    call void @main.init()
    32    %2 = load ptr, ptr @__llgo_py.math, align 8
    33    %3 = call ptr @PyObject_GetAttrString(ptr %2, ptr @1)
    34    %4 = call double @PyFloat_AsDouble(ptr %3)
    35    %5 = call i32 (ptr, ...) @printf(ptr @0, double %4)
    36    ret i32 0
    37  }
    38  
    39  declare void @"github.com/goplus/llgo/py/math.init"()
    40  
    41  declare void @"github.com/goplus/llgo/internal/runtime.init"()
    42  
    43  declare ptr @PyObject_GetAttrString(ptr, ptr)
    44  
    45  declare double @PyFloat_AsDouble(ptr)
    46  
    47  declare i32 @printf(ptr, ...)
    48  
    49  declare void @Py_Initialize()