Ignore:
Timestamp:
Apr 14, 2022, 3:00:28 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
bfd5512
Parents:
30d91e4 (diff), 4ec9513 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into enum

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.proto.hpp

    r30d91e4 r365c8dcb  
    2626
    2727struct PureVisitor;
     28
     29template<typename node_t>
     30node_t * deepCopy( const node_t * localRoot );
    2831
    2932namespace __pass {
     
    396399                static inline auto addStructFwd( core_t & core, int, const ast::StructDecl * decl ) -> decltype( core.symtab.addStruct( decl ), void() ) {
    397400                        ast::StructDecl * fwd = new ast::StructDecl( decl->location, decl->name );
    398                         fwd->params = decl->params;
     401                        for ( const auto & param : decl->params ) {
     402                                fwd->params.push_back( deepCopy( param.get() ) );
     403                        }
    399404                        core.symtab.addStruct( fwd );
    400405                }
     
    405410                template<typename core_t>
    406411                static inline auto addUnionFwd( core_t & core, int, const ast::UnionDecl * decl ) -> decltype( core.symtab.addUnion( decl ), void() ) {
    407                         UnionDecl * fwd = new UnionDecl( decl->location, decl->name );
    408                         fwd->params = decl->params;
     412                        ast::UnionDecl * fwd = new ast::UnionDecl( decl->location, decl->name );
     413                        for ( const auto & param : decl->params ) {
     414                                fwd->params.push_back( deepCopy( param.get() ) );
     415                        }
    409416                        core.symtab.addUnion( fwd );
    410417                }
Note: See TracChangeset for help on using the changeset viewer.