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::OCLNDRange:
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:
197 case Decl::CXXRecord:
198 case Decl::ClassTemplateSpecialization:
199 case Decl::ClassTemplatePartialSpecialization:
204 case Decl::CXXMethod:
205 case Decl::CXXConstructor:
206 case Decl::CXXDestructor:
207 case Decl::CXXConversion:
208 case Decl::ObjCMethod:
213 case Decl::ObjCCategory:
214 case Decl::ObjCCategoryImpl:
215 case Decl::ObjCImplementation:
218 case Decl::ObjCProtocol:
227 case Decl::ObjCInterface:
231 llvm_unreachable(
"Unhandled DeclContext in AST reader");
234 llvm_unreachable(
"Unhandled decl kind");
238 switch (static_cast<Decl::Kind>(Kind)) {
239 case Decl::TranslationUnit:
240 case Decl::ExternCContext:
244 case Decl::Namespace:
245 case Decl::NamespaceAlias:
250 case Decl::CXXRecord:
251 case Decl::ClassTemplateSpecialization:
252 case Decl::ClassTemplatePartialSpecialization:
253 case Decl::VarTemplateSpecialization:
254 case Decl::VarTemplatePartialSpecialization:
256 case Decl::CXXMethod:
257 case Decl::CXXConstructor:
258 case Decl::CXXDestructor:
259 case Decl::CXXConversion:
260 case Decl::UsingShadow:
261 case Decl::ConstructorUsingShadow:
263 case Decl::FunctionTemplate:
264 case Decl::ClassTemplate:
265 case Decl::VarTemplate:
266 case Decl::TypeAliasTemplate:
267 case Decl::ObjCProtocol:
268 case Decl::ObjCInterface:
273 case Decl::UsingDirective:
275 case Decl::UnresolvedUsingTypename:
276 case Decl::TemplateTypeParm:
277 case Decl::EnumConstant:
278 case Decl::UnresolvedUsingValue:
279 case Decl::IndirectField:
281 case Decl::MSProperty:
283 case Decl::ObjCAtDefsField:
284 case Decl::NonTypeTemplateParm:
285 case Decl::TemplateTemplateParm:
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:
294 case Decl::ObjCPropertyImpl:
295 case Decl::PragmaComment:
296 case Decl::PragmaDetectMismatch:
297 case Decl::FileScopeAsm:
298 case Decl::AccessSpec:
300 case Decl::FriendTemplate:
301 case Decl::StaticAssert:
304 case Decl::ClassScopeFunctionSpecialization:
306 case Decl::OMPThreadPrivate:
307 case Decl::OMPCapturedExpr:
308 case Decl::OMPDeclareReduction:
309 case Decl::BuiltinTemplate:
314 case Decl::ImplicitParam:
316 case Decl::ObjCTypeParam:
320 llvm_unreachable(
"Unhandled declaration kind");
330 if (D->getFriendObjectKind() &&
331 D->getLexicalDeclContext()->isDependentContext() && !isa<TagDecl>(D)) {
334 if (
auto *FD = dyn_cast<FunctionDecl>(D))
335 return !FD->getDescribedFunctionTemplate();
336 if (
auto *RD = dyn_cast<CXXRecordDecl>(D))
337 return !RD->getDescribedClassTemplate();
342 if (D->
getDeclName() || !isa<CXXRecordDecl>(D->getLexicalDeclContext()))
344 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.
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.
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)
unsigned TypeAlias
Whether this template specialization type is a substituted type alias.
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
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.