Changeset 33a7b6d for src/SynTree


Ignore:
Timestamp:
Nov 15, 2016, 5:30:52 PM (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:
d9fa60a
Parents:
8f9cc50
Message:

changed use of formal types to actual types for boxing return parameters and passing type variables, fix bug where generic struct's members would change types when a member is accessed on a concrete instantiation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceToType.cc

    r8f9cc50 r33a7b6d  
    4646
    4747namespace {
    48         void doLookup( const std::list< Declaration* > &members, const std::list< TypeDecl* > &parms, const std::list< Expression* > &args, const std::string &name, std::list< Declaration* > &foundDecls ) {
    49                 std::list< Declaration* > found;
     48        void doLookup( const std::list< Declaration* > &members, const std::string &name, std::list< Declaration* > &foundDecls ) {
    5049                for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
    5150                        if ( (*i)->get_name() == name ) {
    52                                 found.push_back( *i );
     51                                foundDecls.push_back( *i );
    5352                        } // if
    5453                } // for
    55                 applySubstitution( parms.begin(), parms.end(), args.begin(), found.begin(), found.end(), back_inserter( foundDecls ) );
    5654        }
    5755} // namespace
     
    6866void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    6967        assert( baseStruct );
    70         doLookup( baseStruct->get_members(), baseStruct->get_parameters(), parameters, name, foundDecls );
     68        doLookup( baseStruct->get_members(), name, foundDecls );
    7169}
    7270
     
    9492void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    9593        assert( baseUnion );
    96         doLookup( baseUnion->get_members(), baseUnion->get_parameters(), parameters, name, foundDecls );
     94        doLookup( baseUnion->get_members(), name, foundDecls );
    9795}
    9896
Note: See TracChangeset for help on using the changeset viewer.