- Timestamp:
- Jun 10, 2015, 4:13:35 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- a8541d9
- Parents:
- b5c5684
- git-author:
- Rob Schluntz <rschlunt@…> (06/10/15 15:47:38)
- git-committer:
- Rob Schluntz <rschlunt@…> (06/10/15 16:13:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rb5c5684 rbfbf97f 10 10 // Created On : Sun May 17 12:17:01 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jun 10 1 5:32:16201513 // Update Count : 4512 // Last Modified On : Wed Jun 10 16:11:19 2015 13 // Update Count : 77 14 14 // 15 15 … … 37 37 virtual void visit( ObjectDecl *functionDecl ); 38 38 virtual void visit( TypeDecl *typeDecl ); 39 virtual void visit( ArrayType * at ); 39 40 40 41 virtual void visit( ExprStmt *exprStmt ); … … 157 158 initContext = new_type; 158 159 SymTab::Indexer::visit( objectDecl ); 159 160 if ( ArrayType * at = dynamic_cast< ArrayType * >( new_type ) ){ 161 if ( at->get_dimension() ) { 162 BasicType arrayLenType = BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ); 163 CastExpr *castExpr = new CastExpr( at->get_dimension(), arrayLenType.clone() ); 164 Expression *newExpr = findSingleExpression( castExpr, *this ); 165 delete at->get_dimension(); 166 at->set_dimension( newExpr ); 167 } 168 } 160 } 161 162 void Resolver::visit( ArrayType * at ) { 163 if ( at->get_dimension() ) { 164 BasicType arrayLenType = BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ); 165 CastExpr *castExpr = new CastExpr( at->get_dimension(), arrayLenType.clone() ); 166 Expression *newExpr = findSingleExpression( castExpr, *this ); 167 delete at->get_dimension(); 168 at->set_dimension( newExpr ); 169 170 } 171 Visitor::visit( at ); 169 172 } 170 173
Note: See TracChangeset
for help on using the changeset viewer.