| ... | ... | @@ -537,6 +537,10 @@ static void visit_enum_decl(Context *c, const EnumDecl *enum_decl) { |
| 537 | 537 | return; |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | // eagerly put the name in the table, but we need to remember to remove it if it fails |
| 541 | // boy it would be nice to have defer here wouldn't it |
| 542 | c->enum_type_table.put(bare_name, true); |
| 543 | |
| 540 | 544 | const EnumDecl *enum_def = enum_decl->getDefinition(); |
| 541 | 545 | |
| 542 | 546 | if (!enum_def) { |
| ... | ... | @@ -553,10 +557,6 @@ static void visit_enum_decl(Context *c, const EnumDecl *enum_decl) { |
| 553 | 557 | node->data.struct_decl.visib_mod = VisibModExport; |
| 554 | 558 | node->data.struct_decl.directives = create_empty_directives(c); |
| 555 | 559 | |
| 556 | | // eagerly put the name in the table, but we need to remember to remove it if it fails |
| 557 | | // boy it would be nice to have defer here wouldn't it |
| 558 | | c->enum_type_table.put(bare_name, true); |
| 559 | | |
| 560 | 560 | |
| 561 | 561 | ZigList<AstNode *> var_decls = {0}; |
| 562 | 562 | int i = 0; |
| ... | ... | @@ -624,6 +624,11 @@ static void visit_record_decl(Context *c, const RecordDecl *record_decl) { |
| 624 | 624 | return; |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | // eagerly put the name in the table, but we need to remember to remove it if it fails |
| 628 | // boy it would be nice to have defer here wouldn't it |
| 629 | c->struct_type_table.put(bare_name, true); |
| 630 | |
| 631 | |
| 627 | 632 | RecordDecl *record_def = record_decl->getDefinition(); |
| 628 | 633 | if (!record_def) { |
| 629 | 634 | // this is a type that we can point to but that's it, such as `struct Foo;`. |
| ... | ... | @@ -639,10 +644,6 @@ static void visit_record_decl(Context *c, const RecordDecl *record_decl) { |
| 639 | 644 | node->data.struct_decl.visib_mod = VisibModExport; |
| 640 | 645 | node->data.struct_decl.directives = create_empty_directives(c); |
| 641 | 646 | |
| 642 | | // eagerly put the name in the table, but we need to remember to remove it if it fails |
| 643 | | // boy it would be nice to have defer here wouldn't it |
| 644 | | c->struct_type_table.put(bare_name, true); |
| 645 | | |
| 646 | 647 | for (auto it = record_def->field_begin(), |
| 647 | 648 | it_end = record_def->field_end(); |
| 648 | 649 | it != it_end; ++it) |