[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

@@ -484,6 +484,12 @@ FuncDecl *SILDeclRef::getFuncDecl() const {
return dyn_cast<FuncDecl>(getDecl());
}
bool SILDeclRef::isSetter() const {
if (!hasFuncDecl())
return false;
return getFuncDecl()->isSetter();
}
AbstractFunctionDecl *SILDeclRef::getAbstractFunctionDecl() const {
return dyn_cast<AbstractFunctionDecl>(getDecl());
}