Ignore:
Timestamp:
Aug 29, 2016, 10:33:05 AM (9 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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:
5e644d3e
Parents:
79841be (diff), 413ad05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r79841be r6943a987  
    446446                } else if ( StructInstType * st = dynamic_cast< StructInstType * >( initContext ) ) {
    447447                        resolveAggrInit( st->get_baseStruct(), iter, end );
    448                 } else if ( UnionInstType *st = dynamic_cast< UnionInstType * >( initContext ) ) {
     448                } else if ( UnionInstType * st = dynamic_cast< UnionInstType * >( initContext ) ) {
    449449                        resolveAggrInit( st->get_baseUnion(), iter, end );
     450                } else if ( TypeInstType * tt = dynamic_cast< TypeInstType * >( initContext ) ) {
     451                        Type * base = tt->get_baseType()->get_base();
     452                        if ( base ) {
     453                                // know the implementation type, so try using that as the initContext
     454                                initContext = base;
     455                                visit( listInit );
     456                        } else {
     457                                // missing implementation type -- might be an unknown type variable, so try proceeding with the current init context
     458                                Visitor::visit( listInit );
     459                        }
    450460                } else {
     461                        assert( dynamic_cast< BasicType * >( initContext ) || dynamic_cast< PointerType * >( initContext ) );
    451462                        // basic types are handled here
    452463                        Visitor::visit( listInit );
     
    539550                }
    540551
    541                 // xxx - todo
    542                 // if ( InitTweak::isIntrinsicCallStmt( ctorInit->get_ctor() ) ) {
    543                 //      // can reduce the constructor down to a SingleInit using the
    544                 //      // second argument from the ctor call
    545                 // }
    546 
    547552                if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->get_dtor() ) ) {
    548553                        delete ctorInit->get_dtor();
    549554                        ctorInit->set_dtor( NULL );
    550555                }
     556
     557                // xxx - todo -- what about arrays?
     558                // if ( dtor == NULL && InitTweak::isIntrinsicCallStmt( ctorInit->get_ctor() ) ) {
     559                //      // can reduce the constructor down to a SingleInit using the
     560                //      // second argument from the ctor call, since
     561                //      delete ctorInit->get_ctor();
     562                //      ctorInit->set_ctor( NULL );
     563
     564                //      Expression * arg =
     565                //      ctorInit->set_init( new SingleInit( arg ) );
     566                // }
    551567        }
    552568} // namespace ResolvExpr
Note: See TracChangeset for help on using the changeset viewer.