Ignore:
Timestamp:
Mar 6, 2024, 6:06:43 AM (23 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
647d633
Parents:
bbf2cb1 (diff), af60383 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    rbbf2cb1 rf6e8c67  
    5454                StatementNode * nextStmt = new StatementNode(
    5555                        new ast::DeclStmt( decl->location, maybeBuild( decl ) ) );
    56                 set_next( nextStmt );
    57                 if ( decl->get_next() ) {
    58                         get_next()->set_next( new StatementNode( dynamic_cast< DeclarationNode * >(decl->get_next()) ) );
    59                         decl->set_next( 0 );
     56                next = nextStmt;
     57                if ( decl->next ) {
     58                        next->next = new StatementNode( decl->next );
     59                        decl->next = nullptr;
    6060                } // if
    6161        } else {
    62                 if ( decl->get_next() ) {
    63                         set_next( new StatementNode( dynamic_cast< DeclarationNode * >( decl->get_next() ) ) );
    64                         decl->set_next( 0 );
     62                if ( decl->next ) {
     63                        next = new StatementNode( decl->next );
     64                        decl->next = nullptr;
    6565                } // if
    6666                agg = decl;
     
    8787        ClauseNode * prev = this;
    8888        // find end of list and maintain previous pointer
    89         for ( ClauseNode * curr = prev; curr != nullptr; curr = (ClauseNode *)curr->get_next() ) {
    90                 ClauseNode * node = strict_dynamic_cast< ClauseNode * >(curr);
     89        for ( ClauseNode * curr = prev; curr != nullptr; curr = curr->next ) {
     90                ClauseNode * node = curr;
    9191                assert( dynamic_cast<ast::CaseClause *>( node->clause.get() ) );
    9292                prev = curr;
    9393        } // for
    94         ClauseNode * node = dynamic_cast< ClauseNode * >(prev);
     94        ClauseNode * node = prev;
    9595        // convert from StatementNode list to Statement list
    9696        std::vector<ast::ptr<ast::Stmt>> stmts;
     
    332332        clause->when_cond = notZeroExpr( maybeMoveBuild( when ) );
    333333
    334         ExpressionNode * next = dynamic_cast<ExpressionNode *>( targetExpr->get_next() );
    335         targetExpr->set_next( nullptr );
     334        ExpressionNode * next = targetExpr->next;
     335        targetExpr->next = nullptr;
    336336        buildMoveList( next, clause->target_args );
    337337
Note: See TracChangeset for help on using the changeset viewer.