aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-08 13:26:48 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-08 13:26:48 +0100
commit5cad7d44a6f51afe97b3176a6c55d53d96cc40b7 (patch)
tree168fb0dd68957894a56c66d28e5c0af88e7eca59 /src/ir_print.cpp
parent2b96be0ae8b74e6081a00d740dfcbe205f76fb22 (diff)
Use templated `Map` for extra type safety
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 823960352..cc008f4a1 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -306,7 +306,7 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t) {
case Type_Named:
if (is_type_struct(t) || is_type_union(t)) {
- String *name = map_string_get(&m->entity_names, hash_pointer(t->Named.type_name));
+ String *name = map_get(&m->entity_names, hash_pointer(t->Named.type_name));
GB_ASSERT_MSG(name != NULL, "%.*s", LIT(t->Named.name));
ir_print_encoded_local(f, *name);
} else {
@@ -1523,7 +1523,7 @@ void ir_print_proc(irFileBuffer *f, irModule *m, irProcedure *proc) {
if (proc->entity != NULL) {
if (proc->body != NULL) {
- irDebugInfo **di_ = map_ir_debug_info_get(&proc->module->debug_info, hash_pointer(proc->entity));
+ irDebugInfo **di_ = map_get(&proc->module->debug_info, hash_pointer(proc->entity));
if (di_ != NULL) {
irDebugInfo *di = *di_;
GB_ASSERT(di->kind == irDebugInfo_Proc);
@@ -1606,7 +1606,7 @@ void print_llvm_ir(irGen *ir) {
for_array(member_index, m->members.entries) {
- MapIrValueEntry *entry = &m->members.entries[member_index];
+ auto *entry = &m->members.entries[member_index];
irValue *v = entry->value;
if (v->kind != irValue_TypeName) {
continue;
@@ -1619,7 +1619,7 @@ void print_llvm_ir(irGen *ir) {
bool dll_main_found = false;
for_array(member_index, m->members.entries) {
- MapIrValueEntry *entry = &m->members.entries[member_index];
+ auto *entry = &m->members.entries[member_index];
irValue *v = entry->value;
if (v->kind != irValue_Proc) {
continue;
@@ -1631,7 +1631,7 @@ void print_llvm_ir(irGen *ir) {
}
for_array(member_index, m->members.entries) {
- MapIrValueEntry *entry = &m->members.entries[member_index];
+ auto *entry = &m->members.entries[member_index];
irValue *v = entry->value;
if (v->kind != irValue_Proc) {
continue;
@@ -1643,7 +1643,7 @@ void print_llvm_ir(irGen *ir) {
}
for_array(member_index, m->members.entries) {
- MapIrValueEntry *entry = &m->members.entries[member_index];
+ auto *entry = &m->members.entries[member_index];
irValue *v = entry->value;
if (v->kind != irValue_Global) {
continue;
@@ -1713,7 +1713,7 @@ void print_llvm_ir(irGen *ir) {
switch (di->kind) {
case irDebugInfo_CompileUnit: {
- irDebugInfo *file = *map_ir_debug_info_get(&m->debug_info, hash_pointer(di->CompileUnit.file));
+ irDebugInfo *file = *map_get(&m->debug_info, hash_pointer(di->CompileUnit.file));
ir_fprintf(f,
"distinct !DICompileUnit("
"language: DW_LANG_Go, " // Is this good enough?