[all-+0] Add a new convention for setters: DefaultSetterConventions.

In a situation where normal arguments are +0, we want setters to still take
normal parameters at +1 since in most cases setters will be taking a parameter
that is being forwarded into to be store into a field.

Since this doesn't actually change the current ParameterConvention for setter
normal arguments, this is NFC.

rdar://34222540
This commit is contained in:
Michael Gottesman
2017-11-19 00:00:20 -08:00
parent 007898347e
commit a8b1917512
3 changed files with 29 additions and 0 deletions

View File

@@ -227,6 +227,10 @@ struct SILDeclRef {
bool isFunc() const {
return kind == Kind::Func;
}
/// True if the SILDeclRef references a setter function.
bool isSetter() const;
/// True if the SILDeclRef references a constructor entry point.
bool isConstructor() const {
return kind == Kind::Allocator || kind == Kind::Initializer;