Changeset b368dd8


Ignore:
Timestamp:
May 31, 2018, 4:05:06 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, with_gc
Children:
518e97d, ecae5860
Parents:
3d26610 (diff), cf5e5b1 (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 plg2:software/cfa/cfa-cc

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/Mutate.cc

    r3d26610 rb368dd8  
    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

    r3d26610 rb368dd8  
    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
  • src/ResolvExpr/AlternativeFinder.cc

    r3d26610 rb368dd8  
    299299                // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value
    300300                std::unique_ptr<Expression> aggrExpr( alt.expr->clone() );
    301                 alt.env.apply( aggrExpr->get_result() );
    302                 Type * aggrType = aggrExpr->get_result();
     301                alt.env.apply( aggrExpr->result );
     302                Type * aggrType = aggrExpr->result;
    303303                if ( dynamic_cast< ReferenceType * >( aggrType ) ) {
    304304                        aggrType = aggrType->stripReferences();
     
    306306                }
    307307
    308                 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) {
     308                if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->result ) ) {
    309309                        NameExpr nameExpr( "" );
    310310                        addAggMembers( structInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr );
    311                 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) {
     311                } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->result ) ) {
    312312                        NameExpr nameExpr( "" );
    313313                        addAggMembers( unionInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr );
     
    320320                NameExpr * nameExpr = dynamic_cast< NameExpr * >( member );
    321321                if ( ! nameExpr ) return;
    322                 const std::string & name = nameExpr->get_name();
     322                const std::string & name = nameExpr->name;
    323323                std::list< Declaration* > members;
    324324                aggInst->lookup( name, members );
  • src/SymTab/Validate.cc

    r3d26610 rb368dd8  
    4848#include "CodeGen/CodeGenerator.h"     // for genName
    4949#include "CodeGen/OperatorTable.h"     // for isCtorDtor, isCtorDtorAssign
     50#include "ControlStruct/Mutate.h"      // for ForExprMutator
    5051#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
    5152#include "Common/ScopedMap.h"          // for ScopedMap
     
    7677class SwitchStmt;
    7778
    78 
    7979#define debugPrint( x ) if ( doDebug ) { std::cout << x; }
    8080
     
    275275                Concurrency::applyKeywords( translationUnit );
    276276                acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
     277                ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
    277278                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay
    278279                Concurrency::implementMutexFuncs( translationUnit );
  • src/main.cc

    r3d26610 rb368dd8  
    264264                } // if
    265265
    266                 PASS( "mutate", ControlStruct::mutate( translationUnit ) );
     266                PASS( "fixLabels", ControlStruct::fixLabels( translationUnit ) );
    267267                PASS( "fixNames", CodeGen::fixNames( translationUnit ) );
    268268                PASS( "genInit", InitTweak::genInit( translationUnit ) );
Note: See TracChangeset for help on using the changeset viewer.