Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    re612146c r2065609  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Sep  1 23:25:23 2017
    13 // Update Count     : 346
     12// Last Modified On : Thu Aug 17 16:01:31 2017
     13// Update Count     : 345
    1414//
    1515
     
    9999        } // if
    100100
    101         Expression * cond = nullptr;
    102         if ( ctl->condition ) {
    103                 // compare the provided condition against 0
    104                 cond =  notZeroExpr( maybeMoveBuild< Expression >(ctl->condition) );
    105         } else {
    106                 for ( Statement * stmt : init ) {
    107                         // build the && of all of the declared variables compared against 0
    108                         DeclStmt * declStmt = safe_dynamic_cast< DeclStmt * >( stmt );
    109                         DeclarationWithType * dwt = safe_dynamic_cast< DeclarationWithType * >( declStmt->decl );
    110                         Expression * nze = notZeroExpr( new VariableExpr( dwt ) );
    111                         cond = cond ? new LogicalExpr( cond, nze, true ) : nze;
    112                 }
    113         }
     101        Expression * cond = ctl->condition ? maybeMoveBuild< Expression >(ctl->condition) : new VariableExpr( dynamic_cast<DeclarationWithType *>( dynamic_cast<DeclStmt *>( init.back() )->decl ) );
    114102        delete ctl;
    115         return new IfStmt( noLabels, cond, thenb, elseb, init );
     103        return new IfStmt( noLabels, notZeroExpr( cond ), thenb, elseb, init );
    116104}
    117105
     
    300288}
    301289
    302 Statement *build_asmstmt( bool voltile, Expression *instruction, ExpressionNode *output, ExpressionNode *input, ExpressionNode *clobber, LabelNode *gotolabels ) {
     290Statement *build_asmstmt( bool voltile, ConstantExpr *instruction, ExpressionNode *output, ExpressionNode *input, ExpressionNode *clobber, LabelNode *gotolabels ) {
    303291        std::list< Expression * > out, in;
    304292        std::list< ConstantExpr * > clob;
Note: See TracChangeset for help on using the changeset viewer.