Changeset 3b58d91 for src/ResolvExpr
- Timestamp:
- Sep 8, 2016, 10:51:07 AM (8 years ago)
- 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
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r4e7f0f1 r3b58d91 251 251 252 252 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 254 257 std::list< Declaration* > members; 255 258 aggInst->lookup( name, members ); … … 839 842 renameTypes( alternatives.back().expr ); 840 843 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 ); 842 846 } 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 ); 844 849 } // if 845 850 } // for -
src/ResolvExpr/AlternativeFinder.h
r4e7f0f1 r3b58d91 74 74 private: 75 75 /// 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 ); 77 77 /// Adds alternatives for offsetof expressions, given the base type and name of the member 78 78 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name );
Note: See TracChangeset
for help on using the changeset viewer.