compiler/resolution/wrappers.cpp
/************************************* | **************************************
*                                                                             *
* The argument actualIdxToFormals[i] stores, for actual i (counting from 0),  *
* the corresponding formal argument.                                          *
* (This mapping is nontrivial when named arguments are used)                  *
*                                                                             *
************************************** | *************************************/
|
The argument actualIdxToFormals[i] stores, for actual i (counting from 0),
the corresponding formal argument.
(This mapping is nontrivial when named arguments are used)


| The argument actualIdxToFormals [ i ] stores for actual i ( counting from 0 ) the corresponding formal argument . ( This mapping is nontrivial when named arguments are used )
FnSymbol* wrapAndCleanUpActuals(FnSymbol*                fn,
                                CallInfo&                info,
                                std::vector<ArgSymbol*>  actualIdxToFormal,
                                bool                     fastFollowerChecks) {
  int       numActuals = static_cast<int>(actualIdxToFormal.size());
  FnSymbol* retval     = fn;
  if (isPromotionRequired(retval, info, actualIdxToFormal) == true) {
    retval = promotionWrap(retval, info, actualIdxToFormal, fastFollowerChecks);
  }
  if (numActuals < retval->numFormals()) {
    addDefaultsAndReorder(retval, info, actualIdxToFormal);
  } else {
    if (actualIdxToFormal.size() > 1) {
      reorderActuals(retval, info, actualIdxToFormal);
    }
  }
  if (info.actuals.n > 0) {
    coerceActuals(retval, info);
  }
  handleInIntents(retval, info);
  return retval;
}
FnSymbol * wrapAndCleanUpActuals ( FnSymbol * fn , CallInfo & info , std :: vector < ArgSymbol * > actualIdxToFormal , bool fastFollowerChecks ) { int numActuals = static_cast < int > ( actualIdxToFormal . size ( ) ) ; FnSymbol * retval = fn ; if ( isPromotionRequired ( retval , info , actualIdxToFormal ) == true ) { retval = promotionWrap ( retval , info , actualIdxToFormal , fastFollowerChecks ) ; } if ( numActuals < retval -> numFormals ( ) ) { addDefaultsAndReorder ( retval , info , actualIdxToFormal ) ; } else { if ( actualIdxToFormal . size ( ) > 1 ) { reorderActuals ( retval , info , actualIdxToFormal ) ; } } if ( info . actuals . n > 0 ) { coerceActuals ( retval , info ) ; } handleInIntents ( retval , info ) ; return retval ; }
|
The argument actualIdxToFormals[i] stores, for actual i (counting from 0),
the corresponding formal argument.
| The argument actualIdxToFormals [ i ] stores for actual i ( counting from 0 ) the corresponding formal argument .
// Note: promotionWrap will handle default args in the inner call // to the original function, and it will create a different promotion // wrapper for each set of default arguments needed. // If we don't have the right number of arguments, adjust the // call site to handle default arguments. // note: this handle default args and reordering // handle reordering only // handle coercion // in the event of promotion, coercion might be necessary // for non-promoted arguments. // handle 'in' intent