Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    ra025ea8 r427854b  
    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
     
    345345} // build_compound
    346346
    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 
    362347Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) {
    363348        std::list< Expression * > out, in;
Note: See TracChangeset for help on using the changeset viewer.