Changeset 234b1cb for src/ResolvExpr


Ignore:
Timestamp:
Jun 20, 2019, 2:32:55 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b8524ca, f5edcb4
Parents:
c0f9efe
Message:

Port TupleAssignment to new AST

Location:
src/ResolvExpr
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Alternative.cc

    rc0f9efe r234b1cb  
    125125        }
    126126
    127         void splice( AltList& dst, AltList& src ) {
    128                 dst.reserve( dst.size() + src.size() );
    129                 for ( Alternative& alt : src ) {
    130                         dst.push_back( std::move(alt) );
    131                 }
    132                 src.clear();
    133         }
    134 
    135         void spliceBegin( AltList& dst, AltList& src ) {
    136                 splice( src, dst );
    137                 dst.swap( src );
    138         }
    139 
    140127} // namespace ResolvExpr
    141128
  • src/ResolvExpr/Alternative.h

    rc0f9efe r234b1cb  
    112112        typedef std::vector< Alternative > AltList;
    113113
    114         /// Moves all elements from src to the end of dst
    115         void splice( AltList& dst, AltList& src );
    116 
    117         /// Moves all elements from src to the beginning of dst
    118         void spliceBegin( AltList& dst, AltList& src );
    119 
    120114        static inline std::ostream & operator<<(std::ostream & os, const ResolvExpr::Alternative & alt) {
    121115                alt.print( os );
  • src/ResolvExpr/Candidate.hpp

    rc0f9efe r234b1cb  
    7575using CandidateList = std::vector< CandidateRef >;
    7676
    77 /// Splice src after dst, clearing src
    78 static inline void splice( CandidateList & dst, CandidateList & src ) {
    79         dst.reserve( dst.size() + src.size() );
    80         for ( CandidateRef & r : src ) { dst.emplace_back( std::move( r ) ); }
    81         src.clear();
    82 }
    83 
    84 /// Splice src before dst
    85 static inline void spliceBegin( CandidateList & dst, CandidateList & src ) {
    86         splice( src, dst );
    87         dst.swap( src );
    88 }
    89 
    9077/// Sum the cost of a list of candidates
    9178static inline Cost sumCost( const CandidateList & candidates ) {
  • src/ResolvExpr/Resolver.cc

    rc0f9efe r234b1cb  
    12531253        }
    12541254
     1255        ast::ptr< ast::Init > resolveCtorInit(
     1256                const ast::ConstructorInit * ctorInit, const ast::SymbolTable & symtab
     1257        ) {
     1258                assert( ctorInit );
     1259                ast::Pass< Resolver_new > resolver{ symtab };
     1260                return ctorInit->accept( resolver );
     1261        }
     1262
    12551263        ast::ptr< ast::Expr > resolveStmtExpr(
    12561264                const ast::StmtExpr * stmtExpr, const ast::SymbolTable & symtab
  • src/ResolvExpr/Resolver.h

    rc0f9efe r234b1cb  
    2929
    3030namespace ast {
     31        class ConstructorInit;
    3132        class Decl;
    3233        class DeletedExpr;
     34        class Init;
    3335        class StmtExpr;
    3436        class SymbolTable;
     
    5961        ast::ptr< ast::Expr > resolveInVoidContext(
    6062                const ast::Expr * expr, const ast::SymbolTable & symtab, ast::TypeEnvironment & env );
     63        /// Resolves a constructor init expression
     64        ast::ptr< ast::Init > resolveCtorInit(
     65                const ast::ConstructorInit * ctorInit, const ast::SymbolTable & symtab );
    6166        /// Resolves a statement expression
    6267        ast::ptr< ast::Expr > resolveStmtExpr(
Note: See TracChangeset for help on using the changeset viewer.