Ignore:
Timestamp:
Apr 17, 2018, 12:01:09 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
3265399
Parents:
b2fe1c9 (diff), 81bb114 (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

    rb2fe1c9 r32cab5b  
    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 Mar  8 14:31:32 2018
     13// Update Count     : 348
    1414//
    1515
     
    116116}
    117117
    118 Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt ) {
     118Statement *build_switch( bool isSwitch, ExpressionNode *ctl, StatementNode *stmt ) {
    119119        std::list< Statement * > branches;
    120120        buildMoveList< Statement, StatementNode >( stmt, branches );
     121        if ( ! isSwitch ) {                                                                             // choose statement
     122                for ( Statement * stmt : branches ) {
     123                        CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt );
     124                        if ( ! caseStmt->stmts.empty() ) {                      // code after "case" => end of case list
     125                                CompoundStmt * block = strict_dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() );
     126                                block->kids.push_back( new BranchStmt( "", BranchStmt::Break ) );
     127                        } // if
     128                } // for
     129        } // if
    121130        // branches.size() == 0 for switch (...) {}, i.e., no declaration or statements
    122131        return new SwitchStmt( maybeMoveBuild< Expression >(ctl), branches );
Note: See TracChangeset for help on using the changeset viewer.