19 #include "llvm/ADT/StringExtras.h" 21 using namespace clang;
30 case BuiltinType::Void:
33 case BuiltinType::Bool:
36 case BuiltinType::Char_U:
39 case BuiltinType::UChar:
42 case BuiltinType::UShort:
45 case BuiltinType::UInt:
48 case BuiltinType::ULong:
51 case BuiltinType::ULongLong:
54 case BuiltinType::UInt128:
57 case BuiltinType::Char_S:
60 case BuiltinType::SChar:
63 case BuiltinType::WChar_S:
64 case BuiltinType::WChar_U:
67 case BuiltinType::Short:
70 case BuiltinType::Int:
73 case BuiltinType::Long:
76 case BuiltinType::LongLong:
79 case BuiltinType::Int128:
82 case BuiltinType::Half:
85 case BuiltinType::Float:
88 case BuiltinType::Double:
91 case BuiltinType::LongDouble:
94 case BuiltinType::Float16:
97 case BuiltinType::Float128:
100 case BuiltinType::NullPtr:
103 case BuiltinType::Char16:
106 case BuiltinType::Char32:
109 case BuiltinType::Overload:
112 case BuiltinType::BoundMember:
115 case BuiltinType::PseudoObject:
118 case BuiltinType::Dependent:
121 case BuiltinType::UnknownAny:
124 case BuiltinType::ARCUnbridgedCast:
127 case BuiltinType::ObjCId:
130 case BuiltinType::ObjCClass:
133 case BuiltinType::ObjCSel:
136 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 137 case BuiltinType::Id: \ 138 ID = PREDEF_TYPE_##Id##_ID; \ 140 #include "clang/Basic/OpenCLImageTypes.def" 141 case BuiltinType::OCLSampler:
144 case BuiltinType::OCLEvent:
147 case BuiltinType::OCLClkEvent:
150 case BuiltinType::OCLQueue:
153 case BuiltinType::OCLReserveID:
156 case BuiltinType::BuiltinFn:
159 case BuiltinType::OMPArraySection:
172 for (
unsigned I = 0; I != N; ++I)
174 R = llvm::HashString(II->getName(), R);
182 case Decl::TranslationUnit:
183 case Decl::ExternCContext:
184 case Decl::Namespace:
185 case Decl::LinkageSpec:
198 case Decl::CXXRecord:
199 case Decl::ClassTemplateSpecialization:
200 case Decl::ClassTemplatePartialSpecialization:
205 case Decl::CXXMethod:
206 case Decl::CXXConstructor:
207 case Decl::CXXDestructor:
208 case Decl::CXXConversion:
209 case Decl::ObjCMethod:
214 case Decl::ObjCCategory:
215 case Decl::ObjCCategoryImpl:
216 case Decl::ObjCImplementation:
219 case Decl::ObjCProtocol:
228 case Decl::ObjCInterface:
232 llvm_unreachable(
"Unhandled DeclContext in AST reader");
235 llvm_unreachable(
"Unhandled decl kind");
239 switch (static_cast<Decl::Kind>(Kind)) {
240 case Decl::TranslationUnit:
241 case Decl::ExternCContext:
245 case Decl::Namespace:
246 case Decl::NamespaceAlias:
248 case Decl::TypeAlias:
251 case Decl::CXXRecord:
252 case Decl::ClassTemplateSpecialization:
253 case Decl::ClassTemplatePartialSpecialization:
254 case Decl::VarTemplateSpecialization:
255 case Decl::VarTemplatePartialSpecialization:
257 case Decl::CXXDeductionGuide:
258 case Decl::CXXMethod:
259 case Decl::CXXConstructor:
260 case Decl::CXXDestructor:
261 case Decl::CXXConversion:
262 case Decl::UsingShadow:
263 case Decl::ConstructorUsingShadow:
265 case Decl::FunctionTemplate:
266 case Decl::ClassTemplate:
267 case Decl::VarTemplate:
268 case Decl::TypeAliasTemplate:
269 case Decl::ObjCProtocol:
270 case Decl::ObjCInterface:
275 case Decl::UsingDirective:
277 case Decl::UnresolvedUsingTypename:
278 case Decl::TemplateTypeParm:
279 case Decl::EnumConstant:
280 case Decl::UnresolvedUsingValue:
281 case Decl::IndirectField:
283 case Decl::MSProperty:
285 case Decl::ObjCAtDefsField:
286 case Decl::NonTypeTemplateParm:
287 case Decl::TemplateTemplateParm:
289 case Decl::UsingPack:
290 case Decl::ObjCMethod:
291 case Decl::ObjCCategory:
292 case Decl::ObjCCategoryImpl:
293 case Decl::ObjCImplementation:
294 case Decl::ObjCProperty:
295 case Decl::ObjCCompatibleAlias:
296 case Decl::LinkageSpec:
298 case Decl::ObjCPropertyImpl:
299 case Decl::PragmaComment:
300 case Decl::PragmaDetectMismatch:
301 case Decl::FileScopeAsm:
302 case Decl::AccessSpec:
304 case Decl::FriendTemplate:
305 case Decl::StaticAssert:
308 case Decl::ClassScopeFunctionSpecialization:
310 case Decl::OMPThreadPrivate:
311 case Decl::OMPCapturedExpr:
312 case Decl::OMPDeclareReduction:
313 case Decl::BuiltinTemplate:
314 case Decl::Decomposition:
320 case Decl::ImplicitParam:
322 case Decl::ObjCTypeParam:
326 llvm_unreachable(
"Unhandled declaration kind");
340 if (
auto *FD = dyn_cast<FunctionDecl>(D))
341 return !FD->getDescribedFunctionTemplate();
342 if (
auto *RD = dyn_cast<CXXRecordDecl>(D))
343 return !RD->getDescribedClassTemplate();
350 return isa<TagDecl>(D) || isa<FieldDecl>(D);
The ObjC 'SEL' type.
Smart pointer class that efficiently represents Objective-C method names.
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
TagDecl * getDefinition() const
getDefinition - Returns the TagDecl that actually defines this struct/union/class/enum.
The '_Float16' type.
The 'unsigned int' type.
The (signed) 'long long' type.
The 'bool' or '_Bool' type.
The 'unknown any' placeholder type.
The placeholder type for builtin functions.
The 'float' type.
ARC's unbridged-cast placeholder type.
The '__int128_t' type.
The C++ 'char32_t' type.
const DeclContext * getDefinitiveDeclContext(const DeclContext *DC)
Retrieve the "definitive" declaration that provides all of the visible entries for the given declarat...
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
One of these records is kept for each identifier that is lexed.
The 'char' type, when it is signed.
The 'unsigned long' type.
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
The 'unsigned short' type.
Represents an Objective-C protocol declaration.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
The type of 'nullptr'.
The placeholder type for OpenMP array section.
The '__uint128_t' type.
The 'char' type, when it is unsigned.
The placeholder type for overloaded function sets.
The OpenCL 'half' / ARM NEON __fp16 type.
The 'long double' type.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
unsigned getNumArgs() const
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so...
The placeholder type for bound member functions.
The 'unsigned long long' type.
Decl::Kind getDeclKind() const
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
TagDecl - Represents the declaration of a struct/union/class/enum.
The 'unsigned char' type.
The (signed) 'long' type.
The (signed) 'short' type.
TypeIdx TypeIdxFromBuiltin(const BuiltinType *BT)
The 'signed char' type.
unsigned ComputeHash(Selector Sel)
The ObjC 'id' type.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The placeholder type for dependent types.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
The C++ 'char16_t' type.
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
This class is used for builtin types like 'int'.
The 'double' type.
The (signed) 'int' type.
The C++ 'wchar_t' type.
The ObjC 'Class' type.
NamedDecl - This represents a decl with a name.
virtual ~ASTDeserializationListener()
A type index; the type ID with the qualifier bits removed.
The pseudo-object placeholder type.
The '__float128' type.