Changeset 28f3a19 for src/ControlStruct


Ignore:
Timestamp:
Jun 27, 2018, 3:28:41 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
b21c77a
Parents:
0182bfa (diff), 63238a4 (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' into with_gc

Location:
src/ControlStruct
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/ForExprMutator.cc

    r0182bfa r28f3a19  
    4545                return hoist( forStmt, forStmt->initialization );
    4646        }
     47        Statement *ForExprMutator::postmutate( WhileStmt *whileStmt ) {
     48                return hoist( whileStmt, whileStmt->initialization );
     49        }
    4750} // namespace ControlStruct
    4851
  • src/ControlStruct/ForExprMutator.h

    r0182bfa r28f3a19  
    1818class IfStmt;
    1919class ForStmt;
     20class WhileStmt;
    2021class Statement;
    2122
     
    2526                Statement *postmutate( IfStmt * );
    2627                Statement *postmutate( ForStmt * );
     28                Statement *postmutate( WhileStmt * );
    2729        };
    2830} // namespace ControlStruct
  • src/ControlStruct/Mutate.cc

    r0182bfa r28f3a19  
    2727#include "SynTree/Visitor.h"       // for acceptAll
    2828
    29 using namespace std;
     29namespace ControlStruct {
     30        void fixLabels( std::list< Declaration * > & translationUnit ) {
     31                PassVisitor<LabelFixer> lfix;
     32                acceptAll( translationUnit, lfix );
     33        }
    3034
    31 namespace ControlStruct {
    32         void mutate( std::list< Declaration * > translationUnit ) {
    33                 // hoist initialization out of for statements
     35        void hoistControlDecls( std::list< Declaration * > & translationUnit ) {
    3436                PassVisitor<ForExprMutator> formut;
    35 
    36                 // normalizes label definitions and generates multi-level exit labels
    37                 PassVisitor<LabelFixer> lfix;
    38 
    3937                mutateAll( translationUnit, formut );
    40                 acceptAll( translationUnit, lfix );
    4138        }
    4239} // namespace CodeGen
  • src/ControlStruct/Mutate.h

    r0182bfa r28f3a19  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Mutate.h -- 
     7// Mutate.h --
    88//
    99// Author           : Rodolfo G. Esteves
     
    2020class Declaration;
    2121
     22/// Desugars Cforall control structures
    2223namespace ControlStruct {
    23         /// Desugars Cforall control structures
    24         void mutate( std::list< Declaration* > translationUnit );
     24        /// normalizes label definitions and generates multi-level exit labels
     25        void fixLabels( std::list< Declaration * > & translationUnit );
     26
     27        /// hoist initialization out of for statements
     28        void hoistControlDecls( std::list< Declaration * > & translationUnit );
    2529} // namespace ControlStruct
    2630
Note: See TracChangeset for help on using the changeset viewer.