You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1765 lines
72 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

========== test/test_case/functional/05_arr_defn4.sy ==========
SymbolTable::addSymbol: stored getint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored starttime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored stoptime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored main with kind=1, const_def_ctx=0
[DEBUG] 进入函数: main 返回类型: int
[DEBUG] CheckConstDef: a base_type: int is_array: 1 dim_count: 2
[DEBUG] dim[0] = 4
[DEBUG] dim[1] = 2
[DEBUG] 创建数组类型完成IsArray: 1
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] visitUnaryExp: 7
[DEBUG] visitPrimaryExp: 7
[SymbolTable Debug] 进入花括号初始化列表: { ... }
[SymbolTable Debug] 进入花括号初始化列表: { ... }
[SymbolTable Debug] 处理常量表达式: 1 类型=INT 值=1 目标类型=Int32
[SymbolTable Debug] 处理常量表达式: 2 类型=INT 值=2 目标类型=Int32
[SymbolTable Debug] 退出花括号初始化列表
[SymbolTable Debug] 进入花括号初始化列表: { ... }
[SymbolTable Debug] 处理常量表达式: 3 类型=INT 值=3 目标类型=Int32
[SymbolTable Debug] 处理常量表达式: 4 类型=INT 值=4 目标类型=Int32
[SymbolTable Debug] 退出花括号初始化列表
[SymbolTable Debug] 进入花括号初始化列表: { ... }
[SymbolTable Debug] 退出花括号初始化列表
[SymbolTable Debug] 处理常量表达式: 7 类型=INT 值=7 目标类型=Int32
[SymbolTable Debug] 退出花括号初始化列表
[DEBUG] 初始化值数量: 8
[DEBUG] 期望元素数量: 8
CheckConstDef: before addSymbol, sym.kind = 3
保存常量定义上下文: a, ctx: 0x55577d342b00
[DEBUG] 数组常量,不存储单个常量值
SymbolTable::addSymbol: stored a with kind=3, const_def_ctx=0x55577d342b00
CheckConstDef: after addSymbol, sym.kind = 3
SymbolTable::lookup: found a in scope level 3, kind=3, const_def_ctx=0x55577d342b00
CheckConstDef: after addSymbol, stored const_def_ctx = 0x55577d342b00
[DEBUG] 常量符号添加完成
[DEBUG] CheckConstDef: N base_type: int is_array: 0 dim_count: 0
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] 初始化值数量: 1
CheckConstDef: before addSymbol, sym.kind = 3
保存常量定义上下文: N, ctx: 0x55577d34d2c0
SymbolTable::addSymbol: stored N with kind=3, const_def_ctx=0x55577d34d2c0
CheckConstDef: after addSymbol, sym.kind = 3
SymbolTable::lookup: found N in scope level 3, kind=3, const_def_ctx=0x55577d34d2c0
CheckConstDef: after addSymbol, stored const_def_ctx = 0x55577d34d2c0
[DEBUG] 常量符号添加完成
[DEBUG] CheckVarDef: b base_type: int is_array: 1 dim_count: 2
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] dim[0] = 4
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] dim[1] = 2
[DEBUG] 创建数组类型完成
[DEBUG] type->IsArray(): 1
[DEBUG] type->GetKind(): 6
[DEBUG] ArrayType dimensions: 4 2
[DEBUG] Element type: int
SymbolTable::addSymbol: stored b with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: b type_kind: 6 is_array: 1
[DEBUG] CheckVarDef: c base_type: int is_array: 1 dim_count: 2
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] dim[0] = 4
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] dim[1] = 2
[DEBUG] 创建数组类型完成
[DEBUG] type->IsArray(): 1
[DEBUG] type->GetKind(): 6
[DEBUG] ArrayType dimensions: 4 2
[DEBUG] Element type: int
[DEBUG] CheckExp: 1
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] CheckExp: 2
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] CheckExp: 3
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] CheckExp: 4
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] CheckExp: 5
[DEBUG] visitUnaryExp: 5
[DEBUG] visitPrimaryExp: 5
[DEBUG] CheckExp: 6
[DEBUG] visitUnaryExp: 6
[DEBUG] visitPrimaryExp: 6
[DEBUG] CheckExp: 7
[DEBUG] visitUnaryExp: 7
[DEBUG] visitPrimaryExp: 7
[DEBUG] CheckExp: 8
[DEBUG] visitUnaryExp: 8
[DEBUG] visitPrimaryExp: 8
SymbolTable::addSymbol: stored c with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: c type_kind: 6 is_array: 1
[DEBUG] CheckVarDef: d base_type: int is_array: 1 dim_count: 2
[DEBUG] visitUnaryExp: N
[DEBUG] visitPrimaryExp: N
SymbolTable::lookup: found N in scope level 3, kind=3, const_def_ctx=0x55577d34d2c0
CheckLValue: found sym->name = N, sym->kind = 3
绑定常量: N -> ConstDefContext
CheckLValue 绑定变量: N, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x55577d34d2c0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
SymbolTable::lookup: found N in scope level 3, kind=3, const_def_ctx=0x55577d34d2c0
[DEBUG] dim[0] = 4
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] dim[1] = 2
[DEBUG] 创建数组类型完成
[DEBUG] type->IsArray(): 1
[DEBUG] type->GetKind(): 6
[DEBUG] ArrayType dimensions: 4 2
[DEBUG] Element type: int
[DEBUG] CheckExp: 1
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] CheckExp: 2
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] CheckExp: 3
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] CheckExp: 5
[DEBUG] visitUnaryExp: 5
[DEBUG] visitPrimaryExp: 5
[DEBUG] CheckExp: a[3][0]
[DEBUG] visitUnaryExp: a[3][0]
[DEBUG] visitPrimaryExp: a[3][0]
SymbolTable::lookup: found a in scope level 3, kind=3, const_def_ctx=0x55577d342b00
CheckLValue: found sym->name = a, sym->kind = 3
绑定常量: a -> ConstDefContext
CheckLValue 绑定变量: a, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x55577d342b00
dim_count: 2, subscript_count: 2
[DEBUG] CheckExp: 3
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
完全索引,返回元素类型
[DEBUG] CheckExp: 8
[DEBUG] visitUnaryExp: 8
[DEBUG] visitPrimaryExp: 8
SymbolTable::addSymbol: stored d with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: d type_kind: 6 is_array: 1
[DEBUG] CheckVarDef: e base_type: int is_array: 1 dim_count: 3
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] dim[0] = 4
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] dim[1] = 2
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] dim[2] = 1
[DEBUG] 创建数组类型完成
[DEBUG] type->IsArray(): 1
[DEBUG] type->GetKind(): 6
[DEBUG] ArrayType dimensions: 4 2 1
[DEBUG] Element type: int
[DEBUG] CheckExp: d[2][1]
[DEBUG] visitUnaryExp: d[2][1]
[DEBUG] visitPrimaryExp: d[2][1]
SymbolTable::lookup: found d in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = d, sym->kind = 0
绑定变量: d -> VarDefContext
CheckLValue 绑定变量: d, sym->kind: 0, sym->var_def_ctx: 0x55577d353a40, sym->const_def_ctx: 0
dim_count: 2, subscript_count: 2
[DEBUG] CheckExp: 2
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] CheckExp: 1
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
完全索引,返回元素类型
[DEBUG] CheckExp: c[2][1]
[DEBUG] visitUnaryExp: c[2][1]
[DEBUG] visitPrimaryExp: c[2][1]
SymbolTable::lookup: found c in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = c, sym->kind = 0
绑定变量: c -> VarDefContext
CheckLValue 绑定变量: c, sym->kind: 0, sym->var_def_ctx: 0x55577d34ff60, sym->const_def_ctx: 0
dim_count: 2, subscript_count: 2
[DEBUG] CheckExp: 2
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] CheckExp: 1
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
完全索引,返回元素类型
[DEBUG] CheckExp: 3
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] CheckExp: 4
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] CheckExp: 5
[DEBUG] visitUnaryExp: 5
[DEBUG] visitPrimaryExp: 5
[DEBUG] CheckExp: 6
[DEBUG] visitUnaryExp: 6
[DEBUG] visitPrimaryExp: 6
[DEBUG] CheckExp: 7
[DEBUG] visitUnaryExp: 7
[DEBUG] visitPrimaryExp: 7
[DEBUG] CheckExp: 8
[DEBUG] visitUnaryExp: 8
[DEBUG] visitPrimaryExp: 8
SymbolTable::addSymbol: stored e with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: e type_kind: 6 is_array: 1
[DEBUG] visitStmt: Return ExpStmt
[DEBUG] 检测到 return 语句
[DEBUG] visitReturnStmtInternal 被调用
[DEBUG] 有返回值的 return
[DEBUG] CheckExp: e[3][1][0]+e[0][0][0]+e[0][1][0]+d[3][0]
[DEBUG] visitUnaryExp: e[3][1][0]
[DEBUG] visitPrimaryExp: e[3][1][0]
SymbolTable::lookup: found e in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = e, sym->kind = 0
绑定变量: e -> VarDefContext
CheckLValue 绑定变量: e, sym->kind: 0, sym->var_def_ctx: 0x55577d35c470, sym->const_def_ctx: 0
dim_count: 3, subscript_count: 3
[DEBUG] CheckExp: 3
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] CheckExp: 1
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
完全索引,返回元素类型
[DEBUG] visitUnaryExp: e[0][0][0]
[DEBUG] visitPrimaryExp: e[0][0][0]
SymbolTable::lookup: found e in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = e, sym->kind = 0
绑定变量: e -> VarDefContext
CheckLValue 绑定变量: e, sym->kind: 0, sym->var_def_ctx: 0x55577d35c470, sym->const_def_ctx: 0
dim_count: 3, subscript_count: 3
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
完全索引,返回元素类型
[DEBUG] visitUnaryExp: e[0][1][0]
[DEBUG] visitPrimaryExp: e[0][1][0]
SymbolTable::lookup: found e in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = e, sym->kind = 0
绑定变量: e -> VarDefContext
CheckLValue 绑定变量: e, sym->kind: 0, sym->var_def_ctx: 0x55577d35c470, sym->const_def_ctx: 0
dim_count: 3, subscript_count: 3
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
[DEBUG] CheckExp: 1
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
完全索引,返回元素类型
[DEBUG] visitUnaryExp: d[3][0]
[DEBUG] visitPrimaryExp: d[3][0]
SymbolTable::lookup: found d in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = d, sym->kind = 0
绑定变量: d -> VarDefContext
CheckLValue 绑定变量: d, sym->kind: 0, sym->var_def_ctx: 0x55577d353a40, sym->const_def_ctx: 0
dim_count: 2, subscript_count: 2
[DEBUG] CheckExp: 3
[DEBUG] visitUnaryExp: 3
[DEBUG] visitPrimaryExp: 3
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
完全索引,返回元素类型
[DEBUG] 设置 current_func_has_return_ = true
[DEBUG] 函数 main has_return: 1 return_type_is_void: 0
SymbolTable::lookup: found main in scope level 1, kind=1, const_def_ctx=0
[DEBUG IRGEN] 添加运行时库函数声明
[DEBUG IRGEN] 运行时库函数声明完成
[DEBUG IRGEN] visitCompUnit
[DEBUG IRGEN] visitFuncDef: main
[DEBUG] visitFuncDef: 创建函数 main返回类型: int参数数量: 0
[DEBUG] visitFuncDef: 函数对象地址: 0x55577d3724b0
[DEBUG] visitFuncDef: 函数是声明吗?否
[DEBUG] visitFuncDef: 开始生成函数体
[DEBUG IRGEN] visitBlock: {constinta[4][2]={{1,2},{3,4},{},7};constintN=3;intb[4][2]={};intc[4][2]={1,2,3,4,5,6,7,8};intd[N+1][2]={1,2,{3},{5},a[3][0],8};inte[4][2][1]={{d[2][1],{c[2][1]}},{3,4},{5,6},{7,8}};returne[3][1][0]+e[0][0][0]+e[0][1][0]+d[3][0];}
[DEBUG IRGEN] visitBlockItem: constinta[4][2]={{1,2},{3,4},{},7};
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理常量声明
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG IRGEN] visitAddExp: 1
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x55577d3727f0
[DEBUG IRGEN] visitAddExp: 2
[DEBUG IRGEN] visitMulExp: 2
[DEBUG IRGEN] visitPrimaryExp: 2
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 2 created as 0x55577d372850
[DEBUG IRGEN] visitAddExp: 3
[DEBUG IRGEN] visitMulExp: 3
[DEBUG IRGEN] visitPrimaryExp: 3
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 3 created as 0x55577d372940
[DEBUG IRGEN] visitAddExp: 4
[DEBUG IRGEN] visitMulExp: 4
[DEBUG IRGEN] visitPrimaryExp: 4
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 4 created as 0x55577d3729a0
[DEBUG IRGEN] visitAddExp: 7
[DEBUG IRGEN] visitMulExp: 7
[DEBUG IRGEN] visitPrimaryExp: 7
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 7 created as 0x55577d372a00
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: constintN=3;
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理常量声明
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: intb[4][2]={};
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: b
[DEBUG] visitVarDef: 是否为数组: 是
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 b
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 空初始化列表
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: intc[4][2]={1,2,3,4,5,6,7,8};
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: c
[DEBUG] visitVarDef: 是否为数组: 是
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 c
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 1
[DEBUG IRGEN] visitAddExp: 1
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d3727f0
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 2
[DEBUG IRGEN] visitAddExp: 2
[DEBUG IRGEN] visitMulExp: 2
[DEBUG IRGEN] visitPrimaryExp: 2
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 2 created as 0x55577d372850
[DEBUG] EvalExpr: success, result = 0x55577d372850
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 3
[DEBUG IRGEN] visitAddExp: 3
[DEBUG IRGEN] visitMulExp: 3
[DEBUG IRGEN] visitPrimaryExp: 3
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 3 created as 0x55577d372940
[DEBUG] EvalExpr: success, result = 0x55577d372940
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 4
[DEBUG IRGEN] visitAddExp: 4
[DEBUG IRGEN] visitMulExp: 4
[DEBUG IRGEN] visitPrimaryExp: 4
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 4 created as 0x55577d3729a0
[DEBUG] EvalExpr: success, result = 0x55577d3729a0
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 5
[DEBUG IRGEN] visitAddExp: 5
[DEBUG IRGEN] visitMulExp: 5
[DEBUG IRGEN] visitPrimaryExp: 5
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 5 created as 0x55577d373c20
[DEBUG] EvalExpr: success, result = 0x55577d373c20
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 6
[DEBUG IRGEN] visitAddExp: 6
[DEBUG IRGEN] visitMulExp: 6
[DEBUG IRGEN] visitPrimaryExp: 6
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 6 created as 0x55577d373cd0
[DEBUG] EvalExpr: success, result = 0x55577d373cd0
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 7
[DEBUG IRGEN] visitAddExp: 7
[DEBUG IRGEN] visitMulExp: 7
[DEBUG IRGEN] visitPrimaryExp: 7
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 7 created as 0x55577d372a00
[DEBUG] EvalExpr: success, result = 0x55577d372a00
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 8
[DEBUG IRGEN] visitAddExp: 8
[DEBUG IRGEN] visitMulExp: 8
[DEBUG IRGEN] visitPrimaryExp: 8
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 8 created as 0x55577d373d30
[DEBUG] EvalExpr: success, result = 0x55577d373d30
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 8 个初始化值
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: intd[N+1][2]={1,2,{3},{5},a[3][0],8};
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: d
[DEBUG] visitVarDef: 是否为数组: 是
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 d
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 1
[DEBUG IRGEN] visitAddExp: 1
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d3727f0
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 2
[DEBUG IRGEN] visitAddExp: 2
[DEBUG IRGEN] visitMulExp: 2
[DEBUG IRGEN] visitPrimaryExp: 2
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 2 created as 0x55577d372850
[DEBUG] EvalExpr: success, result = 0x55577d372850
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 3
[DEBUG IRGEN] visitAddExp: 3
[DEBUG IRGEN] visitMulExp: 3
[DEBUG IRGEN] visitPrimaryExp: 3
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 3 created as 0x55577d372940
[DEBUG] EvalExpr: success, result = 0x55577d372940
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 1 个初始化值
[DEBUG] ProcessNestedInitVals: 获取到嵌套值列表, 大小: 1
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 5
[DEBUG IRGEN] visitAddExp: 5
[DEBUG IRGEN] visitMulExp: 5
[DEBUG IRGEN] visitPrimaryExp: 5
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 5 created as 0x55577d373c20
[DEBUG] EvalExpr: success, result = 0x55577d373c20
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 1 个初始化值
[DEBUG] ProcessNestedInitVals: 获取到嵌套值列表, 大小: 1
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: a[3][0]
[DEBUG IRGEN] visitAddExp: a[3][0]
[DEBUG IRGEN] visitMulExp: a[3][0]
[DEBUG IRGEN] visitPrimaryExp: a[3][0]
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: a
[DEBUG IRGEN] EvalExpr: 3
[DEBUG IRGEN] visitAddExp: 3
[DEBUG IRGEN] visitMulExp: 3
[DEBUG IRGEN] visitPrimaryExp: 3
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 3 created as 0x55577d372940
[DEBUG] EvalExpr: success, result = 0x55577d372940
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG] EvalExpr: success, result = 0x55577d374a50
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 8
[DEBUG IRGEN] visitAddExp: 8
[DEBUG IRGEN] visitMulExp: 8
[DEBUG IRGEN] visitPrimaryExp: 8
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 8 created as 0x55577d373d30
[DEBUG] EvalExpr: success, result = 0x55577d373d30
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 6 个初始化值
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: inte[4][2][1]={{d[2][1],{c[2][1]}},{3,4},{5,6},{7,8}};
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: e
[DEBUG] visitVarDef: 是否为数组: 是
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 e
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: d[2][1]
[DEBUG IRGEN] visitAddExp: d[2][1]
[DEBUG IRGEN] visitMulExp: d[2][1]
[DEBUG IRGEN] visitPrimaryExp: d[2][1]
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: d
[DEBUG IRGEN] EvalExpr: 2
[DEBUG IRGEN] visitAddExp: 2
[DEBUG IRGEN] visitMulExp: 2
[DEBUG IRGEN] visitPrimaryExp: 2
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 2 created as 0x55577d372850
[DEBUG] EvalExpr: success, result = 0x55577d372850
[DEBUG IRGEN] EvalExpr: 1
[DEBUG IRGEN] visitAddExp: 1
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d3757d0
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: c[2][1]
[DEBUG IRGEN] visitAddExp: c[2][1]
[DEBUG IRGEN] visitMulExp: c[2][1]
[DEBUG IRGEN] visitPrimaryExp: c[2][1]
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: c
[DEBUG IRGEN] EvalExpr: 2
[DEBUG IRGEN] visitAddExp: 2
[DEBUG IRGEN] visitMulExp: 2
[DEBUG IRGEN] visitPrimaryExp: 2
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 2 created as 0x55577d372850
[DEBUG] EvalExpr: success, result = 0x55577d372850
[DEBUG IRGEN] EvalExpr: 1
[DEBUG IRGEN] visitAddExp: 1
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d375930
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 1 个初始化值
[DEBUG] ProcessNestedInitVals: 获取到嵌套值列表, 大小: 1
[DEBUG] ProcessNestedInitVals: 共获取 2 个初始化值
[DEBUG] ProcessNestedInitVals: 获取到嵌套值列表, 大小: 2
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 3
[DEBUG IRGEN] visitAddExp: 3
[DEBUG IRGEN] visitMulExp: 3
[DEBUG IRGEN] visitPrimaryExp: 3
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 3 created as 0x55577d372940
[DEBUG] EvalExpr: success, result = 0x55577d372940
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 4
[DEBUG IRGEN] visitAddExp: 4
[DEBUG IRGEN] visitMulExp: 4
[DEBUG IRGEN] visitPrimaryExp: 4
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 4 created as 0x55577d3729a0
[DEBUG] EvalExpr: success, result = 0x55577d3729a0
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 2 个初始化值
[DEBUG] ProcessNestedInitVals: 获取到嵌套值列表, 大小: 2
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 5
[DEBUG IRGEN] visitAddExp: 5
[DEBUG IRGEN] visitMulExp: 5
[DEBUG IRGEN] visitPrimaryExp: 5
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 5 created as 0x55577d373c20
[DEBUG] EvalExpr: success, result = 0x55577d373c20
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 6
[DEBUG IRGEN] visitAddExp: 6
[DEBUG IRGEN] visitMulExp: 6
[DEBUG IRGEN] visitPrimaryExp: 6
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 6 created as 0x55577d373cd0
[DEBUG] EvalExpr: success, result = 0x55577d373cd0
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 2 个初始化值
[DEBUG] ProcessNestedInitVals: 获取到嵌套值列表, 大小: 2
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理聚合初始化
[DEBUG] ProcessNestedInitVals: 开始处理嵌套初始化值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 7
[DEBUG IRGEN] visitAddExp: 7
[DEBUG IRGEN] visitMulExp: 7
[DEBUG IRGEN] visitPrimaryExp: 7
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 7 created as 0x55577d372a00
[DEBUG] EvalExpr: success, result = 0x55577d372a00
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] visitInitVal: 开始处理初始化值
[DEBUG] visitInitVal: 处理表达式初始化
[DEBUG IRGEN] EvalExpr: 8
[DEBUG IRGEN] visitAddExp: 8
[DEBUG IRGEN] visitMulExp: 8
[DEBUG IRGEN] visitPrimaryExp: 8
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 8 created as 0x55577d373d30
[DEBUG] EvalExpr: success, result = 0x55577d373d30
[DEBUG] ProcessNestedInitVals: 获取到单个值
[DEBUG] ProcessNestedInitVals: 共获取 2 个初始化值
[DEBUG] ProcessNestedInitVals: 获取到嵌套值列表, 大小: 2
[DEBUG] ProcessNestedInitVals: 共获取 8 个初始化值
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: returne[3][1][0]+e[0][0][0]+e[0][1][0]+d[3][0];
[DEBUG IRGEN] visitStmt: returne[3][1][0]+e[0][0][0]+e[0][1][0]+d[3][0];
[DEBUG IRGEN] HandleReturnStmt: returne[3][1][0]+e[0][0][0]+e[0][1][0]+d[3][0];
[DEBUG IRGEN] EvalExpr: e[3][1][0]+e[0][0][0]+e[0][1][0]+d[3][0]
[DEBUG IRGEN] visitAddExp: e[3][1][0]+e[0][0][0]+e[0][1][0]+d[3][0]
[DEBUG IRGEN] visitAddExp: e[3][1][0]+e[0][0][0]+e[0][1][0]
[DEBUG IRGEN] visitAddExp: e[3][1][0]+e[0][0][0]
[DEBUG IRGEN] visitAddExp: e[3][1][0]
[DEBUG IRGEN] visitMulExp: e[3][1][0]
[DEBUG IRGEN] visitPrimaryExp: e[3][1][0]
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: e
[DEBUG IRGEN] EvalExpr: 3
[DEBUG IRGEN] visitAddExp: 3
[DEBUG IRGEN] visitMulExp: 3
[DEBUG IRGEN] visitPrimaryExp: 3
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 3 created as 0x55577d372940
[DEBUG] EvalExpr: success, result = 0x55577d372940
[DEBUG IRGEN] EvalExpr: 1
[DEBUG IRGEN] visitAddExp: 1
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d3727f0
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG IRGEN] visitMulExp: e[0][0][0]
[DEBUG IRGEN] visitPrimaryExp: e[0][0][0]
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: e
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG] visitAddExp: left=0x55577d376180, type=int, right=0x55577d376590, type=int
[DEBUG IRGEN] visitMulExp: e[0][1][0]
[DEBUG IRGEN] visitPrimaryExp: e[0][1][0]
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: e
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG IRGEN] EvalExpr: 1
[DEBUG IRGEN] visitAddExp: 1
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x55577d3727f0
[DEBUG] EvalExpr: success, result = 0x55577d3727f0
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG] visitAddExp: left=0x55577d376610, type=int, right=0x55577d3767b0, type=int
[DEBUG IRGEN] visitMulExp: d[3][0]
[DEBUG IRGEN] visitPrimaryExp: d[3][0]
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: d
[DEBUG IRGEN] EvalExpr: 3
[DEBUG IRGEN] visitAddExp: 3
[DEBUG IRGEN] visitMulExp: 3
[DEBUG IRGEN] visitPrimaryExp: 3
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 3 created as 0x55577d372940
[DEBUG] EvalExpr: success, result = 0x55577d372940
[DEBUG IRGEN] EvalExpr: 0
[DEBUG IRGEN] visitAddExp: 0
[DEBUG IRGEN] visitMulExp: 0
[DEBUG IRGEN] visitPrimaryExp: 0
[DEBUG] visitPrimaryExp
[DEBUG] EvalExpr: success, result = 0x55577d372b00
[DEBUG] visitAddExp: left=0x55577d376830, type=int, right=0x55577d3769d0, type=int
[DEBUG] EvalExpr: success, result = 0x55577d376a50
[DEBUG] visitFuncDef: 函数 main 生成完成
@a = global array zeroinitializer
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*, i32)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @puts(i32*)
declare void @_sysy_starttime(i32)
declare void @_sysy_stoptime(i32)
declare void @starttime()
declare void @stoptime()
declare i32 @read_map()
declare i32 @float_eq(float, float)
declare i32* @memset(i32*, i32, i32)
define i32 @main() {
entry:
}
========== test/test_case/functional/09_func_defn.sy ==========
SymbolTable::addSymbol: stored getint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored starttime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored stoptime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored func with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored main with kind=1, const_def_ctx=0
[DEBUG] CheckVarDef: a base_type: int is_array: 0 dim_count: 0
SymbolTable::addSymbol: stored a with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: a type_kind: 1 is_array: 0
[DEBUG] 进入函数: func 返回类型: int
SymbolTable::addSymbol: stored p with kind=2, const_def_ctx=0
[DEBUG] 添加参数: p type_kind: 1 is_array: 0 dims:
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found p in scope level 2, kind=2, const_def_ctx=0
CheckLValue: found sym->name = p, sym->kind = 2
CheckLValue 绑定变量: p, sym->kind: 2, sym->var_def_ctx: 0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: p-1
[DEBUG] visitUnaryExp: p
[DEBUG] visitPrimaryExp: p
SymbolTable::lookup: found p in scope level 2, kind=2, const_def_ctx=0
CheckLValue: found sym->name = p, sym->kind = 2
CheckLValue 绑定变量: p, sym->kind: 2, sym->var_def_ctx: 0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] visitStmt: Return ExpStmt
[DEBUG] 检测到 return 语句
[DEBUG] visitReturnStmtInternal 被调用
[DEBUG] 有返回值的 return
[DEBUG] CheckExp: p
[DEBUG] visitUnaryExp: p
[DEBUG] visitPrimaryExp: p
SymbolTable::lookup: found p in scope level 2, kind=2, const_def_ctx=0
CheckLValue: found sym->name = p, sym->kind = 2
CheckLValue 绑定变量: p, sym->kind: 2, sym->var_def_ctx: 0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] 设置 current_func_has_return_ = true
[DEBUG] 函数 func has_return: 1 return_type_is_void: 0
[DEBUG] 进入函数: main 返回类型: int
[DEBUG] CheckVarDef: b base_type: int is_array: 0 dim_count: 0
SymbolTable::addSymbol: stored b with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: b type_kind: 1 is_array: 0
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found a in scope level 1, kind=0, const_def_ctx=0
CheckLValue: found sym->name = a, sym->kind = 0
绑定变量: a -> VarDefContext
CheckLValue 绑定变量: a, sym->kind: 0, sym->var_def_ctx: 0x564eb7094720, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: 10
[DEBUG] visitUnaryExp: 10
[DEBUG] visitPrimaryExp: 10
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found b in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = b, sym->kind = 0
绑定变量: b -> VarDefContext
CheckLValue 绑定变量: b, sym->kind: 0, sym->var_def_ctx: 0x564eb7097180, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: func(a)
[DEBUG] visitUnaryExp: func(a)
[DEBUG] 函数调用: func
[DEBUG] CheckFuncCall: func
SymbolTable::lookup: found func in scope level 1, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: a
[DEBUG] visitUnaryExp: a
[DEBUG] visitPrimaryExp: a
SymbolTable::lookup: found a in scope level 1, kind=0, const_def_ctx=0
CheckLValue: found sym->name = a, sym->kind = 0
绑定变量: a -> VarDefContext
CheckLValue 绑定变量: a, sym->kind: 0, sym->var_def_ctx: 0x564eb7094720, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: Return ExpStmt
[DEBUG] 检测到 return 语句
[DEBUG] visitReturnStmtInternal 被调用
[DEBUG] 有返回值的 return
[DEBUG] CheckExp: b
[DEBUG] visitUnaryExp: b
[DEBUG] visitPrimaryExp: b
SymbolTable::lookup: found b in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = b, sym->kind = 0
绑定变量: b -> VarDefContext
CheckLValue 绑定变量: b, sym->kind: 0, sym->var_def_ctx: 0x564eb7097180, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] 设置 current_func_has_return_ = true
[DEBUG] 函数 main has_return: 1 return_type_is_void: 0
SymbolTable::lookup: found main in scope level 1, kind=1, const_def_ctx=0
[DEBUG IRGEN] 添加运行时库函数声明
[DEBUG IRGEN] 运行时库函数声明完成
[DEBUG IRGEN] visitCompUnit
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: a
[DEBUG] visitVarDef: 是否为数组: 否
[DEBUG] visitVarDef: 处理全局变量
[DEBUG] HandleGlobalVariable: 开始处理全局变量 a
[DEBUG] HandleGlobalVariable: 变量 a 是 int 类型
[DEBUG] HandleGlobalVariable: 创建全局标量变量: a
[DEBUG] visitDecl: 声明处理完成
[DEBUG IRGEN] visitFuncDef: func
[DEBUG] visitFuncDef: 创建函数 func返回类型: int参数数量: 1
[DEBUG] visitFuncDef: 函数对象地址: 0x564eb70aa260
[DEBUG] visitFuncDef: 函数是声明吗?否
[DEBUG] visitFuncDef: 为函数 func 添加参数 p类型: int32
[DEBUG] visitFuncDef: 参数 p 处理完成
[DEBUG] visitFuncDef: 开始生成函数体
[DEBUG IRGEN] visitBlock: {p=p-1;returnp;}
[DEBUG IRGEN] visitBlockItem: p=p-1;
[DEBUG IRGEN] visitStmt: p=p-1;
[DEBUG IRGEN] HandleAssignStmt: p=p-1;
[DEBUG IRGEN] EvalExpr: p-1
[DEBUG IRGEN] visitAddExp: p-1
[DEBUG IRGEN] visitAddExp: p
[DEBUG IRGEN] visitMulExp: p
[DEBUG IRGEN] visitPrimaryExp: p
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: p
[DEBUG IRGEN] visitMulExp: 1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x564eb70aa500
[DEBUG] visitAddExp: left=0x564eb70aa480, type=int, right=0x564eb70aa500, type=int
[DEBUG] EvalExpr: success, result = 0x564eb70aa560
[DEBUG] HandleAssignStmt: assigning to p
[DEBUG] HandleAssignStmt: found in param_map_ for p, ptr = 0x564eb70a8d40
[DEBUG] HandleAssignStmt: lhs_type kind = 1, rhs_type kind = 1
[DEBUG] HandleAssignStmt: scalar assignment to p, ptr = 0x564eb70a8d40, rhs = 0x564eb70aa560
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: returnp;
[DEBUG IRGEN] visitStmt: returnp;
[DEBUG IRGEN] HandleReturnStmt: returnp;
[DEBUG IRGEN] EvalExpr: p
[DEBUG IRGEN] visitAddExp: p
[DEBUG IRGEN] visitMulExp: p
[DEBUG IRGEN] visitPrimaryExp: p
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: p
[DEBUG] EvalExpr: success, result = 0x564eb70aa750
[DEBUG] visitFuncDef: 函数 func 生成完成
[DEBUG IRGEN] visitFuncDef: main
[DEBUG] visitFuncDef: 创建函数 main返回类型: int参数数量: 0
[DEBUG] visitFuncDef: 函数对象地址: 0x564eb70aa890
[DEBUG] visitFuncDef: 函数是声明吗?否
[DEBUG] visitFuncDef: 开始生成函数体
[DEBUG IRGEN] visitBlock: {intb;a=10;b=func(a);returnb;}
[DEBUG IRGEN] visitBlockItem: intb;
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: b
[DEBUG] visitVarDef: 是否为数组: 否
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 b
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: a=10;
[DEBUG IRGEN] visitStmt: a=10;
[DEBUG IRGEN] HandleAssignStmt: a=10;
[DEBUG IRGEN] EvalExpr: 10
[DEBUG IRGEN] visitAddExp: 10
[DEBUG IRGEN] visitMulExp: 10
[DEBUG IRGEN] visitPrimaryExp: 10
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 10 created as 0x564eb70aaba0
[DEBUG] EvalExpr: success, result = 0x564eb70aaba0
[DEBUG] HandleAssignStmt: assigning to a
[DEBUG] HandleAssignStmt: found in global_map_ for a, ptr = 0x564eb70aa150
[DEBUG] HandleAssignStmt: lhs_type kind = 1, rhs_type kind = 1
[DEBUG] HandleAssignStmt: scalar assignment to a, ptr = 0x564eb70aa150, rhs = 0x564eb70aaba0
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: b=func(a);
[DEBUG IRGEN] visitStmt: b=func(a);
[DEBUG IRGEN] HandleAssignStmt: b=func(a);
[DEBUG IRGEN] EvalExpr: func(a)
[DEBUG IRGEN] visitAddExp: func(a)
[DEBUG IRGEN] visitMulExp: func(a)
[DEBUG IRGEN] visitCallExp: 调用函数 func
[DEBUG IRGEN] EvalExpr: a
[DEBUG IRGEN] visitAddExp: a
[DEBUG IRGEN] visitMulExp: a
[DEBUG IRGEN] visitPrimaryExp: a
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: a
[DEBUG] EvalExpr: success, result = 0x564eb70aacc0
[DEBUG IRGEN] visitCallExp: 收集到 1 个参数
[DEBUG IRGEN] visitCallExp: 函数调用完成,返回值 0x564eb70aad80
[DEBUG] EvalExpr: success, result = 0x564eb70aad80
[DEBUG] HandleAssignStmt: assigning to b
[DEBUG] HandleAssignStmt: found in storage_map_ for b, ptr = 0x564eb70aaa00
[DEBUG] HandleAssignStmt: lhs_type kind = 1, rhs_type kind = 1
[DEBUG] HandleAssignStmt: scalar assignment to b, ptr = 0x564eb70aaa00, rhs = 0x564eb70aad80
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: returnb;
[DEBUG IRGEN] visitStmt: returnb;
[DEBUG IRGEN] HandleReturnStmt: returnb;
[DEBUG IRGEN] EvalExpr: b
[DEBUG IRGEN] visitAddExp: b
[DEBUG IRGEN] visitMulExp: b
[DEBUG IRGEN] visitPrimaryExp: b
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: b
[DEBUG] EvalExpr: success, result = 0x564eb70aaf50
[DEBUG] visitFuncDef: 函数 main 生成完成
@a = global i32 0
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*, i32)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @puts(i32*)
declare void @_sysy_starttime(i32)
declare void @_sysy_stoptime(i32)
declare void @starttime()
declare void @stoptime()
declare i32 @read_map()
declare i32 @float_eq(float, float)
declare i32* @memset(i32*, i32, i32)
define i32 @func(i32 %p) {
entry:
}
define i32 @main() {
entry:
}
========== test/test_case/functional/11_add2.sy ==========
SymbolTable::addSymbol: stored getint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored starttime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored stoptime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored main with kind=1, const_def_ctx=0
[DEBUG] 进入函数: main 返回类型: int
[DEBUG] CheckVarDef: a base_type: int is_array: 0 dim_count: 0
SymbolTable::addSymbol: stored a with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: a type_kind: 1 is_array: 0
[DEBUG] CheckVarDef: b base_type: int is_array: 0 dim_count: 0
SymbolTable::addSymbol: stored b with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: b type_kind: 1 is_array: 0
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found a in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = a, sym->kind = 0
绑定变量: a -> VarDefContext
CheckLValue 绑定变量: a, sym->kind: 0, sym->var_def_ctx: 0x560bef937a60, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: 10
[DEBUG] visitUnaryExp: 10
[DEBUG] visitPrimaryExp: 10
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found b in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = b, sym->kind = 0
绑定变量: b -> VarDefContext
CheckLValue 绑定变量: b, sym->kind: 0, sym->var_def_ctx: 0x560bef938230, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: -1
[DEBUG] visitUnaryExp: -1
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] visitStmt: Return ExpStmt
[DEBUG] 检测到 return 语句
[DEBUG] visitReturnStmtInternal 被调用
[DEBUG] 有返回值的 return
[DEBUG] CheckExp: a+b
[DEBUG] visitUnaryExp: a
[DEBUG] visitPrimaryExp: a
SymbolTable::lookup: found a in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = a, sym->kind = 0
绑定变量: a -> VarDefContext
CheckLValue 绑定变量: a, sym->kind: 0, sym->var_def_ctx: 0x560bef937a60, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: b
[DEBUG] visitPrimaryExp: b
SymbolTable::lookup: found b in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = b, sym->kind = 0
绑定变量: b -> VarDefContext
CheckLValue 绑定变量: b, sym->kind: 0, sym->var_def_ctx: 0x560bef938230, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] 设置 current_func_has_return_ = true
[DEBUG] 函数 main has_return: 1 return_type_is_void: 0
SymbolTable::lookup: found main in scope level 1, kind=1, const_def_ctx=0
[DEBUG IRGEN] 添加运行时库函数声明
[DEBUG IRGEN] 运行时库函数声明完成
[DEBUG IRGEN] visitCompUnit
[DEBUG IRGEN] visitFuncDef: main
[DEBUG] visitFuncDef: 创建函数 main返回类型: int参数数量: 0
[DEBUG] visitFuncDef: 函数对象地址: 0x560bef948c70
[DEBUG] visitFuncDef: 函数是声明吗?否
[DEBUG] visitFuncDef: 开始生成函数体
[DEBUG IRGEN] visitBlock: {inta,b;a=10;b=-1;returna+b;}
[DEBUG IRGEN] visitBlockItem: inta,b;
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: a
[DEBUG] visitVarDef: 是否为数组: 否
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 a
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: b
[DEBUG] visitVarDef: 是否为数组: 否
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 b
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: a=10;
[DEBUG IRGEN] visitStmt: a=10;
[DEBUG IRGEN] HandleAssignStmt: a=10;
[DEBUG IRGEN] EvalExpr: 10
[DEBUG IRGEN] visitAddExp: 10
[DEBUG IRGEN] visitMulExp: 10
[DEBUG IRGEN] visitPrimaryExp: 10
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 10 created as 0x560bef946380
[DEBUG] EvalExpr: success, result = 0x560bef946380
[DEBUG] HandleAssignStmt: assigning to a
[DEBUG] HandleAssignStmt: found in storage_map_ for a, ptr = 0x560bef902a30
[DEBUG] HandleAssignStmt: lhs_type kind = 1, rhs_type kind = 1
[DEBUG] HandleAssignStmt: scalar assignment to a, ptr = 0x560bef902a30, rhs = 0x560bef946380
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: b=-1;
[DEBUG IRGEN] visitStmt: b=-1;
[DEBUG IRGEN] HandleAssignStmt: b=-1;
[DEBUG IRGEN] EvalExpr: -1
[DEBUG IRGEN] visitAddExp: -1
[DEBUG IRGEN] visitMulExp: -1
[DEBUG IRGEN] visitPrimaryExp: 1
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 1 created as 0x560bef9451a0
[DEBUG] EvalExpr: success, result = 0x560bef949040
[DEBUG] HandleAssignStmt: assigning to b
[DEBUG] HandleAssignStmt: found in storage_map_ for b, ptr = 0x560bef948db0
[DEBUG] HandleAssignStmt: lhs_type kind = 1, rhs_type kind = 1
[DEBUG] HandleAssignStmt: scalar assignment to b, ptr = 0x560bef948db0, rhs = 0x560bef949040
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: returna+b;
[DEBUG IRGEN] visitStmt: returna+b;
[DEBUG IRGEN] HandleReturnStmt: returna+b;
[DEBUG IRGEN] EvalExpr: a+b
[DEBUG IRGEN] visitAddExp: a+b
[DEBUG IRGEN] visitAddExp: a
[DEBUG IRGEN] visitMulExp: a
[DEBUG IRGEN] visitPrimaryExp: a
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: a
[DEBUG IRGEN] visitMulExp: b
[DEBUG IRGEN] visitPrimaryExp: b
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: b
[DEBUG] visitAddExp: left=0x560bef9491e0, type=int, right=0x560bef9492d0, type=int
[DEBUG] EvalExpr: success, result = 0x560bef9493c0
[DEBUG] visitFuncDef: 函数 main 生成完成
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*, i32)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @puts(i32*)
declare void @_sysy_starttime(i32)
declare void @_sysy_stoptime(i32)
declare void @starttime()
declare void @stoptime()
declare i32 @read_map()
declare i32 @float_eq(float, float)
declare i32* @memset(i32*, i32, i32)
define i32 @main() {
entry:
}
========== test/test_case/functional/13_sub2.sy ==========
SymbolTable::addSymbol: stored getint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored starttime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored stoptime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored main with kind=1, const_def_ctx=0
[DEBUG] CheckConstDef: a base_type: int is_array: 0 dim_count: 0
[DEBUG] visitUnaryExp: 10
[DEBUG] visitPrimaryExp: 10
[DEBUG] 初始化值数量: 1
CheckConstDef: before addSymbol, sym.kind = 3
保存常量定义上下文: a, ctx: 0x55f941fb45d0
SymbolTable::addSymbol: stored a with kind=3, const_def_ctx=0x55f941fb45d0
CheckConstDef: after addSymbol, sym.kind = 3
SymbolTable::lookup: found a in scope level 1, kind=3, const_def_ctx=0x55f941fb45d0
CheckConstDef: after addSymbol, stored const_def_ctx = 0x55f941fb45d0
[DEBUG] 常量符号添加完成
[DEBUG] 进入函数: main 返回类型: int
[DEBUG] CheckVarDef: b base_type: int is_array: 0 dim_count: 0
SymbolTable::addSymbol: stored b with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: b type_kind: 1 is_array: 0
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found b in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = b, sym->kind = 0
绑定变量: b -> VarDefContext
CheckLValue 绑定变量: b, sym->kind: 0, sym->var_def_ctx: 0x55f941fbb9e0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: 2
[DEBUG] visitUnaryExp: 2
[DEBUG] visitPrimaryExp: 2
[DEBUG] visitStmt: Return ExpStmt
[DEBUG] 检测到 return 语句
[DEBUG] visitReturnStmtInternal 被调用
[DEBUG] 有返回值的 return
[DEBUG] CheckExp: b-a
[DEBUG] visitUnaryExp: b
[DEBUG] visitPrimaryExp: b
SymbolTable::lookup: found b in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = b, sym->kind = 0
绑定变量: b -> VarDefContext
CheckLValue 绑定变量: b, sym->kind: 0, sym->var_def_ctx: 0x55f941fbb9e0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: a
[DEBUG] visitPrimaryExp: a
SymbolTable::lookup: found a in scope level 1, kind=3, const_def_ctx=0x55f941fb45d0
CheckLValue: found sym->name = a, sym->kind = 3
绑定常量: a -> ConstDefContext
CheckLValue 绑定变量: a, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x55f941fb45d0
dim_count: 0, subscript_count: 0
[DEBUG] 设置 current_func_has_return_ = true
[DEBUG] 函数 main has_return: 1 return_type_is_void: 0
SymbolTable::lookup: found main in scope level 1, kind=1, const_def_ctx=0
[DEBUG IRGEN] 添加运行时库函数声明
[DEBUG IRGEN] 运行时库函数声明完成
[DEBUG IRGEN] visitCompUnit
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理常量声明
[DEBUG] TryEvaluateConstInt: 开始求值常量表达式
[DEBUG] visitDecl: 声明处理完成
[DEBUG IRGEN] visitFuncDef: main
[DEBUG] visitFuncDef: 创建函数 main返回类型: int参数数量: 0
[DEBUG] visitFuncDef: 函数对象地址: 0x55f941fc8b30
[DEBUG] visitFuncDef: 函数是声明吗?否
[DEBUG] visitFuncDef: 开始生成函数体
[DEBUG IRGEN] visitBlock: {intb;b=2;returnb-a;}
[DEBUG IRGEN] visitBlockItem: intb;
[DEBUG] visitDecl: 开始处理声明
[DEBUG] visitDecl: 处理变量声明
[DEBUG] visitVarDef: 开始处理变量定义
[DEBUG] visitVarDef: 变量名称: b
[DEBUG] visitVarDef: 是否为数组: 否
[DEBUG] visitVarDef: 处理局部变量
[DEBUG] HandleLocalVariable: 开始处理局部变量 b
[DEBUG] visitDecl: 声明处理完成
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: b=2;
[DEBUG IRGEN] visitStmt: b=2;
[DEBUG IRGEN] HandleAssignStmt: b=2;
[DEBUG IRGEN] EvalExpr: 2
[DEBUG IRGEN] visitAddExp: 2
[DEBUG IRGEN] visitMulExp: 2
[DEBUG IRGEN] visitPrimaryExp: 2
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: constant int 2 created as 0x55f941fc8c90
[DEBUG] EvalExpr: success, result = 0x55f941fc8c90
[DEBUG] HandleAssignStmt: assigning to b
[DEBUG] HandleAssignStmt: found in storage_map_ for b, ptr = 0x55f941f81be0
[DEBUG] HandleAssignStmt: lhs_type kind = 1, rhs_type kind = 1
[DEBUG] HandleAssignStmt: scalar assignment to b, ptr = 0x55f941f81be0, rhs = 0x55f941fc8c90
[DEBUG] current insert block: entry
[DEBUG IRGEN] visitBlockItem: returnb-a;
[DEBUG IRGEN] visitStmt: returnb-a;
[DEBUG IRGEN] HandleReturnStmt: returnb-a;
[DEBUG IRGEN] EvalExpr: b-a
[DEBUG IRGEN] visitAddExp: b-a
[DEBUG IRGEN] visitAddExp: b
[DEBUG IRGEN] visitMulExp: b
[DEBUG IRGEN] visitPrimaryExp: b
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: b
[DEBUG IRGEN] visitMulExp: a
[DEBUG IRGEN] visitPrimaryExp: a
[DEBUG] visitPrimaryExp
[DEBUG] visitPrimaryExp: visiting lVal
[DEBUG] visitLVal: a
[DEBUG] visitLVal: constant a
[DEBUG] visitAddExp: left=0x55f941fc8df0, type=int, right=0x55f941fc1ed0, type=int
[DEBUG] EvalExpr: success, result = 0x55f941fc8ee0
[DEBUG] visitFuncDef: 函数 main 生成完成
declare i32 @getint()
declare i32 @getch()
declare i32 @getarray(i32*, i32)
declare void @putint(i32)
declare void @putch(i32)
declare void @putarray(i32, i32*)
declare void @puts(i32*)
declare void @_sysy_starttime(i32)
declare void @_sysy_stoptime(i32)
declare void @starttime()
declare void @stoptime()
declare i32 @read_map()
declare i32 @float_eq(float, float)
declare i32* @memset(i32*, i32, i32)
define i32 @main() {
entry:
}
========== test/test_case/functional/15_graph_coloring.sy ==========
SymbolTable::addSymbol: stored getint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putint with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfloat with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putch with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored starttime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored stoptime with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored getfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored putfarray with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored printSolution with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored printMessage with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored isSafe with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored graphColoring with kind=1, const_def_ctx=0
SymbolTable::addSymbol: stored main with kind=1, const_def_ctx=0
[DEBUG] CheckConstDef: V base_type: int is_array: 0 dim_count: 0
[DEBUG] visitUnaryExp: 4
[DEBUG] visitPrimaryExp: 4
[DEBUG] 初始化值数量: 1
CheckConstDef: before addSymbol, sym.kind = 3
保存常量定义上下文: V, ctx: 0x56010d14b130
SymbolTable::addSymbol: stored V with kind=3, const_def_ctx=0x56010d14b130
CheckConstDef: after addSymbol, sym.kind = 3
SymbolTable::lookup: found V in scope level 1, kind=3, const_def_ctx=0x56010d14b130
CheckConstDef: after addSymbol, stored const_def_ctx = 0x56010d14b130
[DEBUG] 常量符号添加完成
[DEBUG] CheckConstDef: space base_type: int is_array: 0 dim_count: 0
[DEBUG] visitUnaryExp: 32
[DEBUG] visitPrimaryExp: 32
[DEBUG] 初始化值数量: 1
CheckConstDef: before addSymbol, sym.kind = 3
保存常量定义上下文: space, ctx: 0x56010d151e00
SymbolTable::addSymbol: stored space with kind=3, const_def_ctx=0x56010d151e00
CheckConstDef: after addSymbol, sym.kind = 3
SymbolTable::lookup: found space in scope level 1, kind=3, const_def_ctx=0x56010d151e00
CheckConstDef: after addSymbol, stored const_def_ctx = 0x56010d151e00
[DEBUG] 常量符号添加完成
[DEBUG] CheckConstDef: LF base_type: int is_array: 0 dim_count: 0
[DEBUG] visitUnaryExp: 10
[DEBUG] visitPrimaryExp: 10
[DEBUG] 初始化值数量: 1
CheckConstDef: before addSymbol, sym.kind = 3
保存常量定义上下文: LF, ctx: 0x56010d151f80
SymbolTable::addSymbol: stored LF with kind=3, const_def_ctx=0x56010d151f80
CheckConstDef: after addSymbol, sym.kind = 3
SymbolTable::lookup: found LF in scope level 1, kind=3, const_def_ctx=0x56010d151f80
CheckConstDef: after addSymbol, stored const_def_ctx = 0x56010d151f80
[DEBUG] 常量符号添加完成
[DEBUG] 进入函数: printSolution 返回类型: void
SymbolTable::addSymbol: stored color with kind=2, const_def_ctx=0
[DEBUG] 添加参数: color type_kind: 3 is_array: 1 dims: 0
[DEBUG] CheckVarDef: i base_type: int is_array: 0 dim_count: 0
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
SymbolTable::addSymbol: stored i with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: i type_kind: 1 is_array: 0
[DEBUG] visitStmt: While
[DEBUG] visitUnaryExp: i
[DEBUG] visitPrimaryExp: i
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d14bba0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: V
[DEBUG] visitPrimaryExp: V
SymbolTable::lookup: found V in scope level 1, kind=3, const_def_ctx=0x56010d14b130
CheckLValue: found sym->name = V, sym->kind = 3
绑定常量: V -> ConstDefContext
CheckLValue 绑定变量: V, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x56010d14b130
dim_count: 0, subscript_count: 0
[DEBUG] visitStmt: Block
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putint(color[i])
[DEBUG] visitUnaryExp: putint(color[i])
[DEBUG] 函数调用: putint
[DEBUG] CheckFuncCall: putint
SymbolTable::lookup: found putint in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: color[i]
[DEBUG] visitUnaryExp: color[i]
[DEBUG] visitPrimaryExp: color[i]
SymbolTable::lookup: found color in scope level 2, kind=2, const_def_ctx=0
CheckLValue: found sym->name = color, sym->kind = 2
CheckLValue 绑定变量: color, sym->kind: 2, sym->var_def_ctx: 0, sym->const_def_ctx: 0
数组参数维度: 1 维, dims: 0
dim_count: 1, subscript_count: 1
[DEBUG] CheckExp: i
[DEBUG] visitUnaryExp: i
[DEBUG] visitPrimaryExp: i
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d14bba0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
完全索引,返回元素类型
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(space)
[DEBUG] visitUnaryExp: putch(space)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: space
[DEBUG] visitUnaryExp: space
[DEBUG] visitPrimaryExp: space
SymbolTable::lookup: found space in scope level 1, kind=3, const_def_ctx=0x56010d151e00
CheckLValue: found sym->name = space, sym->kind = 3
绑定常量: space -> ConstDefContext
CheckLValue 绑定变量: space, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x56010d151e00
dim_count: 0, subscript_count: 0
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d14bba0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: i+1
[DEBUG] visitUnaryExp: i
[DEBUG] visitPrimaryExp: i
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d14bba0, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(LF)
[DEBUG] visitUnaryExp: putch(LF)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: LF
[DEBUG] visitUnaryExp: LF
[DEBUG] visitPrimaryExp: LF
SymbolTable::lookup: found LF in scope level 1, kind=3, const_def_ctx=0x56010d151f80
CheckLValue: found sym->name = LF, sym->kind = 3
绑定常量: LF -> ConstDefContext
CheckLValue 绑定变量: LF, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x56010d151f80
dim_count: 0, subscript_count: 0
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] 函数 printSolution has_return: 0 return_type_is_void: 1
[DEBUG] 进入函数: printMessage 返回类型: void
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(78)
[DEBUG] visitUnaryExp: putch(78)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 78
[DEBUG] visitUnaryExp: 78
[DEBUG] visitPrimaryExp: 78
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(111)
[DEBUG] visitUnaryExp: putch(111)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 111
[DEBUG] visitUnaryExp: 111
[DEBUG] visitPrimaryExp: 111
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(116)
[DEBUG] visitUnaryExp: putch(116)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 116
[DEBUG] visitUnaryExp: 116
[DEBUG] visitPrimaryExp: 116
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(space)
[DEBUG] visitUnaryExp: putch(space)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: space
[DEBUG] visitUnaryExp: space
[DEBUG] visitPrimaryExp: space
SymbolTable::lookup: found space in scope level 1, kind=3, const_def_ctx=0x56010d151e00
CheckLValue: found sym->name = space, sym->kind = 3
绑定常量: space -> ConstDefContext
CheckLValue 绑定变量: space, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x56010d151e00
dim_count: 0, subscript_count: 0
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(101)
[DEBUG] visitUnaryExp: putch(101)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 101
[DEBUG] visitUnaryExp: 101
[DEBUG] visitPrimaryExp: 101
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(120)
[DEBUG] visitUnaryExp: putch(120)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 120
[DEBUG] visitUnaryExp: 120
[DEBUG] visitPrimaryExp: 120
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(105)
[DEBUG] visitUnaryExp: putch(105)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 105
[DEBUG] visitUnaryExp: 105
[DEBUG] visitPrimaryExp: 105
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(115)
[DEBUG] visitUnaryExp: putch(115)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 115
[DEBUG] visitUnaryExp: 115
[DEBUG] visitPrimaryExp: 115
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] visitStmt: ExpStmt
[DEBUG] CheckExp: putch(116)
[DEBUG] visitUnaryExp: putch(116)
[DEBUG] 函数调用: putch
[DEBUG] CheckFuncCall: putch
SymbolTable::lookup: found putch in scope level 0, kind=1, const_def_ctx=0
[DEBUG] 处理函数调用参数:
[DEBUG] CheckExp: 116
[DEBUG] visitUnaryExp: 116
[DEBUG] visitPrimaryExp: 116
[DEBUG] 检查参数 0: 实参类型 1 形参类型 1
[DEBUG] 函数 printMessage has_return: 0 return_type_is_void: 1
[DEBUG] 进入函数: isSafe 返回类型: int
SymbolTable::lookup: found V in scope level 1, kind=3, const_def_ctx=0x56010d14b130
SymbolTable::addSymbol: stored graph with kind=2, const_def_ctx=0
[DEBUG] 添加参数: graph type_kind: 3 is_array: 1 dims: 0 4
SymbolTable::addSymbol: stored color with kind=2, const_def_ctx=0
[DEBUG] 添加参数: color type_kind: 3 is_array: 1 dims: 0
[DEBUG] CheckVarDef: i base_type: int is_array: 0 dim_count: 0
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
SymbolTable::addSymbol: stored i with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: i type_kind: 1 is_array: 0
[DEBUG] visitStmt: While
[DEBUG] visitUnaryExp: i
[DEBUG] visitPrimaryExp: i
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d174310, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: V
[DEBUG] visitPrimaryExp: V
SymbolTable::lookup: found V in scope level 1, kind=3, const_def_ctx=0x56010d14b130
CheckLValue: found sym->name = V, sym->kind = 3
绑定常量: V -> ConstDefContext
CheckLValue 绑定变量: V, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x56010d14b130
dim_count: 0, subscript_count: 0
[DEBUG] visitStmt: Block
[DEBUG] CheckVarDef: j base_type: int is_array: 0 dim_count: 0
[DEBUG] CheckExp: i+1
[DEBUG] visitUnaryExp: i
[DEBUG] visitPrimaryExp: i
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d174310, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
SymbolTable::addSymbol: stored j with kind=0, const_def_ctx=0
[DEBUG] 符号添加完成: j type_kind: 1 is_array: 0
[DEBUG] visitStmt: While
[DEBUG] visitUnaryExp: j
[DEBUG] visitPrimaryExp: j
SymbolTable::lookup: found j in scope level 4, kind=0, const_def_ctx=0
CheckLValue: found sym->name = j, sym->kind = 0
绑定变量: j -> VarDefContext
CheckLValue 绑定变量: j, sym->kind: 0, sym->var_def_ctx: 0x56010d175d40, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: V
[DEBUG] visitPrimaryExp: V
SymbolTable::lookup: found V in scope level 1, kind=3, const_def_ctx=0x56010d14b130
CheckLValue: found sym->name = V, sym->kind = 3
绑定常量: V -> ConstDefContext
CheckLValue 绑定变量: V, sym->kind: 3, sym->var_def_ctx: 0, sym->const_def_ctx: 0x56010d14b130
dim_count: 0, subscript_count: 0
[DEBUG] visitStmt: Block
[DEBUG] visitStmt: If
[DEBUG] visitUnaryExp: graph[i][j]
[DEBUG] visitPrimaryExp: graph[i][j]
SymbolTable::lookup: found graph in scope level 2, kind=2, const_def_ctx=0
CheckLValue: found sym->name = graph, sym->kind = 2
CheckLValue 绑定变量: graph, sym->kind: 2, sym->var_def_ctx: 0, sym->const_def_ctx: 0
数组参数维度: 2 维, dims: 0 4
dim_count: 2, subscript_count: 2
[DEBUG] CheckExp: i
[DEBUG] visitUnaryExp: i
[DEBUG] visitPrimaryExp: i
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d174310, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: j
[DEBUG] visitUnaryExp: j
[DEBUG] visitPrimaryExp: j
SymbolTable::lookup: found j in scope level 4, kind=0, const_def_ctx=0
CheckLValue: found sym->name = j, sym->kind = 0
绑定变量: j -> VarDefContext
CheckLValue 绑定变量: j, sym->kind: 0, sym->var_def_ctx: 0x56010d175d40, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
完全索引,返回元素类型
[DEBUG] visitUnaryExp: color[j]
[DEBUG] visitPrimaryExp: color[j]
SymbolTable::lookup: found color in scope level 2, kind=2, const_def_ctx=0
CheckLValue: found sym->name = color, sym->kind = 2
CheckLValue 绑定变量: color, sym->kind: 2, sym->var_def_ctx: 0, sym->const_def_ctx: 0
数组参数维度: 1 维, dims: 0
dim_count: 1, subscript_count: 1
[DEBUG] CheckExp: j
[DEBUG] visitUnaryExp: j
[DEBUG] visitPrimaryExp: j
SymbolTable::lookup: found j in scope level 4, kind=0, const_def_ctx=0
CheckLValue: found sym->name = j, sym->kind = 0
绑定变量: j -> VarDefContext
CheckLValue 绑定变量: j, sym->kind: 0, sym->var_def_ctx: 0x56010d175d40, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
完全索引,返回元素类型
[DEBUG] visitUnaryExp: color[i]
[DEBUG] visitPrimaryExp: color[i]
SymbolTable::lookup: found color in scope level 2, kind=2, const_def_ctx=0
CheckLValue: found sym->name = color, sym->kind = 2
CheckLValue 绑定变量: color, sym->kind: 2, sym->var_def_ctx: 0, sym->const_def_ctx: 0
数组参数维度: 1 维, dims: 0
dim_count: 1, subscript_count: 1
[DEBUG] CheckExp: i
[DEBUG] visitUnaryExp: i
[DEBUG] visitPrimaryExp: i
SymbolTable::lookup: found i in scope level 3, kind=0, const_def_ctx=0
CheckLValue: found sym->name = i, sym->kind = 0
绑定变量: i -> VarDefContext
CheckLValue 绑定变量: i, sym->kind: 0, sym->var_def_ctx: 0x56010d174310, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
完全索引,返回元素类型
[DEBUG] visitStmt: Return ExpStmt
[DEBUG] 检测到 return 语句
[DEBUG] visitReturnStmtInternal 被调用
[DEBUG] 有返回值的 return
[DEBUG] CheckExp: 0
[DEBUG] visitUnaryExp: 0
[DEBUG] visitPrimaryExp: 0
[DEBUG] 设置 current_func_has_return_ = true
[DEBUG] visitStmt: Assign ExpStmt
SymbolTable::lookup: found j in scope level 4, kind=0, const_def_ctx=0
CheckLValue: found sym->name = j, sym->kind = 0
绑定变量: j -> VarDefContext
CheckLValue 绑定变量: j, sym->kind: 0, sym->var_def_ctx: 0x56010d175d40, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] CheckExp: j+1
[DEBUG] visitUnaryExp: j
[DEBUG] visitPrimaryExp: j
SymbolTable::lookup: found j in scope level 4, kind=0, const_def_ctx=0
CheckLValue: found sym->name = j, sym->kind = 0
绑定变量: j -> VarDefContext
CheckLValue 绑定变量: j, sym->kind: 0, sym->var_def_ctx: 0x56010d175d40, sym->const_def_ctx: 0
dim_count: 0, subscript_count: 0
[DEBUG] visitUnaryExp: 1
[DEBUG] visitPrimaryExp: 1
[DEBUG] visitStmt: Assign ExpStmt