diff options
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp index c05e51cf1a..1598d69491 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -1093,67 +1093,3 @@ void ir_print(FILE *f, IrExecutable *executable, int indent_size) { } } } - -static void print_tld_var(IrPrint *irp, TldVar *tld_var) { - const char *const_or_var = tld_var->var->src_is_const ? "const" : "var"; - fprintf(irp->f, "%s %s", const_or_var, buf_ptr(tld_var->base.name)); - bool omit_type = (tld_var->var->value.type->id == TypeTableEntryIdNumLitFloat || - tld_var->var->value.type->id == TypeTableEntryIdNumLitInt); - if (!omit_type) { - fprintf(irp->f, ": %s", buf_ptr(&tld_var->var->value.type->name)); - } - if (tld_var->var->value.special != ConstValSpecialRuntime) { - fprintf(irp->f, " = "); - ir_print_const_value(irp, &tld_var->var->value); - } - fprintf(irp->f, ";\n"); -} - -static void print_tld_fn(IrPrint *irp, TldFn *tld_fn) { - fprintf(irp->f, "// %s = TODO (function)\n", buf_ptr(tld_fn->base.name)); -} - -static void print_tld_container(IrPrint *irp, TldContainer *tld_container) { - fprintf(irp->f, "// %s = TODO (container)\n", buf_ptr(tld_container->base.name)); -} - -static void print_tld_typedef(IrPrint *irp, TldTypeDef *tld_typedef) { - fprintf(irp->f, "// %s = TODO (typedef)\n", buf_ptr(tld_typedef->base.name)); -} - -void ir_print_decls(FILE *f, ImportTableEntry *import) { - IrPrint ir_print = {}; - IrPrint *irp = &ir_print; - irp->f = f; - irp->indent = 0; - irp->indent_size = 2; - - auto it = import->decls_scope->decl_table.entry_iterator(); - for (;;) { - auto *entry = it.next(); - if (!entry) - break; - - Tld *tld = entry->value; - if (!buf_eql_buf(entry->key, tld->name)) { - fprintf(f, "// alias: %s = %s\n", buf_ptr(entry->key), buf_ptr(tld->name)); - continue; - } - - switch (tld->id) { - case TldIdVar: - print_tld_var(irp, (TldVar *)tld); - continue; - case TldIdFn: - print_tld_fn(irp, (TldFn *)tld); - continue; - case TldIdContainer: - print_tld_container(irp, (TldContainer *)tld); - continue; - case TldIdTypeDef: - print_tld_typedef(irp, (TldTypeDef *)tld); - continue; - } - zig_unreachable(); - } -} |
