Changeset f1b1e4c for src/ArgTweak
- Timestamp:
- Jun 1, 2016, 11:54:23 AM (8 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, with_gc
- Children:
- be945ac
- Parents:
- 70f89d00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ArgTweak/FunctionFixer.cc
r70f89d00 rf1b1e4c 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FunctionFixer.cc -- 7 // FunctionFixer.cc -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 42 42 Expression *FunctionFixer::mutate( UntypedExpr *untypedExpr ) throw ( SemanticError ) { 43 43 assert( untypedExpr != 0 ); 44 NameExpr *function;45 44 46 if ( ( function = dynamic_cast< NameExpr *>(untypedExpr->get_function()) ) != 0) {45 if ( NameExpr * function = dynamic_cast< NameExpr *>(untypedExpr->get_function() ) ) { 47 46 std::list < DeclarationWithType * > options; 48 47 index->lookupId ( function->get_name(), options ); 49 48 for ( std::list < DeclarationWithType * >::iterator i = options.begin(); i != options.end(); i++ ) { 50 FunctionType *f; 51 if ( ( f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) ) != 0 ) { 49 if ( FunctionType * f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) ) { 52 50 std::list < DeclarationWithType * > &pars = f->get_parameters(); 53 54 51 bool candidateExists ; 55 for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ ) 52 for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ ) { 56 53 if ( ( candidateExists = align( f->get_parameters(), untypedExpr->get_args(), Matcher() ) ) ) break; 57 54 } 58 55 if ( ! candidateExists ) throw SemanticError("Error in function call"); 59 56 } // if
Note: See TracChangeset
for help on using the changeset viewer.