Eliminate the Parameter type completely - now ParameterList is just

an overblown array of ParamDecl*'s that also keeps track of parenlocs
and has helper methods.
This commit is contained in:
Chris Lattner
2016-01-03 14:44:48 -08:00
parent a503269e2d
commit 6afe77d597
43 changed files with 362 additions and 513 deletions

View File

@@ -61,7 +61,6 @@ namespace swift {
class NameAliasType;
class EnumCaseDecl;
class EnumElementDecl;
struct Parameter;
class ParameterList;
class Pattern;
struct PrintOptions;
@@ -4198,12 +4197,6 @@ public:
/// The resulting source location will be valid if the argument name
/// was specified separately from the parameter name.
SourceLoc getArgumentNameLoc() const { return ArgumentNameLoc; }
/// Return the Parameter value corresponding to this ParamDecl.
Parameter &getParameter();
const Parameter &getParameter() const {
return const_cast<ParamDecl*>(this)->getParameter();
}
TypeLoc &getTypeLoc() { return typeLoc; }
TypeLoc getTypeLoc() const { return typeLoc; }
@@ -4631,7 +4624,10 @@ public:
///
/// Note that some functions don't have an implicit 'self' decl, for example,
/// free functions. In this case nullptr is returned.
ParamDecl *getImplicitSelfDecl() const;
const ParamDecl *getImplicitSelfDecl() const {
return const_cast<AbstractFunctionDecl*>(this)->getImplicitSelfDecl();
}
ParamDecl *getImplicitSelfDecl();
/// \brief Retrieve the set of parameters to a generic function, or null if
/// this function is not generic.