Changes in / [37eef7a:0f740d6]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r37eef7a r0f740d6  
    265265                stmt->location = node->location;
    266266                stmt->labels = makeLabelL( stmt, node->labels );
    267                 cache.emplace( node, stmt );
    268267                this->node = stmt;
    269268                return nullptr;
     
    271270
    272271        const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final {
    273                 if ( inCache( node ) ) return nullptr;
    274272                auto stmt = new CompoundStmt( get<Statement>().acceptL( node->kids ) );
    275273                stmtPostamble( stmt, node );
     
    278276
    279277        const ast::Stmt * visit( const ast::ExprStmt * node ) override final {
    280                 if ( inCache( node ) ) return nullptr;
    281278                auto stmt = new ExprStmt( get<Expression>().accept1( node->expr ) );
    282279                return stmtPostamble( stmt, node );
     
    284281
    285282        const ast::Stmt * visit( const ast::AsmStmt * node ) override final {
    286                 if ( inCache( node ) ) return nullptr;
    287283                auto stmt = new AsmStmt(
    288284                        node->isVolatile,
     
    297293
    298294        const ast::Stmt * visit( const ast::DirectiveStmt * node ) override final {
    299                 if ( inCache( node ) ) return nullptr;
    300295                auto stmt = new DirectiveStmt( node->directive );
    301296                return stmtPostamble( stmt, node );
     
    303298
    304299        const ast::Stmt * visit( const ast::IfStmt * node ) override final {
    305                 if ( inCache( node ) ) return nullptr;
    306300                auto stmt = new IfStmt(
    307301                        get<Expression>().accept1( node->cond ),
     
    314308
    315309        const ast::Stmt * visit( const ast::SwitchStmt * node ) override final {
    316                 if ( inCache( node ) ) return nullptr;
    317310                auto stmt = new SwitchStmt(
    318311                        get<Expression>().accept1( node->cond ),
     
    323316
    324317        const ast::Stmt * visit( const ast::CaseStmt * node ) override final {
    325                 if ( inCache( node ) ) return nullptr;
    326318                auto stmt = new CaseStmt(
    327319                        get<Expression>().accept1( node->cond ),
     
    333325
    334326        const ast::Stmt * visit( const ast::WhileStmt * node ) override final {
    335                 if ( inCache( node ) ) return nullptr;
    336327                auto inits = get<Statement>().acceptL( node->inits );
    337328                auto stmt = new WhileStmt(
     
    345336
    346337        const ast::Stmt * visit( const ast::ForStmt * node ) override final {
    347                 if ( inCache( node ) ) return nullptr;
    348338                auto stmt = new ForStmt(
    349339                        get<Statement>().acceptL( node->inits ),
     
    356346
    357347        const ast::Stmt * visit( const ast::BranchStmt * node ) override final {
    358                 if ( inCache( node ) ) return nullptr;
    359348                BranchStmt * stmt;
    360349                if (node->computedTarget) {
     
    386375
    387376        const ast::Stmt * visit( const ast::ReturnStmt * node ) override final {
    388                 if ( inCache( node ) ) return nullptr;
    389377                auto stmt = new ReturnStmt( get<Expression>().accept1( node->expr ) );
    390378                return stmtPostamble( stmt, node );
     
    392380
    393381        const ast::Stmt * visit( const ast::ThrowStmt * node ) override final {
    394                 if ( inCache( node ) ) return nullptr;
    395382                ThrowStmt::Kind kind;
    396383                switch (node->kind) {
     
    413400
    414401        const ast::Stmt * visit( const ast::TryStmt * node ) override final {
    415                 if ( inCache( node ) ) return nullptr;
    416402                auto handlers = get<CatchStmt>().acceptL( node->handlers );
    417403                auto stmt = new TryStmt(
     
    424410
    425411        const ast::Stmt * visit( const ast::CatchStmt * node ) override final {
    426                 if ( inCache( node ) ) return nullptr;
    427412                CatchStmt::Kind kind;
    428413                switch (node->kind) {
     
    446431
    447432        const ast::Stmt * visit( const ast::FinallyStmt * node ) override final {
    448                 if ( inCache( node ) ) return nullptr;
    449433                auto stmt = new FinallyStmt( get<CompoundStmt>().accept1( node->body ) );
    450434                return stmtPostamble( stmt, node );
     
    452436
    453437        const ast::Stmt * visit( const ast::WaitForStmt * node ) override final {
    454                 if ( inCache( node ) ) return nullptr;
    455438                auto stmt = new WaitForStmt;
    456439                stmt->clauses.reserve( node->clauses.size() );
     
    477460
    478461        const ast::Stmt * visit( const ast::WithStmt * node ) override final {
    479                 if ( inCache( node ) ) return nullptr;
    480462                auto stmt = new WithStmt(
    481463                        get<Expression>().acceptL( node->exprs ),
     
    486468
    487469        const ast::NullStmt * visit( const ast::NullStmt * node ) override final {
    488                 if ( inCache( node ) ) return nullptr;
    489470                auto stmt = new NullStmt();
    490471                stmtPostamble( stmt, node );
     
    493474
    494475        const ast::Stmt * visit( const ast::DeclStmt * node ) override final {
    495                 if ( inCache( node ) ) return nullptr;
    496476                auto stmt = new DeclStmt( get<Declaration>().accept1( node->decl ) );
    497477                return stmtPostamble( stmt, node );
     
    499479
    500480        const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * node ) override final {
    501                 if ( inCache( node ) ) return nullptr;
    502                 auto stmt = new ImplicitCtorDtorStmt{
    503                         get<Statement>().accept1( node->callStmt )
    504                 };
    505                 return stmtPostamble( stmt, node );
     481                (void)node;
     482                return nullptr;
    506483        }
    507484
     
    16061583
    16071584        virtual void visit( CompoundStmt * old ) override final {
    1608                 if ( inCache( old ) ) return;
    16091585                auto stmt = new ast::CompoundStmt(
    16101586                        old->location,
     
    16141590
    16151591                this->node = stmt;
    1616                 cache.emplace( old, this->node );
    16171592        }
    16181593
    16191594        virtual void visit( ExprStmt * old ) override final {
    1620                 if ( inCache( old ) ) return;
    16211595                this->node = new ast::ExprStmt(
    16221596                        old->location,
     
    16241598                        GET_LABELS_V(old->labels)
    16251599                );
    1626                 cache.emplace( old, this->node );
    16271600        }
    16281601
    16291602        virtual void visit( AsmStmt * old ) override final {
    1630                 if ( inCache( old ) ) return;
    16311603                this->node = new ast::AsmStmt(
    16321604                        old->location,
     
    16391611                        GET_LABELS_V(old->labels)
    16401612                );
    1641                 cache.emplace( old, this->node );
    16421613        }
    16431614
    16441615        virtual void visit( DirectiveStmt * old ) override final {
    1645                 if ( inCache( old ) ) return;
    16461616                this->node = new ast::DirectiveStmt(
    16471617                        old->location,
     
    16491619                        GET_LABELS_V(old->labels)
    16501620                );
    1651                 cache.emplace( old, this->node );
    16521621        }
    16531622
    16541623        virtual void visit( IfStmt * old ) override final {
    1655                 if ( inCache( old ) ) return;
    16561624                this->node = new ast::IfStmt(
    16571625                        old->location,
     
    16621630                        GET_LABELS_V(old->labels)
    16631631                );
    1664                 cache.emplace( old, this->node );
    16651632        }
    16661633
    16671634        virtual void visit( SwitchStmt * old ) override final {
    1668                 if ( inCache( old ) ) return;
    16691635                this->node = new ast::SwitchStmt(
    16701636                        old->location,
     
    16731639                        GET_LABELS_V(old->labels)
    16741640                );
    1675                 cache.emplace( old, this->node );
    16761641        }
    16771642
    16781643        virtual void visit( CaseStmt * old ) override final {
    1679                 if ( inCache( old ) ) return;
    16801644                this->node = new ast::CaseStmt(
    16811645                        old->location,
     
    16841648                        GET_LABELS_V(old->labels)
    16851649                );
    1686                 cache.emplace( old, this->node );
    16871650        }
    16881651
    16891652        virtual void visit( WhileStmt * old ) override final {
    1690                 if ( inCache( old ) ) return;
    16911653                this->node = new ast::WhileStmt(
    16921654                        old->location,
     
    16971659                        GET_LABELS_V(old->labels)
    16981660                );
    1699                 cache.emplace( old, this->node );
    17001661        }
    17011662
    17021663        virtual void visit( ForStmt * old ) override final {
    1703                 if ( inCache( old ) ) return;
    17041664                this->node = new ast::ForStmt(
    17051665                        old->location,
     
    17101670                        GET_LABELS_V(old->labels)
    17111671                );
    1712                 cache.emplace( old, this->node );
    17131672        }
    17141673
    17151674        virtual void visit( BranchStmt * old ) override final {
    1716                 if ( inCache( old ) ) return;
    17171675                if (old->computedTarget) {
    17181676                        this->node = new ast::BranchStmt(
     
    17481706                        this->node = stmt;
    17491707                }
    1750                 cache.emplace( old, this->node );
    17511708        }
    17521709
    17531710        virtual void visit( ReturnStmt * old ) override final {
    1754                 if ( inCache( old ) ) return;
    17551711                this->node = new ast::ReturnStmt(
    17561712                        old->location,
     
    17581714                        GET_LABELS_V(old->labels)
    17591715                );
    1760                 cache.emplace( old, this->node );
    17611716        }
    17621717
    17631718        virtual void visit( ThrowStmt * old ) override final {
    1764                 if ( inCache( old ) ) return;
    17651719                ast::ThrowStmt::Kind kind;
    17661720                switch (old->kind) {
     
    17821736                        GET_LABELS_V(old->labels)
    17831737                );
    1784                 cache.emplace( old, this->node );
    17851738        }
    17861739
    17871740        virtual void visit( TryStmt * old ) override final {
    1788                 if ( inCache( old ) ) return;
    17891741                this->node = new ast::TryStmt(
    17901742                        old->location,
     
    17941746                        GET_LABELS_V(old->labels)
    17951747                );
    1796                 cache.emplace( old, this->node );
    17971748        }
    17981749
    17991750        virtual void visit( CatchStmt * old ) override final {
    1800                 if ( inCache( old ) ) return;
    18011751                ast::CatchStmt::Kind kind;
    18021752                switch (old->kind) {
     
    18191769                        GET_LABELS_V(old->labels)
    18201770                );
    1821                 cache.emplace( old, this->node );
    18221771        }
    18231772
    18241773        virtual void visit( FinallyStmt * old ) override final {
    1825                 if ( inCache( old ) ) return;
    18261774                this->node = new ast::FinallyStmt(
    18271775                        old->location,
     
    18291777                        GET_LABELS_V(old->labels)
    18301778                );
    1831                 cache.emplace( old, this->node );
    18321779        }
    18331780
    18341781        virtual void visit( WaitForStmt * old ) override final {
    1835                 if ( inCache( old ) ) return;
    18361782                ast::WaitForStmt * stmt = new ast::WaitForStmt(
    18371783                        old->location,
     
    18611807
    18621808                this->node = stmt;
    1863                 cache.emplace( old, this->node );
    18641809        }
    18651810
    18661811        virtual void visit( WithStmt * old ) override final {
    1867                 if ( inCache( old ) ) return;
    18681812                this->node = new ast::WithStmt(
    18691813                        old->location,
     
    18721816                        GET_LABELS_V(old->labels)
    18731817                );
    1874                 cache.emplace( old, this->node );
    18751818        }
    18761819
    18771820        virtual void visit( NullStmt * old ) override final {
    1878                 if ( inCache( old ) ) return;
    18791821                this->node = new ast::NullStmt(
    18801822                        old->location,
    18811823                        GET_LABELS_V(old->labels)
    18821824                );
    1883                 cache.emplace( old, this->node );
    18841825        }
    18851826
    18861827        virtual void visit( DeclStmt * old ) override final {
    1887                 if ( inCache( old ) ) return;
    18881828                this->node = new ast::DeclStmt(
    18891829                        old->location,
     
    18911831                        GET_LABELS_V(old->labels)
    18921832                );
    1893                 cache.emplace( old, this->node );
    18941833        }
    18951834
    18961835        virtual void visit( ImplicitCtorDtorStmt * old ) override final {
    1897                 if ( inCache( old ) ) return;
    18981836                this->node = new ast::ImplicitCtorDtorStmt(
    18991837                        old->location,
     
    19011839                        GET_LABELS_V(old->labels)
    19021840                );
    1903                 cache.emplace( old, this->node );
    19041841        }
    19051842
Note: See TracChangeset for help on using the changeset viewer.