AST: support @_effects attribute with custom strings.

In addition to the predefined cases,  like "readnone", "readonly", etc. support providing a custom string, which will be parsed later.
Also, allow multiple effects attributes to be put onto a function.
This commit is contained in:
Erik Eckstein
2021-09-24 09:56:26 +02:00
parent 67c2b75b54
commit beb2bd2a96
13 changed files with 128 additions and 42 deletions

View File

@@ -727,18 +727,6 @@ bool SILDeclRef::isAlwaysInline() const {
return false;
}
bool SILDeclRef::hasEffectsAttribute() const {
if (!hasDecl())
return false;
return getDecl()->getAttrs().hasAttribute<EffectsAttr>();
}
EffectsKind SILDeclRef::getEffectsAttribute() const {
assert(hasEffectsAttribute());
EffectsAttr *MA = getDecl()->getAttrs().getAttribute<EffectsAttr>();
return MA->getKind();
}
bool SILDeclRef::isAnyThunk() const {
return isForeignToNativeThunk() ||
isNativeToForeignThunk() ||