Ignore:
Timestamp:
Jul 29, 2016, 11:40:28 AM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
4d2434a
Parents:
29e8bf5
Message:

part-way through reorganizing ctor call generation so that it is more general

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.h

    r29e8bf5 r39f84a4  
    6161        bool isConstExpr( Expression * expr );
    6262        bool isConstExpr( Initializer * init );
     63
     64        class InitExpander {
     65        public:
     66                // expand by stepping through init to get each list of arguments
     67                InitExpander( Initializer * init );
     68
     69                // always expand to expr
     70                InitExpander( Expression * expr );
     71
     72                // iterator-like interface
     73                std::list< Expression * > operator*();
     74                InitExpander & operator++();
     75
     76                // builds statement which has the same semantics as a C-style list initializer
     77                // (for array initializers) using callExpr as the base expression to perform initialization
     78                Statement * buildListInit( UntypedExpr * callExpr );
     79                void addArrayIndex( Expression * index, Expression * dimension );
     80
     81                class ExpanderImpl;
     82        private:
     83                std::shared_ptr< ExpanderImpl > expander;
     84                std::list< Expression * > cur;
     85
     86                // invariant: list of size 2N (elements come in pairs [index, dimension])
     87                typedef std::list< Expression * > IndexList;
     88                IndexList indices;
     89        };
    6390} // namespace
    6491
Note: See TracChangeset for help on using the changeset viewer.