Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    rca1c11f rfaf8857  
    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 : Tue Jan 19 16:28:13 2016
    13 // Update Count     : 194
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Dec 17 12:59:06 2015
     13// Update Count     : 179
    1414//
    1515
     
    4242#include "InitTweak/Mutate.h"
    4343#include "InitTweak/RemoveInit.h"
    44 #include "InitTweak/FixInit.h"
    4544//#include "Explain/GenProlog.h"
    4645//#include "Try/Visit.h"
     
    6261        astp = false,
    6362        bresolvep = false,
    64         ctorinitp = false,
    6563        exprp = false,
    6664        expraltp = false,
     
    7674        codegenp = false;
    7775
    78 enum { Ast, Bresolver, CtorInitFix, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
     76enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
    7977
    8078static struct option long_opts[] = {
    8179        { "ast", no_argument, 0, Ast },
    8280        { "before-resolver", no_argument, 0, Bresolver },
    83         { "ctorinitfix", no_argument, 0, CtorInitFix },
    8481        { "expr", no_argument, 0, Expr },
    8582        { "expralt", no_argument, 0, ExprAlt },
     
    10299
    103100        opterr = 0;                                                                                     // prevent getopt from printing error messages
    104 
     101       
    105102        int c;
    106         while ( (c = getopt_long( argc, argv, "abcefFglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
     103        while ( (c = getopt_long( argc, argv, "abefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
    107104                switch ( c ) {
    108105                  case Ast:
     
    113110                  case 'b':                                                                             // print before resolver steps
    114111                        bresolvep = true;
    115                         break;
    116                         case CtorInitFix:
    117                         case 'c':
    118                         ctorinitp = true;
    119112                        break;
    120113                  case Expr:
     
    189182                        output = new ofstream( argv[ optind ] );
    190183                } // if
    191 
     184       
    192185                Parser::get_parser().set_debug( grammarp );
    193186
     
    210203                                        exit( 1 );
    211204                                } // if
    212 
     205                   
    213206                                parse( prelude, LinkageSpec::Intrinsic );
    214207                        } // if
    215208                } // if
    216209
    217                 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );
    218 
     210                parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );     
     211 
    219212                if ( parsep ) {
    220213                        Parser::get_parser().get_parseTree()->printList( std::cout );
     
    251244                OPTPRINT( "mutate" )
    252245                ControlStruct::mutate( translationUnit );
    253                 OPTPRINT( "fixNames" )
     246                OPTPRINT( "fixNames" ) 
    254247                CodeGen::fixNames( translationUnit );
    255                 OPTPRINT( "tweakInit" )
     248                OPTPRINT( "tweak" )
    256249                InitTweak::tweak( translationUnit );
    257250
     
    270263                if ( exprp ) {
    271264                        dump( translationUnit );
    272                         return 0;
    273                 }
    274 
    275                 OPTPRINT( "fixInit" )
    276                 // fix ObjectDecl - replaces ConstructorInit nodes
    277                 InitTweak::fix( translationUnit );
    278                 if ( ctorinitp ) {
    279                         dump ( translationUnit );
    280                         return 0;
    281265                }
    282266
     
    347331        std::list< Declaration * > decls;
    348332        if ( noprotop ) {
    349                 filter( translationUnit.begin(), translationUnit.end(),
     333                filter( translationUnit.begin(), translationUnit.end(), 
    350334                                std::back_inserter( decls ), notPrelude );
    351335        } else {
Note: See TracChangeset for help on using the changeset viewer.