Ignore:
Timestamp:
May 17, 2023, 1:33:39 AM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT
Children:
d6c464d
Parents:
28f8f15
Message:

Save progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r28f8f15 r561354f  
    283283                decl->parent = get<AggregateDecl>().accept1( node->parent );
    284284                declPostamble( decl, node );
    285                 return nullptr; // ??
     285                return nullptr;
    286286        }
    287287
     
    321321                        get<Type>().accept1(node->base)
    322322                );
    323                 decl->data_constructors = get<StructDecl>().acceptL( node->data_constructors );
    324                 decl->data_union = get<UnionDecl>().accept1( node->data_union );
    325                 decl->tags = get<EnumDecl>().accept1( node->tag );
    326                 decl->tag_union = get<StructDecl>().accept1( node->tag_union );
     323                // decl->data_constructors = get<StructDecl>().acceptL( node->data_constructors );
     324                // decl->data_union = get<UnionDecl>().accept1( node->data_union );
     325                // decl->tag = get<EnumDecl>().accept1( node->tag );
     326                // decl->tag_union = get<StructDecl>().accept1( node->tag_union );
     327                return aggregatePostamble( decl, node );
     328        }
     329
     330        const ast::Decl * visit( const ast::AdtDecl * node ) override final {
     331                if ( inCache(node) ) return nullptr;
     332                auto decl = new AdtDecl(
     333                        node->name,
     334                        get<Attribute>().acceptL( node->attributes ),
     335                        LinkageSpec::Spec( node->linkage.val ),
     336                        get<StructDecl>().acceptL( node->data_constructors ),
     337                        get<UnionDecl>().accept1( node->data_union ),
     338                        get<EnumDecl>().accept1( node->tag ),
     339                        get<StructDecl>().accept1( node->tag_union )
     340                );
    327341                return aggregatePostamble( decl, node );
    328342        }
     
    17821796        }
    17831797
     1798        virtual void visit( const AdtDecl * old ) override final {
     1799                if ( inCache( old ) ) return;
     1800                auto decl = new ast::AdtDecl(
     1801                        old->location,
     1802                        old->name,
     1803                        GET_ACCEPT_V(attributes, Attribute),
     1804                        { old->linkage.val }
     1805                );
     1806                cache.emplace( old, decl );
     1807                decl->parent = GET_ACCEPT_1(parent, AggregateDecl);
     1808                decl->body = old->body;
     1809                decl->params = GET_ACCEPT_V(parameters, TypeDecl);
     1810                decl->members = GET_ACCEPT_V(members, Decl);
     1811                decl->extension = old->extension;
     1812                decl->uniqueId = old->uniqueId;
     1813                decl->storage = { old->storageClasses.val };
     1814                decl->data_constructors = GET_ACCEPT_V( data_constructors, StructDecl );
     1815                decl->data_union = GET_ACCEPT_1( data_union, UnionDecl );
     1816                decl->tag = GET_ACCEPT_1( tag, EnumDecl );
     1817                decl->tag_union = GET_ACCEPT_1( tag_union, StructDecl );
     1818                this->node = decl;
     1819        }
     1820
    17841821        virtual void visit( const TraitDecl * old ) override final {
    17851822                if ( inCache( old ) ) return;
Note: See TracChangeset for help on using the changeset viewer.