Changeset ca1c11f


Ignore:
Timestamp:
Jan 20, 2016, 12:36:27 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
771b3c3
Parents:
f1e012b
Message:

added constructor debug flag -c, fixed mistake in removing extraneous destructor calls

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    rf1e012b rca1c11f  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Jan 19 13:25:13 2016
    13 // Update Count     : 27
     12// Last Modified On : Tue Jan 19 16:36:59 2016
     13// Update Count     : 30
    1414//
    1515
     
    7373        CompoundStmt * FixInit::mutate( CompoundStmt * compoundStmt ) {
    7474                std::list< Statement * > & statements = compoundStmt->get_kids();
    75                 for ( std::list< Statement * >::iterator it = statements.begin(); it != statements.end(); ++it ) {
     75                for ( std::list< Statement * >::iterator it = statements.begin(); it != statements.end(); ) {
    7676                        // remove if instrinsic destructor statement
    7777                        // xxx - test user manually calling intrinsic functions - what happens?
     
    8181                                                if ( function->get_var()->get_name() == "^?{}" && function->get_var()->get_linkage() == LinkageSpec::Intrinsic ) {
    8282                                                        statements.erase(it++);
     83                                                        continue;
     84                                                } else {
    8385                                                }
    8486                                        }
    8587                                }
    8688                        }
     89                        ++it;
    8790                }
    8891                // mutate non-destructor statements
    89                 return Mutator::mutate( compoundStmt );
     92                return PolyMutator::mutate( compoundStmt );
    9093        }
    9194
  • src/main.cc

    rf1e012b rca1c11f  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Jan 19 13:16:23 2016
    13 // Update Count     : 185
     12// Last Modified On : Tue Jan 19 16:28:13 2016
     13// Update Count     : 194
    1414//
    1515
     
    6262        astp = false,
    6363        bresolvep = false,
     64        ctorinitp = false,
    6465        exprp = false,
    6566        expraltp = false,
     
    7576        codegenp = false;
    7677
    77 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
     78enum { Ast, Bresolver, CtorInitFix, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
    7879
    7980static struct option long_opts[] = {
    8081        { "ast", no_argument, 0, Ast },
    8182        { "before-resolver", no_argument, 0, Bresolver },
     83        { "ctorinitfix", no_argument, 0, CtorInitFix },
    8284        { "expr", no_argument, 0, Expr },
    8385        { "expralt", no_argument, 0, ExprAlt },
     
    102104
    103105        int c;
    104         while ( (c = getopt_long( argc, argv, "abefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
     106        while ( (c = getopt_long( argc, argv, "abcefFglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
    105107                switch ( c ) {
    106108                  case Ast:
     
    111113                  case 'b':                                                                             // print before resolver steps
    112114                        bresolvep = true;
     115                        break;
     116                        case CtorInitFix:
     117                        case 'c':
     118                        ctorinitp = true;
    113119                        break;
    114120                  case Expr:
     
    264270                if ( exprp ) {
    265271                        dump( translationUnit );
     272                        return 0;
    266273                }
    267274
     
    269276                // fix ObjectDecl - replaces ConstructorInit nodes
    270277                InitTweak::fix( translationUnit );
     278                if ( ctorinitp ) {
     279                        dump ( translationUnit );
     280                        return 0;
     281                }
    271282
    272283                OPTPRINT( "instantiateGeneric" )
Note: See TracChangeset for help on using the changeset viewer.