Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r375a068 r626dbc10  
    6969        symtabp = false,
    7070        treep = false,
     71        tuplep = false,
    7172        validp = false,
    7273        errorp = false,
     
    267268                Tuples::expandUniqueExpr( translationUnit );
    268269
     270                OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded
     271                GenPoly::convertSpecializations( translationUnit );
     272
     273                OPTPRINT( "expandTuples" ); // xxx - is this the right place for this?
     274                Tuples::expandTuples( translationUnit );
     275                if ( tuplep ) {
     276                        dump( translationUnit );
     277                        return 0;
     278                }
     279
    269280                OPTPRINT("instantiateGenerics")
    270281                GenPoly::instantiateGeneric( translationUnit );
    271282                OPTPRINT( "copyParams" );
    272283                GenPoly::copyParams( translationUnit );
    273                 OPTPRINT( "convertSpecializations" )
    274                 GenPoly::convertSpecializations( translationUnit );
    275284                OPTPRINT( "convertLvalue" )
    276285                GenPoly::convertLvalue( translationUnit );
     
    282291                OPTPRINT( "box" )
    283292                GenPoly::box( translationUnit );
    284                 OPTPRINT( "expandTuples" ); // xxx - is this the right place for this?
    285                 Tuples::expandTuples( translationUnit );
    286293
    287294                // print tree right before code generation
     
    327334
    328335void parse_cmdline( int argc, char * argv[], const char *& filename ) {
    329         enum { Ast, Bbox, Bresolver, CtorInitFix, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, Validate, };
     336        enum { Ast, Bbox, Bresolver, CtorInitFix, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };
    330337
    331338        static struct option long_opts[] = {
     
    344351                { "symbol", no_argument, 0, Symbol },
    345352                { "tree", no_argument, 0, Tree },
     353                { "tuple-expansion", no_argument, 0, TupleExpansion },
    346354                { "validate", no_argument, 0, Validate },
    347355                { 0, 0, 0, 0 }
     
    352360
    353361        int c;
    354         while ( (c = getopt_long( argc, argv, "abBcefglnpqrstvyzD:F:", long_opts, &long_index )) != -1 ) {
     362        while ( (c = getopt_long( argc, argv, "abBcefglnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {
    355363                switch ( c ) {
    356364                  case Ast:
     
    362370                        bresolvep = true;
    363371                        break;
    364                   case 'B':                                                                             // print before resolver steps
     372                  case 'B':                                                                             // print before box steps
    365373                        bboxp = true;
    366374                        break;
     
    408416                  case 't':                                                                             // build in tree
    409417                        treep = true;
     418                        break;
     419                  case TupleExpansion:
     420                  case 'T':                                                                             // print after tuple expansion
     421                        tuplep = true;
    410422                        break;
    411423                  case 'v':                                                                             // dump AST after decl validation pass
Note: See TracChangeset for help on using the changeset viewer.