mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-23 06:05:00 -07:00
Update Tilde to get basic "Hello World" working with runtime.print_string
This commit is contained in:
Binary file not shown.
+10
-4
@@ -303,12 +303,15 @@ gb_internal cgValue cg_build_builtin(cgProcedure *p, BuiltinProcId id, Ast *expr
|
||||
case BuiltinProc_min:
|
||||
if (ce->args.count == 2) {
|
||||
Type *t = type_of_expr(expr);
|
||||
return cg_builtin_min(p, t, cg_build_expr(p, ce->args[0]), cg_build_expr(p, ce->args[1]));
|
||||
cgValue x = cg_build_expr(p, ce->args[0]);
|
||||
cgValue y = cg_build_expr(p, ce->args[1]);
|
||||
return cg_builtin_min(p, t, x, y);
|
||||
} else {
|
||||
Type *t = type_of_expr(expr);
|
||||
cgValue x = cg_build_expr(p, ce->args[0]);
|
||||
for (isize i = 1; i < ce->args.count; i++) {
|
||||
x = cg_builtin_min(p, t, x, cg_build_expr(p, ce->args[i]));
|
||||
cgValue y = cg_build_expr(p, ce->args[i]);
|
||||
x = cg_builtin_min(p, t, x, y);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
@@ -316,12 +319,15 @@ gb_internal cgValue cg_build_builtin(cgProcedure *p, BuiltinProcId id, Ast *expr
|
||||
case BuiltinProc_max:
|
||||
if (ce->args.count == 2) {
|
||||
Type *t = type_of_expr(expr);
|
||||
return cg_builtin_max(p, t, cg_build_expr(p, ce->args[0]), cg_build_expr(p, ce->args[1]));
|
||||
cgValue x = cg_build_expr(p, ce->args[0]);
|
||||
cgValue y = cg_build_expr(p, ce->args[1]);
|
||||
return cg_builtin_max(p, t, x, y);
|
||||
} else {
|
||||
Type *t = type_of_expr(expr);
|
||||
cgValue x = cg_build_expr(p, ce->args[0]);
|
||||
for (isize i = 1; i < ce->args.count; i++) {
|
||||
x = cg_builtin_max(p, t, x, cg_build_expr(p, ce->args[i]));
|
||||
cgValue y = cg_build_expr(p, ce->args[i]);
|
||||
x = cg_builtin_max(p, t, x, y);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
+3
-3
@@ -334,8 +334,8 @@ gb_internal void cg_procedure_end(cgProcedure *p) {
|
||||
}
|
||||
bool emit_asm = false;
|
||||
|
||||
if (string_starts_with(p->name, str_lit("bug@"))) {
|
||||
emit_asm = true;
|
||||
if (string_starts_with(p->name, str_lit("runtime@_os_write"))) {
|
||||
// emit_asm = true;
|
||||
}
|
||||
|
||||
TB_FunctionOutput *output = tb_module_compile_function(p->module->mod, p->func, TB_ISEL_FAST, emit_asm);
|
||||
@@ -358,7 +358,7 @@ gb_internal void cg_procedure_generate(cgProcedure *p) {
|
||||
cg_procedure_end(p);
|
||||
|
||||
if (
|
||||
// string_starts_with(p->name, str_lit("bug@")) ||
|
||||
string_starts_with(p->name, str_lit("runtime@_os_write")) ||
|
||||
false
|
||||
) { // IR Printing
|
||||
TB_Arena *arena = tb_default_arena();
|
||||
|
||||
Reference in New Issue
Block a user