Changeset de62360d for src/ResolvExpr
- Timestamp:
- Jun 24, 2015, 4:04:19 PM (10 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
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/ResolvExpr/AlternativeFinder.cc ¶
ra1d5d2a rde62360d 10 10 // Created On : Sat May 16 23:52:08 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 8 14:53:58201513 // Update Count : 1 412 // Last Modified On : Mon Jun 22 17:19:54 2015 13 // Update Count : 17 14 14 // 15 15 … … 545 545 NameExpr *fname; 546 546 if ( ( fname = dynamic_cast<NameExpr *>( untypedExpr->get_function())) 547 && ( fname->get_name() == std::string(" LabAddress")) ) {548 alternatives.push_back( Alternative( untypedExpr , env, Cost()) );547 && ( fname->get_name() == std::string("&&")) ) { 548 alternatives.push_back( Alternative( untypedExpr->clone(), env, Cost()) ); 549 549 return; 550 550 } -
TabularUnified 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.