Changes in / [f3152ab:779a4a3]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    rf3152ab r779a4a3  
    6363using namespace std;
    6464
    65 #define PASS(name, pass)                   \
    66         if ( errorp ) { cerr << #name << endl; } \
    67         HeapStats::newPass(#name);               \
    68         pass;
     65#define OPTPRINT(x) if ( errorp ) cerr << x << endl;
     66
    6967
    7068LinkageSpec::Spec linkage = LinkageSpec::Cforall;
     
    247245
    248246                // add the assignment statement after the initialization of a type parameter
    249                 PASS( "validate", SymTab::validate( translationUnit, symtabp ) );
     247                OPTPRINT( "validate" )
     248                SymTab::validate( translationUnit, symtabp );
    250249                if ( symtabp ) {
    251250                        deleteAll( translationUnit );
     
    264263                } // if
    265264
    266                 PASS( "mutate", ControlStruct::mutate( translationUnit ) );
    267                 PASS( "fixNames", CodeGen::fixNames( translationUnit ) );
    268                 PASS( "genInit", InitTweak::genInit( translationUnit ) );
    269                 PASS( "expandMemberTuples" , Tuples::expandMemberTuples( translationUnit ) );
     265                OPTPRINT( "mutate" )
     266                ControlStruct::mutate( translationUnit );
     267                OPTPRINT( "fixNames" )
     268                CodeGen::fixNames( translationUnit );
     269                OPTPRINT( "genInit" )
     270                InitTweak::genInit( translationUnit );
     271                OPTPRINT( "expandMemberTuples" );
     272                Tuples::expandMemberTuples( translationUnit );
    270273                if ( libcfap ) {
    271274                        // generate the bodies of cfa library functions
     
    286289                CodeTools::fillLocations( translationUnit );
    287290
    288                 PASS( "resolve", ResolvExpr::resolve( translationUnit ) );
     291                OPTPRINT( "resolve" )
     292                ResolvExpr::resolve( translationUnit );
    289293                if ( exprp ) {
    290294                        dump( translationUnit );
     
    293297
    294298                // fix ObjectDecl - replaces ConstructorInit nodes
    295                 PASS( "fixInit", InitTweak::fix( translationUnit, filename, libcfap || treep ) );
     299                OPTPRINT( "fixInit" )
     300                InitTweak::fix( translationUnit, filename, libcfap || treep );
    296301                if ( ctorinitp ) {
    297302                        dump ( translationUnit );
     
    299304                } // if
    300305
    301                 PASS( "expandUniqueExpr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused
     306                OPTPRINT( "expandUniqueExpr" ); // xxx - is this the right place for this? want to expand ASAP so that subsequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused
    302307                Tuples::expandUniqueExpr( translationUnit );
    303308
    304                 PASS( "translateEHM" , ControlStruct::translateEHM( translationUnit ) );
    305 
    306                 PASS( "generateWaitfor" , Concurrency::generateWaitFor( translationUnit ) );
    307 
    308                 PASS( "convertSpecializations",  GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded
    309 
    310                 PASS( "expandTuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this?
    311 
     309                OPTPRINT( "translateEHM" );
     310                ControlStruct::translateEHM( translationUnit );
     311
     312                OPTPRINT( "generateWaitfor" );
     313                Concurrency::generateWaitFor( translationUnit );
     314
     315                OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded
     316                GenPoly::convertSpecializations( translationUnit );
     317
     318                OPTPRINT( "expandTuples" ); // xxx - is this the right place for this?
     319                Tuples::expandTuples( translationUnit );
    312320                if ( tuplep ) {
    313321                        dump( translationUnit );
     
    315323                }
    316324
    317                 PASS( "virtual expandCasts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM
    318 
    319                 PASS( "instantiateGenerics", GenPoly::instantiateGeneric( translationUnit ) );
     325                OPTPRINT( "virtual expandCasts" ) // Must come after translateEHM
     326                Virtual::expandCasts( translationUnit );
     327
     328                OPTPRINT("instantiateGenerics")
     329                GenPoly::instantiateGeneric( translationUnit );
    320330                if ( genericsp ) {
    321331                        dump( translationUnit );
    322332                        return 0;
    323333                }
    324                 PASS( "convertLvalue", GenPoly::convertLvalue( translationUnit ) );
     334                OPTPRINT( "convertLvalue" )
     335                GenPoly::convertLvalue( translationUnit );
    325336
    326337
     
    329340                        return 0;
    330341                } // if
    331                 PASS( "box", GenPoly::box( translationUnit ) );
     342                OPTPRINT( "box" )
     343                GenPoly::box( translationUnit );
    332344
    333345                if ( bcodegenp ) {
     
    341353
    342354                CodeTools::fillLocations( translationUnit );
    343                 PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) );
     355                OPTPRINT( "codegen" )
     356                CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks );
    344357
    345358                CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" );
     359                OPTPRINT( "end" )
     360
     361
    346362                if ( output != &cout ) {
    347363                        delete output;
Note: See TracChangeset for help on using the changeset viewer.