From 8ecfca0c9b4d8a8f7c553f99b0bf10142eea88e6 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Wed, 23 Nov 2016 10:36:48 +0000 Subject: Remove templated Map; replace with #include macro "templates" trick --- src/ssa_print.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ssa_print.cpp') diff --git a/src/ssa_print.cpp b/src/ssa_print.cpp index f4ed5544c..93b27dcae 100644 --- a/src/ssa_print.cpp +++ b/src/ssa_print.cpp @@ -51,7 +51,7 @@ void ssa_file_write(ssaFileBuffer *f, void *data, isize len) { } -b32 ssa_valid_char(u8 c) { +bool ssa_valid_char(u8 c) { if (c >= 0x80) { return false; } @@ -71,7 +71,7 @@ b32 ssa_valid_char(u8 c) { return false; } -void ssa_print_escape_string(ssaFileBuffer *f, String name, b32 print_quotes) { +void ssa_print_escape_string(ssaFileBuffer *f, String name, bool print_quotes) { isize extra = 0; for (isize i = 0; i < name.len; i++) { u8 c = name.text[i]; @@ -127,7 +127,7 @@ void ssa_print_encoded_local(ssaFileBuffer *f, String name) { ssa_print_escape_string(f, name, true); } -void ssa_print_encoded_global(ssaFileBuffer *f, String name, b32 global_scope) { +void ssa_print_encoded_global(ssaFileBuffer *f, String name, bool global_scope) { ssa_fprintf(f, "@"); if (!global_scope && str_ne(name, str_lit("main"))) { ssa_fprintf(f, "."); @@ -239,7 +239,7 @@ void ssa_print_type(ssaFileBuffer *f, ssaModule *m, Type *t) { case Type_Named: if (is_type_struct(t) || is_type_union(t)) { - String *name = map_get(&m->type_names, hash_pointer(t)); + String *name = map_string_get(&m->type_names, hash_pointer(t)); GB_ASSERT_MSG(name != NULL, "%.*s", LIT(t->Named.name)); ssa_print_encoded_local(f, *name); // ssa_print_encoded_local(f, t->Named.name); @@ -613,7 +613,7 @@ void ssa_print_value(ssaFileBuffer *f, ssaModule *m, ssaValue *value, Type *type break; case ssaValue_Global: { Scope *scope = value->Global.entity->scope; - b32 in_global_scope = false; + bool in_global_scope = false; if (scope != NULL) { in_global_scope = scope->is_global || scope->is_init; } @@ -1226,7 +1226,7 @@ void ssa_print_proc(ssaFileBuffer *f, ssaModule *m, ssaProcedure *proc) { if (proc->module->generate_debug_info && proc->entity != NULL) { if (proc->body != NULL) { - ssaDebugInfo *di = *map_get(&proc->module->debug_info, hash_pointer(proc->entity)); + ssaDebugInfo *di = *map_ssa_debug_info_get(&proc->module->debug_info, hash_pointer(proc->entity)); GB_ASSERT(di->kind == ssaDebugInfo_Proc); ssa_fprintf(f, "!dbg !%d ", di->id); } @@ -1337,7 +1337,7 @@ void ssa_print_llvm_ir(ssaGen *ssa) { } auto *g = &v->Global; Scope *scope = g->entity->scope; - b32 in_global_scope = false; + bool in_global_scope = false; if (scope != NULL) { in_global_scope = scope->is_global || scope->is_init; } @@ -1383,7 +1383,7 @@ void ssa_print_llvm_ir(ssaGen *ssa) { switch (di->kind) { case ssaDebugInfo_CompileUnit: { auto *cu = &di->CompileUnit; - ssaDebugInfo *file = *map_get(&m->debug_info, hash_pointer(cu->file)); + ssaDebugInfo *file = *map_ssa_debug_info_get(&m->debug_info, hash_pointer(cu->file)); ssa_fprintf(f, "distinct !DICompileUnit(" "language: DW_LANG_Go, " // Is this good enough? -- cgit v1.2.3