AST: Introduce and use ValueDecl::isAsync

This commit is contained in:
Anthony Latsis
2025-03-20 00:24:46 +00:00
parent 487d3b4ae7
commit 6512aa1f5a
10 changed files with 68 additions and 79 deletions

View File

@@ -451,11 +451,8 @@ static bool initDocEntityInfo(const Decl *D,
Info.IsUnavailable = D->isUnavailable();
Info.IsDeprecated = D->isDeprecated();
Info.IsOptional = D->getAttrs().hasAttribute<OptionalAttr>();
if (auto *AFD = dyn_cast<AbstractFunctionDecl>(D)) {
Info.IsAsync = AFD->hasAsync();
} else if (auto *Storage = dyn_cast<AbstractStorageDecl>(D)) {
if (auto *Getter = Storage->getAccessor(AccessorKind::Get))
Info.IsAsync = Getter->hasAsync();
if (auto *valueDecl = dyn_cast<ValueDecl>(D)) {
Info.IsAsync = valueDecl->isAsync();
}
if (!IsRef) {