Changeset 40e636a for src/ResolvExpr
- Timestamp:
- Jul 21, 2016, 11:19:24 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- b81adcc4
- Parents:
- 5f98ce5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r5f98ce5 r40e636a 42 42 43 43 virtual void visit( ArrayType * at ); 44 virtual void visit( PointerType * at ); 44 45 45 46 virtual void visit( ExprStmt *exprStmt ); … … 60 61 private: 61 62 typedef std::list< Initializer * >::iterator InitIterator; 63 64 template< typename PtrType > 65 void handlePtrType( PtrType * type ); 62 66 63 67 void resolveAggrInit( AggregateDecl *, InitIterator &, InitIterator & ); … … 193 197 } 194 198 199 template< typename PtrType > 200 void Resolver::handlePtrType( PtrType * type ) { 201 if ( type->get_dimension() ) { 202 CastExpr *castExpr = new CastExpr( type->get_dimension(), SymTab::SizeType->clone() ); 203 Expression *newExpr = findSingleExpression( castExpr, *this ); 204 delete type->get_dimension(); 205 type->set_dimension( newExpr ); 206 } 207 } 208 195 209 void Resolver::visit( ArrayType * at ) { 196 if ( at->get_dimension() ) { 197 CastExpr *castExpr = new CastExpr( at->get_dimension(), SymTab::SizeType->clone() ); 198 Expression *newExpr = findSingleExpression( castExpr, *this ); 199 delete at->get_dimension(); 200 at->set_dimension( newExpr ); 201 } 210 handlePtrType( at ); 202 211 Visitor::visit( at ); 212 } 213 214 void Resolver::visit( PointerType * pt ) { 215 handlePtrType( pt ); 216 Visitor::visit( pt ); 203 217 } 204 218
Note: See TracChangeset
for help on using the changeset viewer.