Changeset 626dbc10 for src/main.cc


Ignore:
Timestamp:
Dec 21, 2016, 3:12:19 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b940dc71
Parents:
e33f321
git-author:
Rob Schluntz <rschlunt@…> (12/21/16 15:07:41)
git-committer:
Rob Schluntz <rschlunt@…> (12/21/16 15:12:19)
Message:

major refactoring of specialization code, added code to generate thunks for ttype functions, move specialize pass to before tuple expansion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    re33f321 r626dbc10  
    6969        symtabp = false,
    7070        treep = false,
     71        tuplep = false,
    7172        validp = false,
    7273        errorp = false,
     
    266267                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
    267268                Tuples::expandUniqueExpr( translationUnit );
     269
     270                OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded
     271                GenPoly::convertSpecializations( translationUnit );
     272
    268273                OPTPRINT( "expandTuples" ); // xxx - is this the right place for this?
    269274                Tuples::expandTuples( translationUnit );
     275                if ( tuplep ) {
     276                        dump( translationUnit );
     277                        return 0;
     278                }
    270279
    271280                OPTPRINT("instantiateGenerics")
     
    273282                OPTPRINT( "copyParams" );
    274283                GenPoly::copyParams( translationUnit );
    275                 OPTPRINT( "convertSpecializations" )
    276                 GenPoly::convertSpecializations( translationUnit );
    277284                OPTPRINT( "convertLvalue" )
    278285                GenPoly::convertLvalue( translationUnit );
     
    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.