@@ -18,33 +18,31 @@ def get_operand_value(func, operand, builder, local_sym_tab):
1818 base_type , depth = get_base_type_and_depth (var_type )
1919 logger .info (f"var is { var } , base_type is { base_type } , depth is { depth } " )
2020 val = deref_to_depth (func , builder , var , depth )
21- return val , [ val ], var
21+ return val
2222 raise ValueError (f"Undefined variable: { operand .id } " )
2323 elif isinstance (operand , ast .Constant ):
2424 if isinstance (operand .value , int ):
2525 cst = ir .Constant (ir .IntType (64 ), int (operand .value ))
26- return cst , [ cst ], None
26+ return cst
2727 raise TypeError (f"Unsupported constant type: { type (operand .value )} " )
2828 elif isinstance (operand , ast .BinOp ):
2929 res = handle_binary_op_impl (func , operand , builder , local_sym_tab )
30- return res , [ res ], None
30+ return res
3131 elif isinstance (operand , ast .Call ):
3232 res = eval_expr (func , None , builder , operand , local_sym_tab , {}, {})
3333 if res is None :
3434 raise ValueError (f"Failed to evaluate call expression: { operand } " )
35- val , val_type = res
36- return val , [ val ], None
35+ val , _ = res
36+ return val
3737 raise TypeError (f"Unsupported operand type: { type (operand )} " )
3838
3939
4040def handle_binary_op_impl (func , rval , builder , local_sym_tab ):
4141 op = rval .op
42- left , lchain , _ = get_operand_value (func , rval .left , builder , local_sym_tab )
43- right , rchain , _ = get_operand_value (func , rval .right , builder , local_sym_tab )
42+ left = get_operand_value (func , rval .left , builder , local_sym_tab )
43+ right = get_operand_value (func , rval .right , builder , local_sym_tab )
4444 logger .info (f"left is { left } , right is { right } , op is { op } " )
4545
46- logger .info (f"left chain: { lchain } , right chain: { rchain } " )
47-
4846 # NOTE: Before doing the operation, if the operands are integers
4947 # we always extend them to i64. The assignment to LHS will take
5048 # care of truncation if needed.
0 commit comments