Changeset de62360d for src/ResolvExpr/Resolver.cc
- Timestamp:
- Jun 24, 2015, 4:04:19 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:
- 94e0864d
- Parents:
- a1d5d2a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
ra1d5d2a rde62360d 10 10 // Created On : Sun May 17 12:17:01 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 7 21:50:37201513 // Update Count : 2312 // Last Modified On : Wed Jun 24 15:47:16 2015 13 // Update Count : 50 14 14 // 15 15 … … 45 45 virtual void visit( ChooseStmt *switchStmt ); 46 46 virtual void visit( CaseStmt *caseStmt ); 47 virtual void visit( BranchStmt *branchStmt ); 47 48 virtual void visit( ReturnStmt *returnStmt ); 48 49 … … 260 261 void Resolver::visit( CaseStmt *caseStmt ) { 261 262 Visitor::visit( caseStmt ); 263 } 264 265 void Resolver::visit( BranchStmt *branchStmt ) { 266 // must resolve the argument for a computed goto 267 if ( branchStmt->get_type() == BranchStmt::Goto ) { // check for computed goto statement 268 if ( NameExpr * arg = dynamic_cast< NameExpr * >( branchStmt->get_computedTarget() ) ) { 269 VoidType v = Type::Qualifiers(); // cast to void * for the alternative finder 270 PointerType pt( Type::Qualifiers(), v.clone() ); 271 CastExpr * castExpr = new CastExpr( arg, pt.clone() ); 272 Expression * newExpr = findSingleExpression( castExpr, *this ); // find best expression 273 branchStmt->set_target( newExpr ); 274 } // if 275 } // if 262 276 } 263 277
Note: See TracChangeset
for help on using the changeset viewer.