Changeset dd05e12


Ignore:
Timestamp:
Mar 2, 2018, 5:34:51 PM (7 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:
09c72d5
Parents:
986dd36
git-author:
Rob Schluntz <rschlunt@…> (03/02/18 17:08:09)
git-committer:
Rob Schluntz <rschlunt@…> (03/02/18 17:34:51)
Message:

Minor code cleanup

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r986dd36 rdd05e12  
    448448                        ResolvExpr::findVoidExpression( resolved, indexer );
    449449                        assert( resolved );
    450                         if ( resolved->get_env() ) {
     450                        if ( resolved->env ) {
    451451                                // Extract useful information and discard new environments. Keeping them causes problems in PolyMutator passes.
    452                                 env->add( *resolved->get_env() );
    453                                 delete resolved->get_env();
    454                                 resolved->set_env( nullptr );
     452                                env->add( *resolved->env );
     453                                delete resolved->env;
     454                                resolved->env = nullptr;
    455455                        } // if
    456456                        delete stmt;
  • src/ResolvExpr/Resolver.cc

    r986dd36 rdd05e12  
    788788                stmtExpr->accept( resolver );
    789789                stmtExpr->computeResult();
     790                // xxx - aggregate the environments from all statements? Possibly in AlternativeFinder instead?
    790791        }
    791792
     
    793794                visit_children = false;
    794795                // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit
    795                 maybeAccept( ctorInit->get_ctor(), *visitor );
    796                 maybeAccept( ctorInit->get_dtor(), *visitor );
     796                maybeAccept( ctorInit->ctor, *visitor );
     797                maybeAccept( ctorInit->dtor, *visitor );
    797798
    798799                // found a constructor - can get rid of C-style initializer
    799                 delete ctorInit->get_init();
    800                 ctorInit->set_init( NULL );
     800                delete ctorInit->init;
     801                ctorInit->init = nullptr;
    801802
    802803                // intrinsic single parameter constructors and destructors do nothing. Since this was
    803804                // implicitly generated, there's no way for it to have side effects, so get rid of it
    804805                // to clean up generated code.
    805                 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->get_ctor() ) ) {
    806                         delete ctorInit->get_ctor();
    807                         ctorInit->set_ctor( NULL );
    808                 }
    809 
    810                 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->get_dtor() ) ) {
    811                         delete ctorInit->get_dtor();
    812                         ctorInit->set_dtor( NULL );
     806                if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->ctor ) ) {
     807                        delete ctorInit->ctor;
     808                        ctorInit->ctor = nullptr;
     809                }
     810
     811                if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->dtor ) ) {
     812                        delete ctorInit->dtor;
     813                        ctorInit->dtor = nullptr;
    813814                }
    814815
Note: See TracChangeset for help on using the changeset viewer.