diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-17 12:01:53 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-17 12:01:53 +0100 |
| commit | 2deb2f8eebc42dd52ef8b78811c59e1b07f54f21 (patch) | |
| tree | 6450f88b93b155bd1db798ee11f8ac03e7cc1f84 /src/ir.cpp | |
| parent | 3fa398ec43ddc6fc40562087fd8ab87dc5292499 (diff) | |
Declaration grouping uses () rather than {}; Fix some problem with compilation on *nix
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 75f9b8153..c585c99df 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -2144,9 +2144,9 @@ irValue *ir_emit_arith(irProcedure *proc, TokenKind op, irValue *left, irValue * bool is_unsigned = is_type_unsigned(type); char *name = NULL; if (op == Token_Quo) { - name = is_unsigned ? "__udivti3" : "__divti3"; + name = cast(char *)(is_unsigned ? "__udivti3" : "__divti3"); } else if (op == Token_Mod) { - name = is_unsigned ? "__umodti3" : "__modti3"; + name = cast(char *)(is_unsigned ? "__umodti3" : "__modti3"); } if (name != NULL) { irValue **args = gb_alloc_array(proc->module->allocator, irValue *, 2); @@ -3698,7 +3698,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv case BuiltinProc_new: { ir_emit_comment(proc, str_lit("new")); - // new :: proc(Type) -> ^Type + // proc new(Type) -> ^Type gbAllocator a = proc->module->allocator; Type *type = type_of_expr(proc->module->info, ce->args[0]); @@ -3720,7 +3720,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv irValue **args = gb_alloc_array(a, irValue *, 2); args[0] = ir_const_int(a, size); args[1] = ir_const_int(a, align); - irValue *call = ir_emit_global_call(proc, "alloc_align", args, 2); + irValue *call = ir_emit_global_call(proc, "alloc", args, 2); irValue *v = ir_emit_conv(proc, call, ptr_type); if (type != allocation_type) { Type *u = base_type(allocation_type); @@ -3758,7 +3758,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv irValue **args = gb_alloc_array(a, irValue *, 2); args[0] = slice_size; args[1] = elem_align; - irValue *call = ir_emit_global_call(proc, "alloc_align", args, 2); + irValue *call = ir_emit_global_call(proc, "alloc", args, 2); irValue *ptr = ir_emit_conv(proc, call, elem_ptr_type); irValue *slice = ir_add_local_generated(proc, type); @@ -4128,7 +4128,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv case BuiltinProc_copy: { ir_emit_comment(proc, str_lit("copy")); - // copy :: proc(dst, src: []Type) -> int + // proc copy(dst, src: []Type) -> int AstNode *dst_node = ce->args[0]; AstNode *src_node = ce->args[1]; irValue *dst_slice = ir_build_expr(proc, dst_node); @@ -7321,7 +7321,7 @@ void ir_gen_tree(irGen *s) { #if defined(GB_SYSTEM_WINDOWS) if (build_context.is_dll && !has_dll_main) { - // DllMain :: proc(inst: rawptr, reason: u32, reserved: rawptr) -> i32 + // proc DllMain(inst: rawptr, reason: u32, reserved: rawptr) -> i32 String name = str_lit("DllMain"); Type *proc_params = make_type_tuple(a); Type *proc_results = make_type_tuple(a); @@ -7389,7 +7389,7 @@ void ir_gen_tree(irGen *s) { #endif #if 0 && defined(GB_SYSTEM_WINDOWS) if (!m->build_context->is_dll && !has_win_main) { - // WinMain :: proc(inst, prev: rawptr, cmd_line: ^byte, cmd_show: i32) -> i32 + // proc WinMain(inst, prev: rawptr, cmd_line: ^byte, cmd_show: i32) -> i32 String name = str_lit("WinMain"); Type *proc_params = make_type_tuple(a); Type *proc_results = make_type_tuple(a); |