Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r39786813 rd3b7937  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // main.cc --
     7// main.cc -- 
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Fri May 15 23:12:02 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Mar 31 14:00:12 2016
    13 // Update Count     : 200
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jan 27 22:20:20 2016
     13// Update Count     : 199
    1414//
    1515
     
    2424#include "SynTree/Declaration.h"
    2525#include "SynTree/Visitor.h"
     26#include "GenPoly/InstantiateGeneric.h"
    2627#include "GenPoly/Lvalue.h"
    2728#include "GenPoly/Specialize.h"
     
    4142#include "InitTweak/Mutate.h"
    4243#include "InitTweak/RemoveInit.h"
    43 #include "InitTweak/FixInit.h"
    4444//#include "Explain/GenProlog.h"
    4545//#include "Try/Visit.h"
     
    6161        astp = false,
    6262        bresolvep = false,
    63         ctorinitp = false,
    6463        exprp = false,
    6564        expraltp = false,
     
    7675        codegenp = false;
    7776
    78 enum { Ast, Bresolver, CtorInitFix, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, Validate, };
     77enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, Validate, };
    7978
    8079static struct option long_opts[] = {
    8180        { "ast", no_argument, 0, Ast },
    8281        { "before-resolver", no_argument, 0, Bresolver },
    83         { "ctorinitfix", no_argument, 0, CtorInitFix },
    8482        { "expr", no_argument, 0, Expr },
    8583        { "expralt", no_argument, 0, ExprAlt },
     
    103101
    104102        opterr = 0;                                                                                     // prevent getopt from printing error messages
    105 
     103       
    106104        int c;
    107         while ( (c = getopt_long( argc, argv, "abcefFglnpqrstvyzD:", long_opts, &long_index )) != -1 ) {
     105        while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD:", long_opts, &long_index )) != -1 ) {
    108106                switch ( c ) {
    109107                  case Ast:
     
    114112                  case 'b':                                                                             // print before resolver steps
    115113                        bresolvep = true;
    116                         break;
    117                         case CtorInitFix:
    118                         case 'c':
    119                         ctorinitp = true;
    120114                        break;
    121115                  case Expr:
     
    194188                        output = new ofstream( argv[ optind ] );
    195189                } // if
    196 
     190       
    197191                Parser::get_parser().set_debug( grammarp );
    198192
     
    215209                                        exit( 1 );
    216210                                } // if
    217 
     211                   
    218212                                parse( prelude, LinkageSpec::Intrinsic );
    219213                        } // if
    220214                } // if
    221215
    222                 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );
    223 
     216                parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );     
     217 
    224218                if ( parsep ) {
    225219                        Parser::get_parser().get_parseTree()->printList( std::cout );
     
    256250                OPTPRINT( "mutate" )
    257251                ControlStruct::mutate( translationUnit );
    258                 OPTPRINT( "fixNames" )
     252                OPTPRINT( "fixNames" ) 
    259253                CodeGen::fixNames( translationUnit );
    260                 OPTPRINT( "tweakInit" )
     254                OPTPRINT( "tweak" )
    261255                InitTweak::tweak( translationUnit );
    262256
     
    275269                if ( exprp ) {
    276270                        dump( translationUnit );
    277                         return 0;
    278271                }
    279272
    280                 OPTPRINT( "fixInit" )
    281                 // fix ObjectDecl - replaces ConstructorInit nodes
    282                 InitTweak::fix( translationUnit );
    283                 if ( ctorinitp ) {
    284                         dump ( translationUnit );
    285                         return 0;
    286                 }
    287 
     273                OPTPRINT( "instantiateGeneric" )
     274                GenPoly::instantiateGeneric( translationUnit );
    288275                OPTPRINT( "copyParams" );
    289276                GenPoly::copyParams( translationUnit );
     
    330317        } // try
    331318
    332         deleteAll( translationUnit );
    333319        return 0;
    334320} // main
     
    351337        std::list< Declaration * > decls;
    352338        if ( noprotop ) {
    353                 filter( translationUnit.begin(), translationUnit.end(),
     339                filter( translationUnit.begin(), translationUnit.end(), 
    354340                                std::back_inserter( decls ), notPrelude );
    355341        } else {
Note: See TracChangeset for help on using the changeset viewer.