17#ifndef LLVM_CLANG_AST_TYPE_H
18#define LLVM_CLANG_AST_TYPE_H
27 const auto *TT = dyn_cast<TagType>(CanonicalType);
28 if (!isa_and_present<RecordType, InjectedClassNameType>(TT))
30 auto *TD = TT->getOriginalDecl();
31 if (isa<RecordType>(TT) && !isa<CXXRecordDecl>(TD))
33 return cast<CXXRecordDecl>(TD)->getDefinitionOrSelf();
37 const auto *TT = cast<TagType>(CanonicalType);
38 return cast<CXXRecordDecl>(TT->getOriginalDecl())->getDefinitionOrSelf();
42 const auto *TT = dyn_cast<TagType>(CanonicalType);
43 if (!isa_and_present<RecordType, InjectedClassNameType>(TT))
45 return cast<RecordDecl>(TT->getOriginalDecl())->getDefinitionOrSelf();
49 const auto *TT = cast<TagType>(CanonicalType);
50 return cast<RecordDecl>(TT->getOriginalDecl())->getDefinitionOrSelf();
54 if (
const auto *TT = dyn_cast<EnumType>(CanonicalType))
60 return cast<EnumType>(CanonicalType)
66 if (
const auto *TT = dyn_cast<TagType>(CanonicalType))
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
static RecordDecl * getAsRecordDecl(QualType BaseType, HeuristicResolver &Resolver)
C Language Family Type Representation.
Represents a C++ struct/union/class.
EnumDecl * getDefinitionOrSelf() const
bool hasNonTrivialToPrimitiveCopyCUnion() const
Check if this is or contains a C union that is non-trivial to copy, which is a union that has a membe...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
bool hasNonTrivialToPrimitiveDestructCUnion() const
Check if this is or contains a C union that is non-trivial to destruct, which is a union that has a m...
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
Check if this is or contains a C union that is non-trivial to default-initialize, which is a union th...
Represents a struct/union/class.
Represents the declaration of a struct/union/class/enum.
TagDecl * getDefinitionOrSelf() const
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
CXXRecordDecl * castAsCXXRecordDecl() const
TagDecl * castAsTagDecl() const
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
RecordDecl * castAsRecordDecl() const
EnumDecl * castAsEnumDecl() const
EnumDecl * getAsEnumDecl() const
Retrieves the EnumDecl this type refers to.
The JSON file list parser is used to communicate input to InstallAPI.