Changeset c20b0fea
- Timestamp:
- Feb 2, 2018, 3:46:29 PM (7 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:
- 11b7028
- Parents:
- 20cba76
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/InstantiateGeneric.cc
r20cba76 rc20b0fea 476 476 DeclarationWithType * field = strict_dynamic_cast< DeclarationWithType * >( member ); 477 477 MemberExpr * ret = new MemberExpr( field, memberExpr->aggregate->clone() ); 478 ResolvExpr::adjustExprType( ret->result ); // pointer decay 478 479 std::swap( ret->env, memberExpr->env ); 479 480 delete memberExpr; -
src/ResolvExpr/AdjustExprType.cc
r20cba76 rc20b0fea 24 24 class AdjustExprType : public WithShortCircuiting { 25 25 public: 26 AdjustExprType( const TypeEnvironment & env, const SymTab::Indexer &indexer );26 AdjustExprType( const TypeEnvironment & env, const SymTab::Indexer & indexer ); 27 27 void premutate( VoidType * ) { visit_children = false; } 28 28 void premutate( BasicType * ) { visit_children = false; } … … 45 45 46 46 private: 47 const TypeEnvironment & env;48 const SymTab::Indexer & indexer;47 const TypeEnvironment & env; 48 const SymTab::Indexer & indexer; 49 49 }; 50 50 … … 53 53 Type *newType = type->acceptMutator( adjuster ); 54 54 type = newType; 55 } 56 57 void adjustExprType( Type *& type ) { 58 TypeEnvironment env; 59 SymTab::Indexer indexer; 60 adjustExprType( type, env, indexer ); 55 61 } 56 62 -
src/ResolvExpr/typeops.h
r20cba76 rc20b0fea 55 55 /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function 56 56 void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ); 57 58 /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer 59 void adjustExprType( Type *& type ); 57 60 58 61 template< typename ForwardIterator >
Note: See TracChangeset
for help on using the changeset viewer.