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::Float128:
97 case BuiltinType::NullPtr:
100 case BuiltinType::Char16:
103 case BuiltinType::Char32:
106 case BuiltinType::Overload:
109 case BuiltinType::BoundMember:
112 case BuiltinType::PseudoObject:
115 case BuiltinType::Dependent:
118 case BuiltinType::UnknownAny:
121 case BuiltinType::ARCUnbridgedCast:
124 case BuiltinType::ObjCId:
127 case BuiltinType::ObjCClass:
130 case BuiltinType::ObjCSel:
133 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
134 case BuiltinType::Id: \
135 ID = PREDEF_TYPE_##Id##_ID; \
137 #include "clang/Basic/OpenCLImageTypes.def"
138 case BuiltinType::OCLSampler:
141 case BuiltinType::OCLEvent:
144 case BuiltinType::OCLClkEvent:
147 case BuiltinType::OCLQueue:
150 case BuiltinType::OCLReserveID:
153 case BuiltinType::BuiltinFn:
156 case BuiltinType::OMPArraySection:
169 for (
unsigned I = 0;
I != N; ++
I)
171 R = llvm::HashString(II->getName(), R);
179 case Decl::TranslationUnit:
180 case Decl::ExternCContext:
181 case Decl::Namespace:
182 case Decl::LinkageSpec:
195 case Decl::CXXRecord:
196 case Decl::ClassTemplateSpecialization:
197 case Decl::ClassTemplatePartialSpecialization:
202 case Decl::CXXMethod:
203 case Decl::CXXConstructor:
204 case Decl::CXXDestructor:
205 case Decl::CXXConversion:
206 case Decl::ObjCMethod:
211 case Decl::ObjCCategory:
212 case Decl::ObjCCategoryImpl:
213 case Decl::ObjCImplementation:
216 case Decl::ObjCProtocol:
225 case Decl::ObjCInterface:
229 llvm_unreachable(
"Unhandled DeclContext in AST reader");
232 llvm_unreachable(
"Unhandled decl kind");
236 switch (static_cast<Decl::Kind>(Kind)) {
237 case Decl::TranslationUnit:
238 case Decl::ExternCContext:
242 case Decl::Namespace:
243 case Decl::NamespaceAlias:
245 case Decl::TypeAlias:
248 case Decl::CXXRecord:
249 case Decl::ClassTemplateSpecialization:
250 case Decl::ClassTemplatePartialSpecialization:
251 case Decl::VarTemplateSpecialization:
252 case Decl::VarTemplatePartialSpecialization:
254 case Decl::CXXDeductionGuide:
255 case Decl::CXXMethod:
256 case Decl::CXXConstructor:
257 case Decl::CXXDestructor:
258 case Decl::CXXConversion:
259 case Decl::UsingShadow:
260 case Decl::ConstructorUsingShadow:
262 case Decl::FunctionTemplate:
263 case Decl::ClassTemplate:
264 case Decl::VarTemplate:
265 case Decl::TypeAliasTemplate:
266 case Decl::ObjCProtocol:
267 case Decl::ObjCInterface:
272 case Decl::UsingDirective:
274 case Decl::UnresolvedUsingTypename:
275 case Decl::TemplateTypeParm:
276 case Decl::EnumConstant:
277 case Decl::UnresolvedUsingValue:
278 case Decl::IndirectField:
280 case Decl::MSProperty:
282 case Decl::ObjCAtDefsField:
283 case Decl::NonTypeTemplateParm:
284 case Decl::TemplateTemplateParm:
286 case Decl::UsingPack:
287 case Decl::ObjCMethod:
288 case Decl::ObjCCategory:
289 case Decl::ObjCCategoryImpl:
290 case Decl::ObjCImplementation:
291 case Decl::ObjCProperty:
292 case Decl::ObjCCompatibleAlias:
293 case Decl::LinkageSpec:
295 case Decl::ObjCPropertyImpl:
296 case Decl::PragmaComment:
297 case Decl::PragmaDetectMismatch:
298 case Decl::FileScopeAsm:
299 case Decl::AccessSpec:
301 case Decl::FriendTemplate:
302 case Decl::StaticAssert:
305 case Decl::ClassScopeFunctionSpecialization:
307 case Decl::OMPThreadPrivate:
308 case Decl::OMPCapturedExpr:
309 case Decl::OMPDeclareReduction:
310 case Decl::BuiltinTemplate:
311 case Decl::Decomposition:
317 case Decl::ImplicitParam:
319 case Decl::ObjCTypeParam:
323 llvm_unreachable(
"Unhandled declaration kind");
337 if (
auto *FD = dyn_cast<FunctionDecl>(D))
338 return !FD->getDescribedFunctionTemplate();
339 if (
auto *RD = dyn_cast<CXXRecordDecl>(D))
340 return !RD->getDescribedClassTemplate();
347 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.
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)...
detail::InMemoryDirectory::const_iterator I
The placeholder type for OpenMP array section.
The 'char' type, when it is unsigned.
unsigned getNumArgs() const
The placeholder type for overloaded function sets.
The OpenCL 'half' / ARM NEON __fp16 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)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The placeholder type for dependent types.
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'.
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.