19 #include "llvm/Support/DJB.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::ShortAccum:
97 case BuiltinType::Accum:
100 case BuiltinType::LongAccum:
103 case BuiltinType::UShortAccum:
106 case BuiltinType::UAccum:
109 case BuiltinType::ULongAccum:
112 case BuiltinType::ShortFract:
115 case BuiltinType::Fract:
118 case BuiltinType::LongFract:
121 case BuiltinType::UShortFract:
124 case BuiltinType::UFract:
127 case BuiltinType::ULongFract:
130 case BuiltinType::SatShortAccum:
133 case BuiltinType::SatAccum:
136 case BuiltinType::SatLongAccum:
139 case BuiltinType::SatUShortAccum:
142 case BuiltinType::SatUAccum:
145 case BuiltinType::SatULongAccum:
148 case BuiltinType::SatShortFract:
151 case BuiltinType::SatFract:
154 case BuiltinType::SatLongFract:
157 case BuiltinType::SatUShortFract:
160 case BuiltinType::SatUFract:
163 case BuiltinType::SatULongFract:
166 case BuiltinType::Float16:
169 case BuiltinType::Float128:
172 case BuiltinType::NullPtr:
175 case BuiltinType::Char8:
178 case BuiltinType::Char16:
181 case BuiltinType::Char32:
184 case BuiltinType::Overload:
187 case BuiltinType::BoundMember:
190 case BuiltinType::PseudoObject:
193 case BuiltinType::Dependent:
196 case BuiltinType::UnknownAny:
199 case BuiltinType::ARCUnbridgedCast:
202 case BuiltinType::ObjCId:
205 case BuiltinType::ObjCClass:
208 case BuiltinType::ObjCSel:
211 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 212 case BuiltinType::Id: \ 213 ID = PREDEF_TYPE_##Id##_ID; \ 215 #include "clang/Basic/OpenCLImageTypes.def" 216 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ 217 case BuiltinType::Id: \ 218 ID = PREDEF_TYPE_##Id##_ID; \ 220 #include "clang/Basic/OpenCLExtensionTypes.def" 221 case BuiltinType::OCLSampler:
224 case BuiltinType::OCLEvent:
227 case BuiltinType::OCLClkEvent:
230 case BuiltinType::OCLQueue:
233 case BuiltinType::OCLReserveID:
236 case BuiltinType::BuiltinFn:
239 case BuiltinType::OMPArraySection:
252 for (
unsigned I = 0; I != N; ++I)
254 R = llvm::djbHash(II->getName(), R);
262 case Decl::TranslationUnit:
263 case Decl::ExternCContext:
264 case Decl::Namespace:
265 case Decl::LinkageSpec:
278 case Decl::CXXRecord:
279 case Decl::ClassTemplateSpecialization:
280 case Decl::ClassTemplatePartialSpecialization:
285 case Decl::CXXMethod:
286 case Decl::CXXConstructor:
287 case Decl::CXXDestructor:
288 case Decl::CXXConversion:
289 case Decl::ObjCMethod:
294 case Decl::ObjCCategory:
295 case Decl::ObjCCategoryImpl:
296 case Decl::ObjCImplementation:
299 case Decl::ObjCProtocol:
308 case Decl::ObjCInterface:
312 llvm_unreachable(
"Unhandled DeclContext in AST reader");
315 llvm_unreachable(
"Unhandled decl kind");
319 switch (static_cast<Decl::Kind>(Kind)) {
320 case Decl::TranslationUnit:
321 case Decl::ExternCContext:
325 case Decl::Namespace:
326 case Decl::NamespaceAlias:
328 case Decl::TypeAlias:
331 case Decl::CXXRecord:
332 case Decl::ClassTemplateSpecialization:
333 case Decl::ClassTemplatePartialSpecialization:
334 case Decl::VarTemplateSpecialization:
335 case Decl::VarTemplatePartialSpecialization:
337 case Decl::CXXDeductionGuide:
338 case Decl::CXXMethod:
339 case Decl::CXXConstructor:
340 case Decl::CXXDestructor:
341 case Decl::CXXConversion:
342 case Decl::UsingShadow:
343 case Decl::ConstructorUsingShadow:
345 case Decl::FunctionTemplate:
346 case Decl::ClassTemplate:
347 case Decl::VarTemplate:
348 case Decl::TypeAliasTemplate:
349 case Decl::ObjCProtocol:
350 case Decl::ObjCInterface:
355 case Decl::UsingDirective:
357 case Decl::UnresolvedUsingTypename:
358 case Decl::TemplateTypeParm:
359 case Decl::EnumConstant:
360 case Decl::UnresolvedUsingValue:
361 case Decl::IndirectField:
363 case Decl::MSProperty:
365 case Decl::ObjCAtDefsField:
366 case Decl::NonTypeTemplateParm:
367 case Decl::TemplateTemplateParm:
369 case Decl::UsingPack:
370 case Decl::ObjCMethod:
371 case Decl::ObjCCategory:
372 case Decl::ObjCCategoryImpl:
373 case Decl::ObjCImplementation:
374 case Decl::ObjCProperty:
375 case Decl::ObjCCompatibleAlias:
376 case Decl::LinkageSpec:
378 case Decl::ObjCPropertyImpl:
379 case Decl::PragmaComment:
380 case Decl::PragmaDetectMismatch:
381 case Decl::FileScopeAsm:
382 case Decl::AccessSpec:
384 case Decl::FriendTemplate:
385 case Decl::StaticAssert:
388 case Decl::ClassScopeFunctionSpecialization:
390 case Decl::OMPThreadPrivate:
391 case Decl::OMPRequires:
392 case Decl::OMPCapturedExpr:
393 case Decl::OMPDeclareReduction:
394 case Decl::BuiltinTemplate:
395 case Decl::Decomposition:
401 case Decl::ImplicitParam:
403 case Decl::ObjCTypeParam:
407 llvm_unreachable(
"Unhandled declaration kind");
421 if (
auto *FD = dyn_cast<FunctionDecl>(D))
422 return !FD->getDescribedFunctionTemplate();
423 if (
auto *RD = dyn_cast<CXXRecordDecl>(D))
424 return !RD->getDescribedClassTemplate();
433 if (
auto *VD = dyn_cast<VarDecl>(D))
434 return VD->isStaticLocal();
436 return isa<TagDecl>(D) || isa<BlockDecl>(D);
444 return isa<TagDecl>(D) || isa<FieldDecl>(D);
The ObjC 'SEL' type.
The 'unsigned _Accum' type.
The 'unsigned short _Fract' 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
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.
constexpr XRayInstrMask Function
The 'short _Fract' type.
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
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.
The '_Sat unsigned _Accum' type.
The 'unsigned long _Fract' type.
The 'long _Fract' type.
The 'short _Accum' type.
The 'long _Accum' type.
The 'unsigned short _Accum' 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 '_Sat short _Fract' type.
The 'unsigned long _Accum' type.
The type of 'nullptr'.
The '_Sat unsigned long _Fract' type.
The placeholder type for OpenMP array section.
The '__uint128_t' type.
The 'char' type, when it is unsigned.
The '_Sat long _Fract' type.
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 isFunctionOrMethod() const
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 '_Sat unsigned long _Accum' type.
The placeholder type for bound member functions.
The '_Sat short _Accum' type.
The 'unsigned long long' type.
Decl::Kind getDeclKind() const
The C++ 'char8_t' type.
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
The '_Sat unsigned _Fract' type.
Represents the declaration of a struct/union/class/enum.
The 'unsigned char' type.
The (signed) 'long' type.
The (signed) 'short' type.
The '_Sat _Accum' 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 '_Accum' type.
The '_Fract' type.
The '_Sat unsigned short _Accum' type.
The '_Sat long _Accum' type.
The placeholder type for dependent types.
The 'unsigned _Fract' type.
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.
This represents a decl that may have a name.
The '_Sat unsigned short _Fract' type.
The '_Sat _Fract' type.
virtual ~ASTDeserializationListener()
A type index; the type ID with the qualifier bits removed.
The pseudo-object placeholder type.
The '__float128' type.