diff options
Diffstat (limited to 'src/parseh.cpp')
| -rw-r--r-- | src/parseh.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/parseh.cpp b/src/parseh.cpp index 1e1bcacaee..cf577f0f0a 100644 --- a/src/parseh.cpp +++ b/src/parseh.cpp @@ -115,10 +115,6 @@ static AstNode *create_field_access_node(Context *c, const char *lhs, const char return node; } -static ZigList<AstNode *> *create_empty_directives(Context *c) { - return allocate<ZigList<AstNode*>>(1); -} - static AstNode *create_typed_var_decl_node(Context *c, bool is_const, const char *var_name, AstNode *type_node, AstNode *init_node) { @@ -127,7 +123,7 @@ static AstNode *create_typed_var_decl_node(Context *c, bool is_const, const char node->data.variable_declaration.is_const = is_const; node->data.variable_declaration.visib_mod = c->visib_mod; node->data.variable_declaration.expr = init_node; - node->data.variable_declaration.directives = create_empty_directives(c); + node->data.variable_declaration.directives = nullptr; node->data.variable_declaration.type = type_node; normalize_parent_ptrs(node); return node; @@ -150,7 +146,6 @@ static AstNode *create_struct_field_node(Context *c, const char *name, AstNode * assert(type_node); AstNode *node = create_node(c, NodeTypeStructField); buf_init_from_str(&node->data.struct_field.name, name); - node->data.struct_field.directives = create_empty_directives(c); node->data.struct_field.visib_mod = VisibModPub; node->data.struct_field.type = type_node; @@ -197,18 +192,10 @@ static AstNode *create_num_lit_signed(Context *c, int64_t x) { return create_prefix_node(c, PrefixOpNegation, num_lit_node); } -static AstNode *create_directive_node(Context *c, const char *name, const char *value) { - AstNode *node = create_node(c, NodeTypeDirective); - buf_init_from_str(&node->data.directive.name, name); - buf_init_from_str(&node->data.directive.param, value); - return node; -} - static AstNode *create_type_decl_node(Context *c, const char *name, AstNode *child_type_node) { AstNode *node = create_node(c, NodeTypeTypeDecl); buf_init_from_str(&node->data.type_decl.symbol, name); node->data.type_decl.visib_mod = c->visib_mod; - node->data.type_decl.directives = create_empty_directives(c); node->data.type_decl.child_type = child_type_node; normalize_parent_ptrs(node); @@ -224,8 +211,7 @@ static AstNode *make_type_node(Context *c, TypeTableEntry *type_entry) { static AstNode *create_fn_proto_node(Context *c, Buf *name, TypeTableEntry *fn_type) { assert(fn_type->id == TypeTableEntryIdFn); AstNode *node = create_node(c, NodeTypeFnProto); - node->data.fn_proto.directives = create_empty_directives(c); - node->data.fn_proto.directives->append(create_directive_node(c, "attribute", "inline")); + node->data.fn_proto.is_inline = true; node->data.fn_proto.visib_mod = c->visib_mod; buf_init_from_buf(&node->data.fn_proto.name, name); node->data.fn_proto.return_type = make_type_node(c, fn_type->data.fn.fn_type_id.return_type); @@ -642,7 +628,6 @@ static void visit_fn_decl(Context *c, const FunctionDecl *fn_decl) { node->data.fn_proto.is_extern = fn_type->data.fn.fn_type_id.is_extern; node->data.fn_proto.visib_mod = c->visib_mod; - node->data.fn_proto.directives = create_empty_directives(c); node->data.fn_proto.is_var_args = fn_type->data.fn.fn_type_id.is_var_args; node->data.fn_proto.return_type = make_type_node(c, fn_type->data.fn.fn_type_id.return_type); @@ -826,7 +811,6 @@ static void visit_enum_decl(Context *c, const EnumDecl *enum_decl) { buf_init_from_buf(&enum_node->data.struct_decl.name, full_type_name); enum_node->data.struct_decl.kind = ContainerKindEnum; enum_node->data.struct_decl.visib_mod = VisibModExport; - enum_node->data.struct_decl.directives = create_empty_directives(c); enum_node->data.struct_decl.type_entry = enum_type; for (uint32_t i = 0; i < field_count; i += 1) { @@ -998,7 +982,6 @@ static void visit_record_decl(Context *c, const RecordDecl *record_decl) { buf_init_from_buf(&struct_node->data.struct_decl.name, &struct_type->name); struct_node->data.struct_decl.kind = ContainerKindStruct; struct_node->data.struct_decl.visib_mod = VisibModExport; - struct_node->data.struct_decl.directives = create_empty_directives(c); struct_node->data.struct_decl.type_entry = struct_type; for (uint32_t i = 0; i < struct_type->data.structure.src_field_count; i += 1) { |
