18 #include "llvm/Support/DJB.h" 20 using namespace clang;
29 case BuiltinType::Void:
32 case BuiltinType::Bool:
35 case BuiltinType::Char_U:
38 case BuiltinType::UChar:
41 case BuiltinType::UShort:
44 case BuiltinType::UInt:
47 case BuiltinType::ULong:
50 case BuiltinType::ULongLong:
53 case BuiltinType::UInt128:
56 case BuiltinType::Char_S:
59 case BuiltinType::SChar:
62 case BuiltinType::WChar_S:
63 case BuiltinType::WChar_U:
66 case BuiltinType::Short:
69 case BuiltinType::Int:
72 case BuiltinType::Long:
75 case BuiltinType::LongLong:
78 case BuiltinType::Int128:
81 case BuiltinType::Half:
84 case BuiltinType::Float:
87 case BuiltinType::Double:
90 case BuiltinType::LongDouble:
93 case BuiltinType::ShortAccum:
96 case BuiltinType::Accum:
99 case BuiltinType::LongAccum:
102 case BuiltinType::UShortAccum:
105 case BuiltinType::UAccum:
108 case BuiltinType::ULongAccum:
111 case BuiltinType::ShortFract:
114 case BuiltinType::Fract:
117 case BuiltinType::LongFract:
120 case BuiltinType::UShortFract:
123 case BuiltinType::UFract:
126 case BuiltinType::ULongFract:
129 case BuiltinType::SatShortAccum:
132 case BuiltinType::SatAccum:
135 case BuiltinType::SatLongAccum:
138 case BuiltinType::SatUShortAccum:
141 case BuiltinType::SatUAccum:
144 case BuiltinType::SatULongAccum:
147 case BuiltinType::SatShortFract:
150 case BuiltinType::SatFract:
153 case BuiltinType::SatLongFract:
156 case BuiltinType::SatUShortFract:
159 case BuiltinType::SatUFract:
162 case BuiltinType::SatULongFract:
165 case BuiltinType::Float16:
168 case BuiltinType::Float128:
171 case BuiltinType::NullPtr:
174 case BuiltinType::Char8:
177 case BuiltinType::Char16:
180 case BuiltinType::Char32:
183 case BuiltinType::Overload:
186 case BuiltinType::BoundMember:
189 case BuiltinType::PseudoObject:
192 case BuiltinType::Dependent:
195 case BuiltinType::UnknownAny:
198 case BuiltinType::ARCUnbridgedCast:
201 case BuiltinType::ObjCId:
204 case BuiltinType::ObjCClass:
207 case BuiltinType::ObjCSel:
210 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 211 case BuiltinType::Id: \ 212 ID = PREDEF_TYPE_##Id##_ID; \ 214 #include "clang/Basic/OpenCLImageTypes.def" 215 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ 216 case BuiltinType::Id: \ 217 ID = PREDEF_TYPE_##Id##_ID; \ 219 #include "clang/Basic/OpenCLExtensionTypes.def" 220 case BuiltinType::OCLSampler:
223 case BuiltinType::OCLEvent:
226 case BuiltinType::OCLClkEvent:
229 case BuiltinType::OCLQueue:
232 case BuiltinType::OCLReserveID:
235 #define SVE_TYPE(Name, Id, SingletonId) \ 236 case BuiltinType::Id: \ 237 ID = PREDEF_TYPE_##Id##_ID; \ 239 #include "clang/Basic/AArch64SVEACLETypes.def" 240 case BuiltinType::BuiltinFn:
243 case BuiltinType::OMPArraySection:
256 for (
unsigned I = 0; I != N; ++I)
258 R = llvm::djbHash(II->getName(), R);
266 case Decl::TranslationUnit:
267 case Decl::ExternCContext:
268 case Decl::Namespace:
269 case Decl::LinkageSpec:
282 case Decl::CXXRecord:
283 case Decl::ClassTemplateSpecialization:
284 case Decl::ClassTemplatePartialSpecialization:
289 case Decl::CXXMethod:
290 case Decl::CXXConstructor:
291 case Decl::CXXDestructor:
292 case Decl::CXXConversion:
293 case Decl::ObjCMethod:
298 case Decl::ObjCCategory:
299 case Decl::ObjCCategoryImpl:
300 case Decl::ObjCImplementation:
303 case Decl::ObjCProtocol:
312 case Decl::ObjCInterface:
316 llvm_unreachable(
"Unhandled DeclContext in AST reader");
319 llvm_unreachable(
"Unhandled decl kind");
323 switch (static_cast<Decl::Kind>(Kind)) {
324 case Decl::TranslationUnit:
325 case Decl::ExternCContext:
329 case Decl::Namespace:
330 case Decl::NamespaceAlias:
332 case Decl::TypeAlias:
335 case Decl::CXXRecord:
336 case Decl::ClassTemplateSpecialization:
337 case Decl::ClassTemplatePartialSpecialization:
338 case Decl::VarTemplateSpecialization:
339 case Decl::VarTemplatePartialSpecialization:
341 case Decl::CXXDeductionGuide:
342 case Decl::CXXMethod:
343 case Decl::CXXConstructor:
344 case Decl::CXXDestructor:
345 case Decl::CXXConversion:
346 case Decl::UsingShadow:
347 case Decl::ConstructorUsingShadow:
349 case Decl::FunctionTemplate:
350 case Decl::ClassTemplate:
351 case Decl::VarTemplate:
352 case Decl::TypeAliasTemplate:
353 case Decl::ObjCProtocol:
354 case Decl::ObjCInterface:
359 case Decl::UsingDirective:
361 case Decl::UnresolvedUsingTypename:
362 case Decl::TemplateTypeParm:
363 case Decl::EnumConstant:
364 case Decl::UnresolvedUsingValue:
365 case Decl::IndirectField:
367 case Decl::MSProperty:
369 case Decl::ObjCAtDefsField:
370 case Decl::NonTypeTemplateParm:
371 case Decl::TemplateTemplateParm:
373 case Decl::UsingPack:
374 case Decl::ObjCMethod:
375 case Decl::ObjCCategory:
376 case Decl::ObjCCategoryImpl:
377 case Decl::ObjCImplementation:
378 case Decl::ObjCProperty:
379 case Decl::ObjCCompatibleAlias:
380 case Decl::LinkageSpec:
382 case Decl::ObjCPropertyImpl:
383 case Decl::PragmaComment:
384 case Decl::PragmaDetectMismatch:
385 case Decl::FileScopeAsm:
386 case Decl::AccessSpec:
388 case Decl::FriendTemplate:
389 case Decl::StaticAssert:
392 case Decl::ClassScopeFunctionSpecialization:
394 case Decl::OMPThreadPrivate:
395 case Decl::OMPAllocate:
396 case Decl::OMPRequires:
397 case Decl::OMPCapturedExpr:
398 case Decl::OMPDeclareReduction:
399 case Decl::OMPDeclareMapper:
400 case Decl::BuiltinTemplate:
401 case Decl::Decomposition:
404 case Decl::LifetimeExtendedTemporary:
405 case Decl::RequiresExprBody:
410 case Decl::ImplicitParam:
412 case Decl::ObjCTypeParam:
416 llvm_unreachable(
"Unhandled declaration kind");
430 if (
auto *FD = dyn_cast<FunctionDecl>(D))
431 return !FD->getDescribedFunctionTemplate();
432 if (
auto *RD = dyn_cast<CXXRecordDecl>(D))
433 return !RD->getDescribedClassTemplate();
442 if (
auto *VD = dyn_cast<VarDecl>(D))
443 return VD->isStaticLocal();
445 return isa<TagDecl>(D) || isa<BlockDecl>(D);
453 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.