diff options
| author | gingerBill <bill@gingerbill.org> | 2017-10-29 11:35:21 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-10-29 11:35:21 +0000 |
| commit | a43b89f36e988df8268ee92ea54017806b3226bb (patch) | |
| tree | b9db9300453604a565ee3ac7e56c9fe6ad17be08 /src/ir.cpp | |
| parent | 0ed34af19d20aa5ae13c2147bd0f767d68d2e965 (diff) | |
#alias type declarations; core library additions; `_global` import name for the global scope
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 853960d08..9b018a2ea 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -119,6 +119,7 @@ struct irProcedure { u64 tags; bool is_foreign; bool is_export; + bool is_entry_point; irValue * return_ptr; Array<irValue *> params; @@ -3743,6 +3744,12 @@ void ir_check_type_and_gen_for_proc_lit(irModule *m, String prefix_name, Type *t void ir_gen_global_type_name(irModule *m, Entity *e, String name) { if (e->type == nullptr) return; + if (e->kind == Entity_TypeName && e->type->kind == Type_Named) { + if (e != e->type->Named.type_name) { + // NOTE(bill): Is alias + return; + } + } Type *bt = base_type(e->type); @@ -8267,7 +8274,6 @@ void ir_gen_tree(irGen *s) { switch (e->kind) { case Entity_TypeName: - GB_ASSERT(e->type->kind == Type_Named); ir_gen_global_type_name(m, e, name); break; @@ -8374,6 +8380,7 @@ void ir_gen_tree(irGen *s) { irProcedure *proc = &p->Proc; proc->tags = ProcTag_no_inline; // TODO(bill): is no_inline a good idea? + proc->is_entry_point = true; e->Procedure.link_name = name; ir_begin_procedure_body(proc); @@ -8444,6 +8451,7 @@ void ir_gen_tree(irGen *s) { irProcedure *proc = &p->Proc; proc->tags = ProcTag_no_inline; // TODO(bill): is no_inline a good idea? + proc->is_entry_point = true; e->Procedure.link_name = name; ir_begin_procedure_body(proc); |