Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    ra025ea8 re67991f  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct 24 04:20:55 2020
    13 // Update Count     : 383
     12// Last Modified On : Sat Aug  4 09:39:25 2018
     13// Update Count     : 363
    1414//
    1515
     
    249249} // build_finally
    250250
    251 SuspendStmt * build_suspend( StatementNode * then, SuspendStmt::Type type ) {
    252         auto node = new SuspendStmt();
    253 
    254         node->type = type;
    255 
    256         std::list< Statement * > stmts;
    257         buildMoveList< Statement, StatementNode >( then, stmts );
    258         if(!stmts.empty()) {
    259                 assert( stmts.size() == 1 );
    260                 node->then = dynamic_cast< CompoundStmt * >( stmts.front() );
    261         }
    262 
    263         return node;
    264 }
    265 
    266251WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when ) {
    267252        auto node = new WaitForStmt();
     
    345330} // build_compound
    346331
    347 // A single statement in a control structure is always converted to a compound statement so subsequent generated code
    348 // can be placed within this compound statement. Otherwise, code generation has to constantly check for a single
    349 // statement and wrap it into a compound statement to insert additional code. Hence, all control structures have a
    350 // conical form for code generation.
    351 StatementNode * maybe_build_compound( StatementNode * first ) {
    352         // Optimization: if the control-structure statement is a compound statement, do not wrap it.
    353         // e.g., if (...) {...} do not wrap the existing compound statement.
    354         if ( ! dynamic_cast<CompoundStmt *>( first->stmt.get() ) ) { // unique_ptr
    355                 CompoundStmt * cs = new CompoundStmt();
    356                 buildMoveList( first, cs->get_kids() );
    357                 return new StatementNode( cs );
    358         } // if
    359         return first;
    360 } // maybe_build_compound
    361 
    362332Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) {
    363333        std::list< Expression * > out, in;
Note: See TracChangeset for help on using the changeset viewer.