compiler/resolution/preFold.cpp
/*
  Helper function for creating or finding the parent class for a given
  function type specified by the type signature.  The last type given
  in the signature is the return type, the remainder represent arguments
  to the function.
*/
Helper function for creating or finding the parent class for a given
function type specified by the type signature.  The last type given
in the signature is the return type, the remainder represent arguments
to the function.
Helper function for creating or finding the parent class for a given function type specified by the type signature . The last type given in the signature is the return type the remainder represent arguments to the function .
static AggregateType* createOrFindFunTypeFromAnnotation(AList&     argList,
                                                        CallExpr*  call) {
  AggregateType* parent      = NULL;
  SymExpr*       retTail     = toSymExpr(argList.tail);
  Type*          retType     = retTail->symbol()->type;
  std::string    parent_name = buildParentName(argList, false, retType);
  if (functionTypeMap.find(parent_name) != functionTypeMap.end()) {
    parent = functionTypeMap[parent_name].first;
  } else {
    FnSymbol* parentMethod = NULL;
    parent       = createAndInsertFunParentClass(call,
                                                 parent_name.c_str());
    parentMethod = createAndInsertFunParentMethod(call,
                                                  parent,
                                                  argList,
                                                  false,
                                                  retType);
    functionTypeMap[parent_name] = std::pair<AggregateType*,
                                             FnSymbol*>(parent, parentMethod);
  }
  return parent;
}
static AggregateType * createOrFindFunTypeFromAnnotation ( AList & argList , CallExpr * call ) { AggregateType * parent = NULL ; SymExpr * retTail = toSymExpr ( argList . tail ) ; Type * retType = retTail -> symbol ( ) -> type ; std :: string parent_name = buildParentName ( argList , false , retType ) ; if ( functionTypeMap . find ( parent_name ) != functionTypeMap . end ( ) ) { parent = functionTypeMap [ parent_name ] . first ; } else { FnSymbol * parentMethod = NULL ; parent = createAndInsertFunParentClass ( call , parent_name . c_str ( ) ) ; parentMethod = createAndInsertFunParentMethod ( call , parent , argList , false , retType ) ; functionTypeMap [ parent_name ] = std :: pair < AggregateType * , FnSymbol * > ( parent , parentMethod ) ; } return parent ; }
Helper function for creating or finding the parent class for a given
function type specified by the type signature.
Helper function for creating or finding the parent class for a given function type specified by the type signature .