Changeset 182fe1e for src/ControlStruct


Ignore:
Timestamp:
Aug 1, 2016, 9:07:35 AM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
79f64f1
Parents:
c45170a (diff), 08061589 (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:

update switch documentation and LaTeX macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/CaseRangeMutator.cc

    rc45170a r182fe1e  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul 31 00:14:16 2016
    13 // Update Count     : 29
     11// Last Modified By :
     12// Last Modified On : Sun Jul 31 12:16:28 2016
     13// Update Count     : 32
    1414//
    1515
     
    3737
    3838                        if ( ! newCaseLabels.empty() ) {
     39                                std::cout << "FRED" << std::endl;
    3940                                std::list< Statement * > newCases;
    4041
     
    6465
    6566                return switchStmt;
    66         }
     67        } // CaseRangeMutator::mutate
    6768
    6869        Statement *CaseRangeMutator::mutate( CaseStmt *caseStmt ) {
    69                 if ( TupleExpr *tcond = dynamic_cast< TupleExpr * >( caseStmt->get_condition() ) ) { // case list
     70                // case list, e.g., case 1, 3, 5:
     71                if ( TupleExpr *tcond = dynamic_cast< TupleExpr * >( caseStmt->get_condition() ) ) {
    7072                        assert( ! tcond->get_exprs().empty() );
    71                         for ( std::list< Expression * >::iterator i = tcond->get_exprs().begin(); i != tcond->get_exprs().end(); i++ )
     73                        for ( std::list< Expression * >::iterator i = tcond->get_exprs().begin(); i != tcond->get_exprs().end(); i++ ) {
    7274                                newCaseLabels.push_back( *i );                  // do I need to clone them?
     75                        } // for
    7376                } // if
    7477
     
    7780
    7881                return caseStmt;
    79         }
     82        } // CaseRangeMutator::mutate
    8083} // namespace ControlStruct
    8184
Note: See TracChangeset for help on using the changeset viewer.