Changes in src/ArgTweak/FunctionFixer.cc [f1b1e4c:843054c2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ArgTweak/FunctionFixer.cc
rf1b1e4c r843054c2 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; 44 45 45 if ( NameExpr * function = dynamic_cast< NameExpr *>(untypedExpr->get_function() )) {46 if ( ( function = dynamic_cast< NameExpr *>(untypedExpr->get_function()) ) != 0 ) { 46 47 std::list < DeclarationWithType * > options; 47 48 index->lookupId ( function->get_name(), options ); 48 49 for ( std::list < DeclarationWithType * >::iterator i = options.begin(); i != options.end(); i++ ) { 49 if ( FunctionType * f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) ) { 50 FunctionType *f; 51 if ( ( f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) ) != 0 ) { 50 52 std::list < DeclarationWithType * > &pars = f->get_parameters(); 53 51 54 bool candidateExists ; 52 for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ ) {55 for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ ) 53 56 if ( ( candidateExists = align( f->get_parameters(), untypedExpr->get_args(), Matcher() ) ) ) break; 54 } 57 55 58 if ( ! candidateExists ) throw SemanticError("Error in function call"); 56 59 } // if
Note:
See TracChangeset
for help on using the changeset viewer.