コード例 #1
0
IntentTag concreteIntent(IntentTag existingIntent, Type* t) {
  if (existingIntent == INTENT_BLANK) {
    return blankIntentForType(t);
  } else if (existingIntent == INTENT_CONST) {
    return constIntentForType(t);
  } else {
    return existingIntent;
  }
}
コード例 #2
0
ArgSymbol* ReturnByRef::addFormal(FnSymbol* fn)
{
  SET_LINENO(fn);

  Type*          type    = fn->retType;
  AggregateType* refType = type->refType;
  IntentTag      intent  = blankIntentForType(refType);
  ArgSymbol*     formal  = new ArgSymbol(intent, "_retArg", refType);

  fn->insertFormalAtTail(formal);

  return formal;
}
コード例 #3
0
ArgSymbol* ReturnByRef::addFormal(FnSymbol* fn)
{
  SET_LINENO(fn);

  Type*          type    = fn->retType;
  AggregateType* refType = type->refType;
  IntentTag      intent  = blankIntentForType(refType);
  // Note: other code does strcmps against the name _retArg
  ArgSymbol*     formal  = new ArgSymbol(intent, "_retArg", refType);
  formal->addFlag(FLAG_RETARG);

  fn->insertFormalAtTail(formal);
  fn->addFlag(FLAG_FN_RETARG);

  return formal;
}