Esempio n. 1
0
void ReturnByRef::apply()
{
  RefMap           map;
  RefMap::iterator iter;

  returnByRefCollectCalls(map);

  for (iter = map.begin(); iter != map.end(); iter++)
    iter->second->transform();

  for (int i = 0; i < virtualMethodTable.n; i++)
  {
    if (virtualMethodTable.v[i].key)
    {
      int  numFns = virtualMethodTable.v[i].value->n;

      for (int j = 0; j < numFns; j++)
      {
        FnSymbol* fn = virtualMethodTable.v[i].value->v[j];

        if (isTransformableFunction(fn))
          transformFunction(fn);
      }
    }
  }
}
Esempio n. 2
0
void ReturnByRef::apply()
{
  RefMap           map;
  RefMap::iterator iter;
  FnSet            asgnUpdates;

  returnByRefCollectCalls(map, asgnUpdates);

  for (iter = map.begin(); iter != map.end(); iter++)
    iter->second->transform();

  for_set(FnSymbol, fn, asgnUpdates)
    updateAssignments(fn);

  for (int i = 0; i < virtualMethodTable.n; i++)
  {
    if (virtualMethodTable.v[i].key)
    {
      int  numFns = virtualMethodTable.v[i].value->n;

      for (int j = 0; j < numFns; j++)
      {
        FnSymbol* fn = virtualMethodTable.v[i].value->v[j];
        TransformationKind tfKind = transformableFunctionKind(fn);

        if (tfKind == TF_FULL)
          transformFunction(fn);
        else if (tfKind == TF_ASGN)
          updateAssignments(fn);
      }
    }
  }
}