Ignore:
Timestamp:
Jan 30, 2018, 3:54:32 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
633a642
Parents:
f792cb8 (diff), 42be3c3 (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/CurrentObject.cc

    rf792cb8 r7416d46a  
    6262                virtual ~MemberIterator() {}
    6363
     64                /// walks the current object using the given designators as a guide
    6465                virtual void setPosition( std::list< Expression * > & designators ) = 0;
     66
     67                /// retrieve the list of possible Type/Designaton pairs for the current position in the currect object
    6568                virtual std::list<InitAlternative> operator*() const = 0;
     69
     70                /// true if the iterator is not currently at the end
    6671                virtual operator bool() const = 0;
     72
     73                /// moves the iterator by one member in the current object
    6774                virtual MemberIterator & bigStep() = 0;
     75
     76                /// moves the iterator by one member in the current subobject
    6877                virtual MemberIterator & smallStep() = 0;
     78
     79                /// the type of the current object
    6980                virtual Type * getType() = 0;
     81
     82                /// the type of the current subobject
    7083                virtual Type * getNext() = 0;
    7184
     85                /// printing for debug
    7286                virtual void print( std::ostream & out, Indenter indent ) const = 0;
    7387
     88                /// helper for operator*; aggregates must add designator to each init alternative, but
     89                /// adding designators in operator* creates duplicates.
    7490                virtual std::list<InitAlternative> first() const = 0; // should be protected
    7591        };
     
    354370                                }
    355371                        }
    356                         // if ( curMember == std::next( decl->get_members().begin(), 1 ) ) { // xxx - this never triggers because curMember is incremented immediately on construction
    357                         if ( atbegin ) { // xxx - this never triggers because curMember is incremented immediately on construction
     372                        if ( atbegin ) {
    358373                                // xxx - what about case of empty struct??
    359374                                // only add self if at the very beginning of the structure
     
    389404                        return *this;
    390405                }
    391                 virtual std::list<InitAlternative> first() const { return std::list<InitAlternative>{}; }
    392406        };
    393407
     
    443457                                return new UnionIterator( uit );
    444458                        } else {
    445                                 assertf( dynamic_cast< TypeInstType * >( type ), "some other reftotype" );
     459                                assertf( dynamic_cast< EnumInstType * >( type ) || dynamic_cast< TypeInstType * >( type ), "Encountered unhandled ReferenceToType in createMemberIterator: %s", toString( type ).c_str() );
    446460                                return new SimpleIterator( type );
    447461                        }
Note: See TracChangeset for help on using the changeset viewer.