Changes in / [34c32f0:7b2c8c3c]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.impl.hpp

    r34c32f0 r7b2c8c3c  
    10501050        VISIT_START( node );
    10511051
    1052 <<<<<<< HEAD
    1053         VISIT(
    1054                 maybe_accept( node, &MutexStmt::mutexObjs );
    1055                 {
    1056                         // mutex statements introduce a level of scope (for the initialization)
    1057                         guard_symtab guard { *this };
    1058                         maybe_accept( node, &MutexStmt::stmt );
    1059                        
    1060                 }
    1061         )
    1062 =======
    10631052        if ( __visit_children() ) {
    10641053                // mutex statements introduce a level of scope (for the initialization)
     
    10671056                maybe_accept( node, &MutexStmt::mutexObjs );
    10681057        }
    1069 >>>>>>> e21f2536b7495654ded040259b42b7e2325b8360
    10701058
    10711059        VISIT_END( Stmt, node );
  • src/ControlStruct/MultiLevelExit.cpp

    r34c32f0 r7b2c8c3c  
    7171        bool isFallDefaultTarget() const { return kind == SwitchStmtK; }
    7272
    73         // These routines set a target as being "used" by a BranchStmt
    7473        Label useContExit() { assert( kind <= WhileStmtK ); return useTarget(secondTarget); }
    7574        Label useBreakExit() { assert( kind != CaseStmtK ); return useTarget(firstTarget); }
     
    7776        Label useFallDefaultExit() { assert( kind == SwitchStmtK ); return useTarget(secondTarget); }
    7877
    79         // These routines check if a specific label for a statement is used by a BranchStmt
    8078        bool isContUsed() const { assert( kind <= WhileStmtK ); return secondTarget.used; }
    8179        bool isBreakUsed() const { assert( kind != CaseStmtK ); return firstTarget.used; }
     
    166164        const CompoundStmt * stmt ) {
    167165        visit_children = false;
    168 
    169         // if the stmt is labelled then generate a label to check in postvisit if the label is used
    170166        bool isLabeled = !stmt->labels.empty();
    171167        if ( isLabeled ) {
     
    221217}
    222218
    223 // This routine updates targets on enclosing control structures to indicate which
    224 //     label is used by the BranchStmt that is passed
    225219const BranchStmt * MultiLevelExitCore::postvisit( const BranchStmt * stmt ) {
    226220        vector<Entry>::reverse_iterator targetEntry =
    227221                enclosing_control_structures.rend();
    228 
    229         // Labels on different stmts require different approaches to access
    230222        switch ( stmt->kind ) {
    231223          case BranchStmt::Goto:
     
    261253                  break;
    262254          }
    263           // handle fallthrough in case/switch stmts
    264255          case BranchStmt::FallThrough: {
    265256                  targetEntry = findEnclosingControlStructure( isFallthroughTarget );
     
    539530        }
    540531
    541         // if continue is used insert a continue label into the back of the body of the loop
    542532        if ( entry.isContUsed() ) {
    543533                CompoundStmt * new_body = new CompoundStmt( body->location );
    544                 // {}
    545534                new_body->kids.push_back( body );
    546                 // {
    547                 //  body
    548                 // }
    549535                new_body->kids.push_back(
    550536                        labelledNullStmt( body->location, entry.useContExit() ) );
    551                 // {
    552                 //  body
    553                 //  ContinueLabel: {}
    554                 // }
    555537                return new_body;
    556538        }
     
    566548        Label contLabel = newLabel( "loopContinue", loopStmt );
    567549        enclosing_control_structures.emplace_back( loopStmt, breakLabel, contLabel );
    568         // labels are added temporarily to see if they are used and then added permanently in postvisit if ther are used
    569         // children will tag labels as being used during their traversal which occurs before postvisit
    570 
    571         // GuardAction calls the lambda after the node is done being visited
    572550        GuardAction( [this](){ enclosing_control_structures.pop_back(); } );
    573551}
     
    582560        return mutate_field(
    583561                loopStmt, &LoopNode::body, mutateLoop( loopStmt->body, entry ) );
    584         // this call to mutate_field compares loopStmt->body and the result of mutateLoop
    585         //              if they are the same the node isn't mutated, if they differ then the new mutated node is returned
    586         //              the stmts will only differ if a label is used
    587562}
    588563
Note: See TracChangeset for help on using the changeset viewer.