13#ifndef LLVM_CLANG_LIB_SERIALIZATION_ASTCOMMON_H
14#define LLVM_CLANG_LIB_SERIALIZATION_ASTCOMMON_H
22namespace serialization {
49template <
typename IdxForTypeTy>
54 unsigned FastQuals =
T.getLocalFastQualifiers();
55 T.removeLocalFastQualifiers();
57 if (
T.hasLocalNonFastQualifiers())
58 return IdxForType(
T).asTypeID(FastQuals);
60 assert(!
T.hasLocalQualifiers());
62 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(
T.getTypePtr()))
65 if (
T == Context.AutoDeductTy)
67 if (
T == Context.AutoRRefDeductTy)
70 return IdxForType(
T).asTypeID(FastQuals);
101 if (
auto *FD = dyn_cast<FriendDecl>(LexicalD))
102 LexicalD = FD->getFriendDecl();
104 auto *ND = dyn_cast_or_null<NamedDecl>(LexicalD);
117 if (isa<ImportDecl>(D))
122 if (
auto *VD = dyn_cast<VarDecl>(D))
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This class is used for builtin types like 'int'.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Decl - This represents one declaration (or definition), e.g.
This represents a decl that may have a name.
A (possibly-)qualified type.
Smart pointer class that efficiently represents Objective-C method names.
A type index; the type ID with the qualifier bits removed.
TypeID asTypeID(unsigned FastQuals) const
@ PREDEF_TYPE_AUTO_RREF_DEDUCT
The "auto &&" deduction type.
@ PREDEF_TYPE_NULL_ID
The NULL type.
@ PREDEF_TYPE_AUTO_DEDUCT
The "auto" deduction type.
uint32_t TypeID
An ID number that refers to a type in an AST file.
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
TypeIdx TypeIdxFromBuiltin(const BuiltinType *BT)
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
TypeID MakeTypeID(ASTContext &Context, QualType T, IdxForTypeTy IdxForType)
void numberAnonymousDeclsWithin(const DeclContext *DC, Fn Visit)
Visit each declaration within DC that needs an anonymous declaration number and call Visit with the d...
const DeclContext * getDefinitiveDeclContext(const DeclContext *DC)
Retrieve the "definitive" declaration that provides all of the visible entries for the given declarat...
unsigned ComputeHash(Selector Sel)
bool isPartOfPerModuleInitializer(const Decl *D)
Determine whether the given declaration will be included in the per-module initializer if it needs to...
@ UPD_CXX_RESOLVED_DTOR_DELETE
@ UPD_CXX_INSTANTIATED_DEFAULT_MEMBER_INITIALIZER
@ UPD_CXX_DEDUCED_RETURN_TYPE
@ UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION
@ UPD_CXX_ADDED_IMPLICIT_MEMBER
@ UPD_DECL_MARKED_OPENMP_DECLARETARGET
@ UPD_CXX_POINT_OF_INSTANTIATION
@ UPD_CXX_RESOLVED_EXCEPTION_SPEC
@ UPD_CXX_ADDED_FUNCTION_DEFINITION
@ UPD_DECL_MARKED_OPENMP_THREADPRIVATE
@ UPD_STATIC_LOCAL_NUMBER
@ UPD_CXX_INSTANTIATED_DEFAULT_ARGUMENT
@ UPD_ADDED_ATTR_TO_RECORD
@ UPD_DECL_MARKED_OPENMP_ALLOCATE
@ UPD_CXX_ADDED_ANONYMOUS_NAMESPACE
@ UPD_CXX_INSTANTIATED_CLASS_DEFINITION
@ UPD_CXX_ADDED_VAR_DEFINITION
The JSON file list parser is used to communicate input to InstallAPI.
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
const FunctionProtoType * T