diff options
| author | Ginger Bill <bill@gingerbill.org> | 2016-09-30 20:38:46 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2016-09-30 20:38:46 +0100 |
| commit | c6aac264fa8001ff5e55e5ac6f56289ff0a755ee (patch) | |
| tree | 4ff0521b330e5a2b0183d3bab2f762a669b5efa5 /src/checker/entity.cpp | |
| parent | 04b5d8c132e8aabb3bb5dff31683cb45d4dff9c0 (diff) | |
Begin work on const llvm aggregate literals
Diffstat (limited to 'src/checker/entity.cpp')
| -rw-r--r-- | src/checker/entity.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/checker/entity.cpp b/src/checker/entity.cpp index 32563de4c..138e46236 100644 --- a/src/checker/entity.cpp +++ b/src/checker/entity.cpp @@ -49,7 +49,8 @@ struct Entity { b8 anonymous; // Variable is an anonymous b8 is_using; // `using` variable - i32 field_index; // Order in source + i32 field_index; + i32 field_src_index; b8 is_field; // Is struct field } Variable; struct { @@ -124,9 +125,10 @@ Entity *make_entity_param(gbAllocator a, Scope *scope, Token token, Type *type, return entity; } -Entity *make_entity_field(gbAllocator a, Scope *scope, Token token, Type *type, b32 is_anonymous, i32 field_index) { +Entity *make_entity_field(gbAllocator a, Scope *scope, Token token, Type *type, b32 is_anonymous, i32 field_src_index) { Entity *entity = make_entity_variable(a, scope, token, type); - entity->Variable.field_index = field_index; + entity->Variable.field_src_index = field_src_index; + entity->Variable.field_index = field_src_index; entity->Variable.is_field = true; entity->Variable.anonymous = cast(b8)is_anonymous; entity->Variable.is_using = cast(b8)is_anonymous; |