aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-06-09 19:53:06 +0100
committergingerBill <bill@gingerbill.org>2018-06-09 19:53:06 +0100
commit268491b224ac07edc50d314c071b19970cf157d0 (patch)
treeaa123c6f95976d7adecb977b9ca4f8d8924ea56b /src/check_type.cpp
parent49ea9ed7226b68cde2eeea3984d61098df9f22e3 (diff)
Use global arena for AstNode allocations
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 7151c9b6f..e4bd3dd2b 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -208,9 +208,7 @@ void add_polymorphic_struct_entity(CheckerContext *ctx, AstNode *node, Type *nam
token.kind = Token_String;
token.string = named_type->Named.name;
- AstNode *node = gb_alloc_item(a, AstNode);
- node->kind = AstNode_Ident;
- node->Ident.token = token;
+ AstNode *node = ast_ident(nullptr, token);
e = alloc_entity_type_name(s, token, named_type);
e->state = EntityState_Resolved;
@@ -1634,8 +1632,7 @@ void init_map_entry_type(Type *type) {
value: Value;
}
*/
- AstNode *dummy_node = gb_alloc_item(a, AstNode);
- dummy_node->kind = AstNode_Invalid;
+ AstNode *dummy_node = alloc_ast_node(nullptr, AstNode_Invalid);
Scope *s = create_scope(universal_scope, a);
auto fields = array_make<Entity *>(a, 0, 3);
@@ -1670,8 +1667,7 @@ void init_map_internal_types(Type *type) {
}
*/
gbAllocator a = heap_allocator();
- AstNode *dummy_node = gb_alloc_item(a, AstNode);
- dummy_node->kind = AstNode_Invalid;
+ AstNode *dummy_node = alloc_ast_node(nullptr, AstNode_Invalid);
Scope *s = create_scope(universal_scope, a);
Type *hashes_type = alloc_type_dynamic_array(t_int);