Ignore:
Timestamp:
Jul 16, 2024, 10:35:29 PM (6 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
0097d08
Parents:
68ea8d2 (diff), 88bc876 (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/CodeGen/CodeGenerator.cpp

    r68ea8d2 r97f9619  
    11951195        stmt->body->accept( *visitor );
    11961196
    1197         output << indent;
    1198 
    11991197        if ( stmt->isDoWhile ) {
    12001198                output << " while (";
    12011199                stmt->cond->accept( *visitor );
    1202                 output << ");";
     1200                output << ( ( nullptr == stmt->else_ ) ? ");" : ")" );
     1201        }
     1202        if ( stmt->else_ ) {
     1203                output << " else ";
     1204                stmt->else_->accept( *visitor );
    12031205        }
    12041206}
     
    12251227                stmt->body->accept( *visitor );
    12261228        }
     1229
     1230        if ( nullptr != stmt->else_ ) {
     1231                assertf( !options.genC, "Loop else should not reach code generation." );
     1232                output << " else ";
     1233                stmt->else_->accept( *visitor );
     1234        }
    12271235}
    12281236
Note: See TracChangeset for help on using the changeset viewer.