Changeset ac9ca96 for src/InitTweak


Ignore:
Timestamp:
Oct 13, 2016, 11:19:23 AM (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:
7756647
Parents:
65660bd
Message:

consider tuples managed if a tuple constructor is declared, combine environments in tuple assignment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/GenInit.cc

    r65660bd rac9ca96  
    238238
    239239        bool CtorDtor::isManaged( Type * type ) const {
     240                if ( TupleType * tupleType = dynamic_cast< TupleType * > ( type ) ) {
     241                        // tuple is also managed if any of its components are managed
     242                        if ( std::any_of( tupleType->get_types().begin(), tupleType->get_types().end(), [&](Type * type) { return isManaged( type ); }) ) {
     243                                return true;
     244                        }
     245                }
    240246                return managedTypes.find( SymTab::Mangler::mangle( type ) ) != managedTypes.end();
    241247        }
     
    245251                while ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) {
    246252                        type = at->get_base();
    247                 }
    248                 if ( TupleType * tupleType = dynamic_cast< TupleType * > ( type ) ) {
    249                         return std::any_of( tupleType->get_types().begin(), tupleType->get_types().end(), [&](Type * type) { return isManaged( type ); });
    250253                }
    251254                return isManaged( type );
Note: See TracChangeset for help on using the changeset viewer.