IntentTag concreteIntent(IntentTag existingIntent, Type* t) { if (existingIntent == INTENT_BLANK) { return blankIntentForType(t); } else if (existingIntent == INTENT_CONST) { return constIntentForType(t); } else { return existingIntent; } }
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; }
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; }