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::NullPtr:
97 case BuiltinType::Char16:
100 case BuiltinType::Char32:
103 case BuiltinType::Overload:
106 case BuiltinType::BoundMember:
109 case BuiltinType::PseudoObject:
112 case BuiltinType::Dependent:
115 case BuiltinType::UnknownAny:
118 case BuiltinType::ARCUnbridgedCast:
121 case BuiltinType::ObjCId:
124 case BuiltinType::ObjCClass:
127 case BuiltinType::ObjCSel:
130 case BuiltinType::OCLImage1d:
133 case BuiltinType::OCLImage1dArray:
136 case BuiltinType::OCLImage1dBuffer:
139 case BuiltinType::OCLImage2d:
142 case BuiltinType::OCLImage2dArray:
145 case BuiltinType::OCLImage2dDepth:
148 case BuiltinType::OCLImage2dArrayDepth:
151 case BuiltinType::OCLImage2dMSAA:
154 case BuiltinType::OCLImage2dArrayMSAA:
157 case BuiltinType::OCLImage2dMSAADepth:
160 case BuiltinType::OCLImage2dArrayMSAADepth:
163 case BuiltinType::OCLImage3d:
166 case BuiltinType::OCLSampler:
169 case BuiltinType::OCLEvent:
172 case BuiltinType::OCLClkEvent:
175 case BuiltinType::OCLQueue:
178 case BuiltinType::OCLNDRange:
181 case BuiltinType::OCLReserveID:
184 case BuiltinType::BuiltinFn:
187 case BuiltinType::OMPArraySection:
200 for (
unsigned I = 0;
I != N; ++
I)
202 R = llvm::HashString(II->getName(), R);
210 case Decl::TranslationUnit:
211 case Decl::ExternCContext:
212 case Decl::Namespace:
213 case Decl::LinkageSpec:
225 case Decl::CXXRecord:
226 case Decl::ClassTemplateSpecialization:
227 case Decl::ClassTemplatePartialSpecialization:
232 case Decl::CXXMethod:
233 case Decl::CXXConstructor:
234 case Decl::CXXDestructor:
235 case Decl::CXXConversion:
236 case Decl::ObjCMethod:
241 case Decl::ObjCCategory:
242 case Decl::ObjCCategoryImpl:
243 case Decl::ObjCImplementation:
246 case Decl::ObjCProtocol:
255 case Decl::ObjCInterface:
259 llvm_unreachable(
"Unhandled DeclContext in AST reader");
262 llvm_unreachable(
"Unhandled decl kind");
266 switch (static_cast<Decl::Kind>(Kind)) {
267 case Decl::TranslationUnit:
268 case Decl::ExternCContext:
272 case Decl::Namespace:
273 case Decl::NamespaceAlias:
278 case Decl::CXXRecord:
279 case Decl::ClassTemplateSpecialization:
280 case Decl::ClassTemplatePartialSpecialization:
281 case Decl::VarTemplateSpecialization:
282 case Decl::VarTemplatePartialSpecialization:
284 case Decl::CXXMethod:
285 case Decl::CXXConstructor:
286 case Decl::CXXDestructor:
287 case Decl::CXXConversion:
288 case Decl::UsingShadow:
290 case Decl::FunctionTemplate:
291 case Decl::ClassTemplate:
292 case Decl::VarTemplate:
293 case Decl::TypeAliasTemplate:
294 case Decl::ObjCProtocol:
295 case Decl::ObjCInterface:
300 case Decl::UsingDirective:
302 case Decl::UnresolvedUsingTypename:
303 case Decl::TemplateTypeParm:
304 case Decl::EnumConstant:
305 case Decl::UnresolvedUsingValue:
306 case Decl::IndirectField:
308 case Decl::MSProperty:
310 case Decl::ObjCAtDefsField:
311 case Decl::NonTypeTemplateParm:
312 case Decl::TemplateTemplateParm:
314 case Decl::ObjCMethod:
315 case Decl::ObjCCategory:
316 case Decl::ObjCCategoryImpl:
317 case Decl::ObjCImplementation:
318 case Decl::ObjCProperty:
319 case Decl::ObjCCompatibleAlias:
320 case Decl::LinkageSpec:
321 case Decl::ObjCPropertyImpl:
322 case Decl::FileScopeAsm:
323 case Decl::AccessSpec:
325 case Decl::FriendTemplate:
326 case Decl::StaticAssert:
329 case Decl::ClassScopeFunctionSpecialization:
331 case Decl::OMPThreadPrivate:
332 case Decl::BuiltinTemplate:
337 case Decl::ImplicitParam:
339 case Decl::ObjCTypeParam:
343 llvm_unreachable(
"Unhandled declaration kind");
357 if (
auto *FD = dyn_cast<FunctionDecl>(D))
358 return !FD->getDescribedFunctionTemplate();
359 if (
auto *RD = dyn_cast<CXXRecordDecl>(D))
360 return !RD->getDescribedClassTemplate();
367 return isa<TagDecl>(D) || isa<FieldDecl>(D);
Smart pointer class that efficiently represents Objective-C method names.
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
The (signed) 'long long' type.
The 'bool' or '_Bool' type.
The 'unknown any' placeholder type.
The placeholder type for builtin functions.
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
ARC's unbridged-cast placeholder type.
const DeclContext * getDefinitiveDeclContext(const DeclContext *DC)
Retrieve the "definitive" declaration that provides all of the visible entries for the given declarat...
One of these records is kept for each identifier that is lexed.
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
The 'char' type, when it is signed.
OpenCL 2d image MSAA depth type.
The 'unsigned long' type.
OpenCL 1d image buffer 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)...
detail::InMemoryDirectory::const_iterator I
OpenCL 2d image depth type.
The placeholder type for OpenMP array section.
OpenCL 2d image array depth type.
ID
Defines the set of possible language-specific address spaces.
The 'char' type, when it is unsigned.
unsigned getNumArgs() const
The placeholder type for overloaded function sets.
The OpenCL 'half' / ARM NEON __fp16 type.
OpenCL 2d image MSAA type.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
TagDecl * getDefinition() const
getDefinition - Returns the TagDecl that actually defines this struct/union/class/enum.
The placeholder type for bound member functions.
The 'unsigned long long' type.
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)
unsigned ComputeHash(Selector Sel)
OpenCL 2d image array MSAA type.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The placeholder type for dependent types.
OpenCL 2d image array type.
bool TypeAlias
Whether this template specialization type is a substituted type alias.
Decl::Kind getDeclKind() const
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
This class is used for builtin types like 'int'.
OpenCL 2d image array MSAA depth type.
OpenCL 1d image array 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.