diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2023-08-07 11:02:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-07 11:02:01 +0100 |
| commit | 77e5854a16ea9396752d784510169c5856f044ae (patch) | |
| tree | 61f1a2a43bd1ff52a1d7fa02bb4660e524221edf /src/entity.cpp | |
| parent | cb5c8219898445a5501a95107c0200ea68b89a39 (diff) | |
| parent | 2a42dab108ea1c70962815cc714c0b4d3e42a719 (diff) | |
Merge branch 'master' into stdlib-parser-fixes
Diffstat (limited to 'src/entity.cpp')
| -rw-r--r-- | src/entity.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/entity.cpp b/src/entity.cpp index 649dd900d..ce27da3f2 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -2,8 +2,6 @@ struct Scope; struct Checker; struct Type; struct DeclInfo; -struct lbModule; -struct lbProcedure; #define ENTITY_KINDS \ @@ -183,8 +181,14 @@ struct Entity { Entity * aliased_of; - lbModule * code_gen_module; - lbProcedure *code_gen_procedure; + union { + struct lbModule *code_gen_module; + struct cgModule *cg_module; + }; + union { + struct lbProcedure *code_gen_procedure; + struct cgProcedure *cg_procedure; + }; u64 order_in_src; String deprecated_message; @@ -287,7 +291,6 @@ gb_internal bool is_entity_kind_exported(EntityKind kind, bool allow_builtin = f } gb_internal bool is_entity_exported(Entity *e, bool allow_builtin = false) { - // TODO(bill): Determine the actual exportation rules for imports of entities GB_ASSERT(e != nullptr); if (!is_entity_kind_exported(e->kind, allow_builtin)) { return false; @@ -401,7 +404,7 @@ gb_internal Entity *alloc_entity_array_elem(Scope *scope, Token token, Type *typ return entity; } -gb_internal Entity *alloc_entity_procedure(Scope *scope, Token token, Type *signature_type, u64 tags) { +gb_internal Entity *alloc_entity_procedure(Scope *scope, Token token, Type *signature_type, u64 tags=0) { Entity *entity = alloc_entity(Entity_Procedure, scope, token, signature_type); entity->Procedure.tags = tags; return entity; @@ -418,7 +421,7 @@ gb_internal Entity *alloc_entity_import_name(Scope *scope, Token token, Type *ty entity->ImportName.path = path; entity->ImportName.name = name; entity->ImportName.scope = import_scope; - entity->state = EntityState_Resolved; // TODO(bill): Is this correct? + entity->state = EntityState_Resolved; return entity; } @@ -427,7 +430,7 @@ gb_internal Entity *alloc_entity_library_name(Scope *scope, Token token, Type *t Entity *entity = alloc_entity(Entity_LibraryName, scope, token, type); entity->LibraryName.paths = paths; entity->LibraryName.name = name; - entity->state = EntityState_Resolved; // TODO(bill): Is this correct? + entity->state = EntityState_Resolved; return entity; } |