14#ifndef LLVM_CLANG_EXTRACTAPI_EXTRACT_API_VISITOR_H
15#define LLVM_CLANG_EXTRACTAPI_EXTRACT_API_VISITOR_H
32#include "llvm/ADT/SmallString.h"
33#include "llvm/ADT/StringRef.h"
34#include "llvm/Support/Casting.h"
41template <
typename Derived>
144 const llvm::iterator_range<
166 Derived &getDerivedExtractAPIVisitor() {
167 return *
static_cast<Derived *
>(
this);
174 for (
const auto &BaseSpecifier :
Decl->bases()) {
178 if (
auto *BaseDecl = BaseSpecifier.getType()->getAsTagDecl()) {
185 if (BaseSpecifier.getType().getTypePtr()->isTemplateTypeParmType()) {
186 if (
auto *TTPTD = BaseSpecifier.getType()
195 Bases.emplace_back(BaseClass);
204 if (
Decl->isStruct())
211 if (
auto *OwningModule =
D.getImportedOwningModule())
212 return OwningModule->Name;
218 const auto *
Context = cast_if_present<Decl>(
D.getDeclContext());
235 if (
auto *ND = dyn_cast<NamedDecl>(&
D))
236 Name = ND->getName();
243 D.isEmbeddedInDeclarator();
248 if (!NewRecordContext)
250 auto *Tag =
D.getType()->getAsTagDecl();
253 if (
auto *
Record = llvm::dyn_cast_if_present<TagRecord>(
255 if (
Record->IsEmbeddedInVarDeclarator)
261template <
typename Derived>
264 if (isa<ParmVarDecl>(
Decl))
281 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
285 StringRef Name =
Decl->getName();
293 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
295 Context.getDiagnostics());
302 if (
Decl->isStaticDataMember()) {
305 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
307 SubHeading, Access, isInSystemHeader(
Decl));
311 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
313 SubHeading, isInSystemHeader(
Decl));
317 maybeMergeWithAnonymousTag(*
Decl, NewRecord);
323template <
typename Derived>
326 if (
const auto *Method = dyn_cast<CXXMethodDecl>(
Decl)) {
328 if (Method->getParent()->getDescribedClassTemplate() !=
nullptr)
332 for (
const auto &
P : Context.getParents(*Method)) {
333 if (
P.template get<CXXRecordDecl>())
338 if (isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method))
343 switch (
Decl->getTemplatedKind()) {
354 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
358 auto Name =
Decl->getNameAsString();
366 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
368 Context.getDiagnostics());
375 if (
Decl->getTemplateSpecializationInfo())
377 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
381 SubHeading, Signature, isInSystemHeader(
Decl));
385 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
388 Signature, isInSystemHeader(
Decl));
392template <
typename Derived>
394 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
403 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
405 Context.getDiagnostics());
416 if (
Decl->hasNameForLinkage()) {
417 StringRef Name =
Decl->getName();
419 Name = getTypedefName(
Decl);
422 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
424 SubHeading, isInSystemHeader(
Decl),
false);
429 ParentContainer = {};
433 getDerivedExtractAPIVisitor().recordEnumConstants(ParentContainer,
434 Decl->enumerators());
439template <
typename Derived>
442 getDerivedExtractAPIVisitor().VisitFunctionDecl(
Decl);
446template <
typename Derived>
449 getDerivedExtractAPIVisitor().VisitRecordDecl(
Decl);
453template <
typename Derived>
456 getDerivedExtractAPIVisitor().VisitCXXRecordDecl(
Decl);
460template <
typename Derived>
463 getDerivedExtractAPIVisitor().VisitCXXMethodDecl(
Decl);
467template <
typename Derived>
470 getDerivedExtractAPIVisitor().VisitClassTemplateSpecializationDecl(
Decl);
474template <
typename Derived>
478 getDerivedExtractAPIVisitor().VisitClassTemplatePartialSpecializationDecl(
483template <
typename Derived>
486 getDerivedExtractAPIVisitor().VisitVarTemplateDecl(
Decl);
490template <
typename Derived>
493 getDerivedExtractAPIVisitor().VisitVarTemplateSpecializationDecl(
Decl);
497template <
typename Derived>
501 getDerivedExtractAPIVisitor().VisitVarTemplatePartialSpecializationDecl(
Decl);
505template <
typename Derived>
508 getDerivedExtractAPIVisitor().VisitFunctionTemplateDecl(
Decl);
512template <
typename Derived>
515 getDerivedExtractAPIVisitor().VisitNamespaceDecl(
Decl);
519template <
typename Derived>
522 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
524 if (
Decl->isAnonymousNamespace())
526 StringRef Name =
Decl->getName();
534 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
536 Context.getDiagnostics());
544 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
546 SubHeading, isInSystemHeader(
Decl));
551template <
typename Derived>
553 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
557 StringRef Name =
Decl->getName();
559 Name = getTypedefName(
Decl);
567 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
569 Context.getDiagnostics());
579 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
581 SubHeading, isInSystemHeader(
Decl), isEmbeddedInVarDeclarator(*
Decl));
584 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
586 SubHeading, isInSystemHeader(
Decl), isEmbeddedInVarDeclarator(*
Decl));
591template <
typename Derived>
594 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl) ||
598 StringRef Name =
Decl->getName();
600 Name = getTypedefName(
Decl);
608 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
610 Context.getDiagnostics());
619 if (
Decl->getDescribedClassTemplate()) {
623 Decl->getDescribedClassTemplate()));
625 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
627 SubHeading,
Template(
Decl->getDescribedClassTemplate()), Access,
628 isInSystemHeader(
Decl));
631 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
634 isInSystemHeader(
Decl), isEmbeddedInVarDeclarator(*
Decl));
643template <
typename Derived>
646 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl) ||
650 if (isa<CXXConversionDecl>(
Decl))
652 if (isa<CXXConstructorDecl>(
Decl) || isa<CXXDestructorDecl>(
Decl))
661 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
663 Context.getDiagnostics());
670 Decl->getDescribedFunctionTemplate()) {
672 USR,
Decl->getNameAsString(), createHierarchyInformationForDecl(*
Decl),
679 }
else if (
Decl->getTemplateSpecializationInfo())
681 USR,
Decl->getNameAsString(), createHierarchyInformationForDecl(*
Decl),
685 SubHeading, Signature, Access, isInSystemHeader(
Decl));
686 else if (
Decl->isOverloadedOperator())
688 USR,
Decl->getNameAsString(), createHierarchyInformationForDecl(*
Decl),
691 SubHeading, Signature, Access, isInSystemHeader(
Decl));
692 else if (
Decl->isStatic())
694 USR,
Decl->getNameAsString(), createHierarchyInformationForDecl(*
Decl),
697 Signature, Access, isInSystemHeader(
Decl));
700 USR,
Decl->getNameAsString(), createHierarchyInformationForDecl(*
Decl),
703 Signature, Access, isInSystemHeader(
Decl));
708template <
typename Derived>
711 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl) ||
715 auto Name =
Decl->getNameAsString();
722 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
724 Context.getDiagnostics());
736 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
738 Signature, Access, isInSystemHeader(
Decl));
742template <
typename Derived>
745 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl) ||
749 auto Name =
Decl->getNameAsString();
756 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
758 Context.getDiagnostics());
769 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
771 Signature, Access, isInSystemHeader(
Decl));
775template <
typename Derived>
777 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
780 StringRef Name =
Decl->getName();
787 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
789 Context.getDiagnostics());
795 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
801template <
typename Derived>
804 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
807 StringRef Name =
Decl->getName();
814 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
816 Context.getDiagnostics());
824 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
827 isInSystemHeader(
Decl));
834template <
typename Derived>
838 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
841 StringRef Name =
Decl->getName();
848 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
850 Context.getDiagnostics());
856 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
859 isInSystemHeader(
Decl));
862 CTPSR->Bases = getBases(
Decl);
867template <
typename Derived>
870 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
874 StringRef Name =
Decl->getName();
882 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
884 Context.getDiagnostics());
892 Decl->getTemplatedDecl()));
899 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
905 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
911template <
typename Derived>
914 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
918 StringRef Name =
Decl->getName();
926 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
928 Context.getDiagnostics());
937 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
939 SubHeading, isInSystemHeader(
Decl));
943template <
typename Derived>
946 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
950 StringRef Name =
Decl->getName();
958 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
960 Context.getDiagnostics());
968 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
974template <
typename Derived>
977 if (isa<CXXMethodDecl>(
Decl->getTemplatedDecl()))
979 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
983 auto Name =
Decl->getNameAsString();
991 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
993 Context.getDiagnostics());
999 Decl->getTemplatedDecl());
1001 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1009template <
typename Derived>
1012 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
1016 StringRef Name =
Decl->getName();
1024 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
1026 Context.getDiagnostics());
1036 if (
const auto *SuperClassDecl =
Decl->getSuperClass())
1037 SuperClass = createSymbolReferenceForDecl(*SuperClassDecl);
1040 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1042 SubHeading, SuperClass, isInSystemHeader(
Decl));
1046 getDerivedExtractAPIVisitor().recordObjCMethods(InterfaceRecord,
1048 getDerivedExtractAPIVisitor().recordObjCProperties(InterfaceRecord,
1049 Decl->properties());
1050 getDerivedExtractAPIVisitor().recordObjCInstanceVariables(InterfaceRecord,
1052 getDerivedExtractAPIVisitor().recordObjCProtocols(InterfaceRecord,
1058template <
typename Derived>
1061 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
1065 StringRef Name =
Decl->getName();
1072 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
1074 Context.getDiagnostics());
1083 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1085 isInSystemHeader(
Decl));
1087 getDerivedExtractAPIVisitor().recordObjCMethods(ProtoRecord,
Decl->methods());
1088 getDerivedExtractAPIVisitor().recordObjCProperties(ProtoRecord,
1089 Decl->properties());
1090 getDerivedExtractAPIVisitor().recordObjCProtocols(ProtoRecord,
1096template <
typename Derived>
1100 if (isa<ObjCTypeParamDecl>(
Decl))
1106 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
1109 StringRef Name =
Decl->getName();
1113 if (
auto *
TagDecl =
Decl->getUnderlyingType()->getAsTagDecl()) {
1118 if (
auto *
Record = API.findRecordForUSR(TagUSR)) {
1120 LeadingFragments.
append(
"typedef",
1124 .
prepend(std::move(LeadingFragments))
1140 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
1142 Context.getDiagnostics());
1150 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1154 isInSystemHeader(
Decl));
1159template <
typename Derived>
1162 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
1165 StringRef Name =
Decl->getName();
1172 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
1174 Context.getDiagnostics());
1185 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1189 getDerivedExtractAPIVisitor().recordObjCMethods(CategoryRecord,
1191 getDerivedExtractAPIVisitor().recordObjCProperties(CategoryRecord,
1192 Decl->properties());
1193 getDerivedExtractAPIVisitor().recordObjCInstanceVariables(CategoryRecord,
1195 getDerivedExtractAPIVisitor().recordObjCProtocols(CategoryRecord,
1203template <
typename Derived>
1206 for (
const auto *Constant : Constants) {
1208 StringRef Name = Constant->getName();
1212 Context.getSourceManager().getPresumedLoc(Constant->getLocation());
1215 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Constant))
1217 Context.getDiagnostics());
1227 Comment,
Declaration, SubHeading, isInSystemHeader(Constant));
1231template <
typename Derived>
1234 if (isa<ObjCIvarDecl>(
Decl) || isa<ObjCAtDefsFieldDecl>(
Decl))
1237 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl))
1241 StringRef Name =
Decl->getName();
1248 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
1250 Context.getDiagnostics());
1263 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1265 SubHeading, Access, isInSystemHeader(
Decl));
1269 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1271 SubHeading, isInSystemHeader(
Decl));
1274 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1276 SubHeading, isInSystemHeader(
Decl));
1281 maybeMergeWithAnonymousTag(*
Decl, NewRecord);
1286template <
typename Derived>
1289 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(
Decl) ||
1293 auto Name =
Decl->getNameAsString();
1300 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Decl))
1302 Context.getDiagnostics());
1313 if (
Decl->isStatic())
1315 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1317 SubHeading, Signature, Access, isInSystemHeader(
Decl));
1320 USR, Name, createHierarchyInformationForDecl(*
Decl),
Loc,
1322 SubHeading, Signature, Access, isInSystemHeader(
Decl));
1329template <
typename Derived>
1333 for (
const auto *Method : Methods) {
1335 if (Method->isPropertyAccessor())
1338 auto Name = Method->getSelector().getAsString();
1342 Context.getSourceManager().getPresumedLoc(Method->getLocation());
1345 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Method))
1347 Context.getDiagnostics());
1357 if (Method->isInstanceMethod())
1359 USR, Name, createHierarchyInformationForDecl(*Method),
Loc,
1361 SubHeading, Signature, isInSystemHeader(Method));
1364 USR, Name, createHierarchyInformationForDecl(*Method),
Loc,
1366 SubHeading, Signature, isInSystemHeader(Method));
1370template <
typename Derived>
1374 for (
const auto *
Property : Properties) {
1375 StringRef Name =
Property->getName();
1379 Context.getSourceManager().getPresumedLoc(
Property->getLocation());
1382 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(
Property))
1384 Context.getDiagnostics());
1392 auto GetterName =
Property->getGetterName().getAsString();
1393 auto SetterName =
Property->getSetterName().getAsString();
1397 if (
Property->getPropertyAttributes() &
1403 USR, Name, createHierarchyInformationForDecl(*
Property),
Loc,
1407 GetterName, SetterName,
Property->isOptional(),
1411 USR, Name, createHierarchyInformationForDecl(*
Property),
Loc,
1415 GetterName, SetterName,
Property->isOptional(),
1420template <
typename Derived>
1423 const llvm::iterator_range<
1426 for (
const auto *Ivar : Ivars) {
1427 StringRef Name = Ivar->getName();
1432 Context.getSourceManager().getPresumedLoc(Ivar->getLocation());
1435 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Ivar))
1437 Context.getDiagnostics());
1446 USR, Name, createHierarchyInformationForDecl(*Ivar),
Loc,
1448 SubHeading, isInSystemHeader(Ivar));
1452template <
typename Derived>
1456 for (
const auto *Protocol : Protocols)
1457 Container->Protocols.emplace_back(createSymbolReferenceForDecl(*Protocol));
1464template <
typename Derived =
void>
1467 std::is_same_v<Derived, void>, ExtractAPIVisitor<>, Derived>> {
1479 if (
const auto *
Declarator = dyn_cast<DeclaratorDecl>(
D)) {
1480 const auto *TagTypeDecl =
Declarator->getType()->getAsTagDecl();
1481 if (TagTypeDecl && TagTypeDecl->isEmbeddedInDeclarator() &&
1482 TagTypeDecl->isCompleteDefinition())
This file defines the APIRecord-based structs and the APISet class.
Defines the clang::ASTContext interface.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
This file defines the Declaration Fragments related classes.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::MachO::Record Record
Defines the clang::Module class, which describes a module in the source code.
Defines the SourceManager interface.
Defines various enumerations that describe declaration and type specifiers.
This file defines the UnderlyingTypeResolver which is a helper type for resolving the undelrying type...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
const clang::PrintingPolicy & getPrintingPolicy() const
RawComment * getRawCommentForDeclNoCache(const Decl *D) const
Return the documentation comment attached to a given declaration, without looking into cache.
Represents a C++ constructor within a class.
Represents a C++ conversion function within a class.
Represents a C++ destructor within a class.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
Represents a class template specialization, which refers to a class template with a given set of temp...
Declaration of a C++20 concept.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
Decl::Kind getDeclKind() const
Decl - This represents one declaration (or definition), e.g.
ASTContext & getASTContext() const LLVM_READONLY
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
SourceLocation getLocation() const
bool isDefinedOutsideFunctionOrMethod() const
isDefinedOutsideFunctionOrMethod - This predicate returns true if this scoped decl is defined outside...
DeclContext * getDeclContext()
Represents a ValueDecl that came out of a declarator.
Information about one declarator, including the parsed type information and the identifier.
llvm::iterator_range< specific_decl_iterator< EnumConstantDecl > > enumerator_range
Represents a member of a struct/union/class.
Represents a function declaration or definition.
@ TK_MemberSpecialization
@ TK_DependentNonTemplate
@ TK_FunctionTemplateSpecialization
@ TK_DependentFunctionTemplateSpecialization
Declaration of a template function.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Represent a C++ namespace.
ObjCCategoryDecl - Represents a category declaration.
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
Represents an ObjC class declaration.
llvm::iterator_range< protocol_iterator > protocol_range
Represents an Objective-C protocol declaration.
Represents an unpacked "presumed" location which can be presented to the user.
A (possibly-)qualified type.
Represents a struct/union/class.
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
bool isInSystemHeader(SourceLocation Loc) const
Returns if a SourceLocation is in a system header.
Represents the declaration of a struct/union/class/enum.
bool isEmbeddedInDeclarator() const
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
The base class of all kinds of template declarations (e.g., class, function, etc.).
TemplateTypeParmDecl * getDecl() const
The base class of the type hierarchy.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
Represents a variable declaration or definition.
Declaration of a variable template.
Represents a variable template specialization, which refers to a variable template with a given set o...
bool generateUSRForDecl(const Decl *D, SmallVectorImpl< char > &Buf)
Generate a USR for a Decl, including the USR prefix.
The JSON file list parser is used to communicate input to InstallAPI.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ Property
The type of a property.
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
static AvailabilityInfo createFromDecl(const Decl *Decl)