@@ -990,7 +990,7 @@ FunctionType::Linkage FunctionType::determineLinkage(FnSymbol* fn) {
990990static FormalVec collectFormals (FnSymbol* fn) {
991991 FormalVec ret;
992992 for_formals (f, fn) {
993- FunctionType::Formal info = { f->qual , f->type , f->intent , f->name };
993+ FunctionType::Formal info = { f->qual , f->type , f->intent , f->name , f-> flags };
994994 ret.push_back (std::move (info));
995995 }
996996 return ret;
@@ -1047,14 +1047,14 @@ FunctionType* FunctionType::getAsExtern() const {
10471047
10481048FunctionType::Formal FunctionType::constructErrorHandlingFormal () {
10491049 auto t = getDecoratedClass (dtError, ClassTypeDecorator::UNMANAGED_NILABLE);
1050- return { QUAL_REF, t, INTENT_REF, " error_out" };
1050+ return { QUAL_REF, t, INTENT_REF, " error_out" , 0 };
10511051}
10521052
10531053std::array<FunctionType::Formal, 2 >
10541054FunctionType::constructLineFileInfoFormals () {
10551055 std::array<Formal, 2 > ret = {{
1056- Formal (QUAL_CONST_VAL, dtInt[INT_SIZE_DEFAULT], INTENT_CONST_IN, " _ln " ),
1057- Formal (QUAL_CONST_VAL, dtInt[INT_SIZE_32], INTENT_CONST_IN, " _fn " )
1056+ Formal (QUAL_CONST_VAL, dtInt[INT_SIZE_DEFAULT], INTENT_CONST_IN, astr__ln, 0 ),
1057+ Formal (QUAL_CONST_VAL, dtInt[INT_SIZE_32], INTENT_CONST_IN, astr__fn, 0 ),
10581058 }};
10591059
10601060 return ret;
@@ -1193,7 +1193,7 @@ functionTypeStreamlineFormal(const FunctionType::Formal& f) {
11931193 auto type = functionTypeStreamlineType (qual, f.type ());
11941194 const char * name = " " ;
11951195
1196- return { qual, type, intent, name };
1196+ return { qual, type, intent, name, f. flags () };
11971197}
11981198
11991199static void
@@ -1300,7 +1300,7 @@ FunctionType* FunctionType::getWithWidenedComponents() const {
13001300 auto qt1 = f->qualType ();
13011301 auto qt2 = widenType (qt1);
13021302
1303- Formal newFormal = { qt2.getQual (), qt2.type (), f->intent (), f->name () };
1303+ Formal newFormal = { qt2.getQual (), qt2.type (), f->intent (), f->name (), f-> flags () };
13041304 newFormals.push_back (std::move (newFormal));
13051305 change = change || qt1 != qt2;
13061306 }
@@ -1570,8 +1570,8 @@ size_t FunctionType::hash() const {
15701570}
15711571
15721572FunctionType::Formal::Formal (Qualifier qual, Type* type, IntentTag intent,
1573- const char * name)
1574- : qual_(qual), type_(type), intent_(intent) {
1573+ const char * name, FlagSet flags )
1574+ : qual_(qual), type_(type), intent_(intent), name_( nullptr ), flags_(flags) {
15751575 name_ = (name && 0 != strcmp (name, " " )) ? astr (name) : astr (" _" );
15761576}
15771577
@@ -1620,6 +1620,13 @@ bool FunctionType::Formal::isRef() const {
16201620 return qualType ().isRef ();
16211621}
16221622
1623+ bool FunctionType::Formal::isRetArg () const {
1624+ return flags_[FLAG_RETARG];
1625+ }
1626+ FlagSet FunctionType::Formal::flags () const {
1627+ return flags_;
1628+ }
1629+
16231630bool FunctionType::Formal::isNamed () const {
16241631 return name_ && 0 != strcmp (name_, " " ) && 0 != strcmp (name_, " _" );
16251632}
0 commit comments