mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 05:08:14 +00:00
Update TB
This commit is contained in:
+3
-2
@@ -33,8 +33,9 @@
|
|||||||
|
|
||||||
// These are flags
|
// These are flags
|
||||||
typedef enum TB_ArithmeticBehavior {
|
typedef enum TB_ArithmeticBehavior {
|
||||||
TB_ARITHMATIC_NSW = 1,
|
TB_ARITHMATIC_NONE = 0,
|
||||||
TB_ARITHMATIC_NUW = 2,
|
TB_ARITHMATIC_NSW = 1,
|
||||||
|
TB_ARITHMATIC_NUW = 2,
|
||||||
} TB_ArithmeticBehavior;
|
} TB_ArithmeticBehavior;
|
||||||
|
|
||||||
typedef enum TB_DebugFormat {
|
typedef enum TB_DebugFormat {
|
||||||
|
|||||||
Binary file not shown.
+4
-3
@@ -1185,7 +1185,7 @@ handle_op:;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TB_ArithmeticBehavior arith_behavior = cast(TB_ArithmeticBehavior)50;
|
TB_ArithmeticBehavior arith_behavior = cast(TB_ArithmeticBehavior)0;
|
||||||
|
|
||||||
Type *integral_type = type;
|
Type *integral_type = type;
|
||||||
if (is_type_simd_vector(integral_type)) {
|
if (is_type_simd_vector(integral_type)) {
|
||||||
@@ -2065,13 +2065,13 @@ gb_internal cgValue cg_build_expr_internal(cgProcedure *p, Ast *expr) {
|
|||||||
|
|
||||||
Type *type = default_type(type_of_expr(expr));
|
Type *type = default_type(type_of_expr(expr));
|
||||||
|
|
||||||
incoming_values[0] = cg_emit_conv(p, cg_build_expr(p, te->x), type);
|
incoming_values [0] = cg_emit_conv(p, cg_build_expr(p, te->x), type);
|
||||||
incoming_regions[0] = tb_inst_get_control(p->func);
|
incoming_regions[0] = tb_inst_get_control(p->func);
|
||||||
|
|
||||||
tb_inst_goto(p->func, done);
|
tb_inst_goto(p->func, done);
|
||||||
tb_inst_set_control(p->func, else_);
|
tb_inst_set_control(p->func, else_);
|
||||||
|
|
||||||
incoming_values[1] = cg_emit_conv(p, cg_build_expr(p, te->y), type);
|
incoming_values [1] = cg_emit_conv(p, cg_build_expr(p, te->y), type);
|
||||||
incoming_regions[1] = tb_inst_get_control(p->func);
|
incoming_regions[1] = tb_inst_get_control(p->func);
|
||||||
|
|
||||||
tb_inst_goto(p->func, done);
|
tb_inst_goto(p->func, done);
|
||||||
@@ -2080,6 +2080,7 @@ gb_internal cgValue cg_build_expr_internal(cgProcedure *p, Ast *expr) {
|
|||||||
GB_ASSERT(incoming_values[0].kind == cgValue_Value ||
|
GB_ASSERT(incoming_values[0].kind == cgValue_Value ||
|
||||||
incoming_values[0].kind == cgValue_Addr);
|
incoming_values[0].kind == cgValue_Addr);
|
||||||
GB_ASSERT(incoming_values[0].kind == incoming_values[1].kind);
|
GB_ASSERT(incoming_values[0].kind == incoming_values[1].kind);
|
||||||
|
|
||||||
cgValue res = {};
|
cgValue res = {};
|
||||||
res.kind = incoming_values[0].kind;
|
res.kind = incoming_values[0].kind;
|
||||||
res.type = type;
|
res.type = type;
|
||||||
|
|||||||
+6
-6
@@ -244,13 +244,13 @@ gb_internal void cg_procedure_end(cgProcedure *p) {
|
|||||||
}
|
}
|
||||||
// if (p->name == "main") {
|
// if (p->name == "main") {
|
||||||
if (p->name == "bug.main") {
|
if (p->name == "bug.main") {
|
||||||
// TB_Arena *arena = tb_default_arena();
|
TB_Arena *arena = tb_default_arena();
|
||||||
// defer (arena->free(arena));
|
defer (arena->free(arena));
|
||||||
// TB_FuncOpt *opt = tb_funcopt_enter(p->func, arena);
|
TB_FuncOpt *opt = tb_funcopt_enter(p->func, arena);
|
||||||
// defer (tb_funcopt_exit(opt));
|
defer (tb_funcopt_exit(opt));
|
||||||
// tb_funcopt_print(opt);
|
tb_funcopt_print(opt);
|
||||||
|
|
||||||
tb_function_print(p->func, tb_default_print_callback, stdout);
|
// tb_function_print(p->func, tb_default_print_callback, stdout);
|
||||||
}
|
}
|
||||||
tb_module_compile_function(p->module->mod, p->func, TB_ISEL_FAST);
|
tb_module_compile_function(p->module->mod, p->func, TB_ISEL_FAST);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user