Changeset 3b58d91 for src/ResolvExpr


Ignore:
Timestamp:
Sep 8, 2016, 10:51:07 AM (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:
cd14861
Parents:
4e7f0f1
Message:

add AST nodes TupleIndexExpr?, MemberTupleExpr?, MassAssignExpr?, and MultipleAssignExpr?, modify parser to produce nodes for field tuples, modify UntypedMemberExpr? to contain a list of members

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r4e7f0f1 r3b58d91  
    251251
    252252        template< typename StructOrUnionType >
    253         void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name ) {
     253        void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, Expression * member ) {
     254                NameExpr * nameExpr = safe_dynamic_cast< NameExpr * >( member );
     255                const std::string & name = nameExpr->get_name();
     256
    254257                std::list< Declaration* > members;
    255258                aggInst->lookup( name, members );
     
    839842                        renameTypes( alternatives.back().expr );
    840843                        if ( StructInstType *structInst = dynamic_cast< StructInstType* >( (*i)->get_type() ) ) {
    841                                 addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), "" );
     844                                NameExpr nameExpr( "" );
     845                                addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), &nameExpr );
    842846                        } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( (*i)->get_type() ) ) {
    843                                 addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), "" );
     847                                NameExpr nameExpr( "" );
     848                                addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), &nameExpr );
    844849                        } // if
    845850                } // for
  • src/ResolvExpr/AlternativeFinder.h

    r4e7f0f1 r3b58d91  
    7474          private:
    7575                /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member
    76                 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name );
     76                template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, Expression * member );
    7777                /// Adds alternatives for offsetof expressions, given the base type and name of the member
    7878                template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name );
Note: See TracChangeset for help on using the changeset viewer.