16 #ifndef LLVM_CLANG_AST_DECLCXX_H
17 #define LLVM_CLANG_AST_DECLCXX_H
24 #include "llvm/ADT/DenseMap.h"
25 #include "llvm/ADT/PointerIntPair.h"
26 #include "llvm/Support/Compiler.h"
30 class ClassTemplateDecl;
31 class ClassTemplateSpecializationDecl;
34 class CXXConstructorDecl;
35 class CXXConversionDecl;
36 class CXXDestructorDecl;
39 class CXXMemberLookupCriteria;
40 class CXXFinalOverriderMap;
41 class CXXIndirectPrimaryBaseSet;
80 return ::clang::AnyFunctionDecl::getFromNamedDecl(
81 static_cast< ::clang::NamedDecl*>(P));
84 enum { NumLowBitsAvailable = 2 };
102 virtual void anchor();
108 :
Decl(AccessSpec, DC, ASLoc), ColonLoc(ColonLoc) {
112 :
Decl(AccessSpec, Empty) { }
174 bool BaseOfClass : 1;
184 bool InheritConstructors : 1;
197 : Range(R), EllipsisLoc(EllipsisLoc), Virtual(V), BaseOfClass(BC),
198 Access(A), InheritConstructors(
false), BaseTypeInfo(TInfo) { }
220 InheritConstructors = Inherit;
263 llvm::PointerUnion<T *, Decl *> DataOrCanonicalDecl;
266 if (
Decl *Canon = DataOrCanonicalDecl.template dyn_cast<Decl*>()) {
267 if (Canon->isCanonicalDecl())
268 Canon->getMostRecentDecl();
272 *
this = Canon->getPreviousDecl()->DefinitionData.update();
290 enum SpecialMemberFlags {
291 SMF_DefaultConstructor = 0x1,
292 SMF_CopyConstructor = 0x2,
293 SMF_MoveConstructor = 0x4,
294 SMF_CopyAssignment = 0x8,
295 SMF_MoveAssignment = 0x10,
296 SMF_Destructor = 0x20,
300 struct DefinitionData {
304 bool UserDeclaredConstructor : 1;
307 unsigned UserDeclaredSpecialMembers : 6;
313 bool PlainOldData : 1;
323 bool Polymorphic : 1;
343 bool IsStandardLayout : 1;
349 bool HasNoNonEmptyBases : 1;
352 bool HasPrivateFields : 1;
355 bool HasProtectedFields : 1;
358 bool HasPublicFields : 1;
361 bool HasMutableFields : 1;
365 bool HasVariantMembers : 1;
368 bool HasOnlyCMembers : 1;
372 bool HasInClassInitializer : 1;
379 bool HasUninitializedReferenceMember : 1;
384 bool NeedOverloadResolutionForMoveConstructor : 1;
385 bool NeedOverloadResolutionForMoveAssignment : 1;
386 bool NeedOverloadResolutionForDestructor : 1;
392 bool DefaultedMoveConstructorIsDeleted : 1;
393 bool DefaultedMoveAssignmentIsDeleted : 1;
394 bool DefaultedDestructorIsDeleted : 1;
403 unsigned HasTrivialSpecialMembers : 6;
411 unsigned DeclaredNonTrivialSpecialMembers : 6;
414 bool HasIrrelevantDestructor : 1;
418 bool HasConstexprNonCopyMoveConstructor : 1;
422 bool DefaultedDefaultConstructorIsConstexpr : 1;
428 bool HasConstexprDefaultConstructor : 1;
432 bool HasNonLiteralTypeFieldsOrBases : 1;
436 bool ComputedVisibleConversions : 1;
440 bool UserProvidedDefaultConstructor : 1;
444 unsigned DeclaredSpecialMembers : 6;
448 bool ImplicitCopyConstructorHasConstParam : 1;
452 bool ImplicitCopyAssignmentHasConstParam : 1;
456 bool HasDeclaredCopyConstructorWithConstParam : 1;
460 bool HasDeclaredCopyAssignmentWithConstParam : 1;
466 bool IsParsingBaseSpecifiers : 1;
506 if (!Bases.isOffset())
507 return Bases.get(
nullptr);
508 return getBasesSlowCase();
513 if (!VBases.isOffset())
514 return VBases.get(
nullptr);
515 return getVBasesSlowCase();
530 struct LambdaDefinitionData :
public DefinitionData {
534 bool Dependent,
bool IsGeneric,
536 : DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric),
537 CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0),
538 ManglingNumber(0), ContextDecl(nullptr), Captures(nullptr),
545 PlainOldData =
false;
546 HasNonLiteralTypeFieldsOrBases =
true;
557 unsigned Dependent : 1;
560 unsigned IsGenericLambda : 1;
563 unsigned CaptureDefault : 2;
566 unsigned NumCaptures : 15;
569 unsigned NumExplicitCaptures : 13;
573 unsigned ManglingNumber;
590 struct DefinitionData &data()
const {
591 auto *DD = DefinitionData.
get();
592 assert(DD &&
"queried property of class with no definition");
596 struct LambdaDefinitionData &getLambdaData()
const {
600 assert(DD && DD->IsLambda &&
"queried lambda property of non-lambda class");
601 return static_cast<LambdaDefinitionData&
>(*DD);
613 llvm::PointerUnion<ClassTemplateDecl*, MemberSpecializationInfo*>
614 TemplateOrInstantiation;
628 void addedMember(
Decl *D);
630 void markedVirtualFunctionPure();
659 return cast_or_null<CXXRecordDecl>(
667 return cast<CXXRecordDecl>(
676 auto *DD = DefinitionData.
get();
677 return DD ? DD->Definition :
nullptr;
686 bool DelayTypeCreation =
false);
689 bool DependentLambda,
bool IsGeneric,
694 return data().Polymorphic || data().NumVBases != 0;
700 return data().IsParsingBaseSpecifiers;
710 typedef llvm::iterator_range<base_class_const_iterator>
752 typedef llvm::iterator_range<specific_decl_iterator<CXXMethodDecl>>
771 typedef llvm::iterator_range<specific_decl_iterator<CXXConstructorDecl>>
786 typedef llvm::iterator_range<friend_iterator>
friend_range;
795 return data().FirstFriend.isValid();
802 !data().DefaultedMoveConstructorIsDeleted;
808 !data().DefaultedMoveAssignmentIsDeleted;
814 !data().DefaultedDestructorIsDeleted;
819 return (data().DeclaredSpecialMembers & SMF_DefaultConstructor) ||
828 return !data().UserDeclaredConstructor &&
829 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
840 return data().UserDeclaredConstructor;
846 return data().UserProvidedDefaultConstructor;
853 return data().UserDeclaredSpecialMembers & SMF_CopyConstructor;
859 return !(data().DeclaredSpecialMembers & SMF_CopyConstructor);
865 return data().HasMutableFields;
871 return data().ImplicitCopyConstructorHasConstParam;
877 return data().HasDeclaredCopyConstructorWithConstParam ||
888 return data().UserDeclaredSpecialMembers &
889 (SMF_MoveConstructor | SMF_MoveAssignment);
895 return data().UserDeclaredSpecialMembers & SMF_MoveConstructor;
900 return (data().DeclaredSpecialMembers & SMF_MoveConstructor) ||
907 assert((data().DefaultedMoveConstructorIsDeleted ||
909 "move constructor should not be deleted");
910 data().DefaultedMoveConstructorIsDeleted =
true;
916 return !(data().DeclaredSpecialMembers & SMF_MoveConstructor) &&
926 return data().NeedOverloadResolutionForMoveConstructor;
934 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
940 return !(data().DeclaredSpecialMembers & SMF_CopyAssignment);
946 return data().HasMutableFields;
952 return data().ImplicitCopyAssignmentHasConstParam;
959 return data().HasDeclaredCopyAssignmentWithConstParam ||
967 return data().UserDeclaredSpecialMembers & SMF_MoveAssignment;
972 return (data().DeclaredSpecialMembers & SMF_MoveAssignment) ||
979 assert((data().DefaultedMoveAssignmentIsDeleted ||
981 "move assignment should not be deleted");
982 data().DefaultedMoveAssignmentIsDeleted =
true;
989 return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
999 return data().NeedOverloadResolutionForMoveAssignment;
1006 return data().UserDeclaredSpecialMembers & SMF_Destructor;
1012 return !(data().DeclaredSpecialMembers & SMF_Destructor);
1018 return data().NeedOverloadResolutionForDestructor;
1025 return DD && DD->IsLambda;
1064 void getCaptureFields(llvm::DenseMap<const VarDecl *, FieldDecl *> &Captures,
1074 return isLambda() ? getLambdaData().Captures :
nullptr;
1119 data().HasUninitializedReferenceMember;
1130 bool isPOD()
const {
return data().PlainOldData; }
1172 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1178 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1180 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1186 return data().HasConstexprNonCopyMoveConstructor ||
1194 return data().DefaultedDefaultConstructorIsConstexpr &&
1200 return data().HasConstexprDefaultConstructor ||
1208 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1214 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1222 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1228 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1230 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1236 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1242 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1250 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1256 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1258 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1264 return data().HasTrivialSpecialMembers & SMF_Destructor;
1270 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1279 return data().HasIrrelevantDestructor;
1285 return data().HasNonLiteralTypeFieldsOrBases;
1372 TemplateOrInstantiation = Template;
1403 return RD->isLocalClass();
1491 bool AllowShortCircuit =
true)
const;
1600 assert(DeclAccess !=
AS_none);
1602 return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
1637 assert(
isLambda() &&
"Not a lambda closure type!");
1638 return getLambdaData().ManglingNumber;
1651 assert(
isLambda() &&
"Not a lambda closure type!");
1652 return getLambdaData().ContextDecl;
1658 getLambdaData().ManglingNumber = ManglingNumber;
1659 getLambdaData().ContextDecl = ContextDecl;
1674 return !MSInheritanceAttr::hasOnlyOneField(
false,
1695 return isLambda() && getLambdaData().Dependent;
1699 return getLambdaData().MethodTyInfo;
1704 return K >= firstCXXRecord && K <= lastCXXRecord;
1718 void anchor()
override;
1725 :
FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo,
1726 SC, isInline, isConstexpr) {
1754 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
1755 OOK == OO_Array_Delete;
1793 return cast<CXXMethodDecl>(
1870 bool MayBeBase =
false);
1874 bool MayBeBase =
false)
const {
1882 return K >= firstCXXMethod && K <= lastCXXMethod;
1905 llvm::PointerUnion3<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
1928 bool IsDelegating : 1;
1942 unsigned SourceOrderOrNumArrayIndices : 13;
1977 VarDecl **Indices,
unsigned NumIndices);
2003 return Init->getStmtClass() == Stmt::CXXDefaultInitExprClass;
2020 return MemberOrEllipsisLocation;
2067 return MemberOrEllipsisLocation;
2083 return IsWritten ?
static_cast<int>(SourceOrderOrNumArrayIndices) : -1;
2094 assert(!IsWritten &&
2095 "calling twice setSourceOrder() on the same initializer");
2096 assert(SourceOrderOrNumArrayIndices == 0 &&
2097 "setSourceOrder() used when there are implicit array indices");
2099 "setSourceOrder() used to make an initializer implicit");
2101 SourceOrderOrNumArrayIndices =
static_cast<unsigned>(pos);
2110 return IsWritten ? 0 : SourceOrderOrNumArrayIndices;
2117 return reinterpret_cast<VarDecl **
>(
this + 1)[I];
2121 return reinterpret_cast<const VarDecl *
const *
>(
this + 1)[I];
2125 reinterpret_cast<VarDecl **
>(
this + 1)[I] = Index;
2129 return llvm::makeArrayRef(reinterpret_cast<VarDecl **>(
this + 1),
2148 void anchor()
override;
2151 bool IsExplicitSpecified : 1;
2157 unsigned NumCtorInitializers;
2165 :
CXXMethodDecl(CXXConstructor, C, RD, StartLoc, NameInfo, T, TInfo,
2167 IsExplicitSpecified(isExplicitSpecified), CtorInitializers(
nullptr),
2168 NumCtorInitializers(0) {
2179 bool isInline,
bool isImplicitlyDeclared,
2207 const auto *ConstThis =
this;
2223 typedef std::reverse_iterator<init_const_iterator>
2243 return NumCtorInitializers;
2247 NumCtorInitializers = numCtorInitializers;
2251 CtorInitializers = Initializers;
2287 unsigned TypeQuals = 0;
2301 unsigned TypeQuals = 0;
2359 void anchor()
override;
2366 bool isInline,
bool isImplicitlyDeclared)
2367 :
CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo,
2369 OperatorDelete(
nullptr) {
2379 bool isImplicitlyDeclared);
2384 return cast<CXXDestructorDecl>(
getFirstDecl())->OperatorDelete;
2406 void anchor()
override;
2410 bool IsExplicitSpecified : 1;
2417 :
CXXMethodDecl(CXXConversion, C, RD, StartLoc, NameInfo, T, TInfo,
2418 SC_None, isInline, isConstexpr, EndLocation),
2419 IsExplicitSpecified(isExplicitSpecified) { }
2468 virtual void anchor();
2482 unsigned Language : 3;
2488 unsigned HasBraces : 1;
2497 Language(lang), HasBraces(HasBraces), ExternLoc(ExternLoc),
2502 SourceLocation ExternLoc,
2515 assert(!RBraceLoc.
isValid() || HasBraces);
2524 HasBraces = RBraceLoc.
isValid();
2560 void anchor()
override;
2591 :
NamedDecl(UsingDirective, DC, IdentLoc, getName()), UsingLoc(UsingLoc),
2592 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
2593 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) { }
2608 return NominatedNamespace;
2664 void anchor()
override;
2686 NamespaceLoc(NamespaceLoc), IdentLoc(IdentLoc),
2687 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
2735 return AD->getNamespace();
2737 return cast<NamespaceDecl>(Namespace);
2780 void anchor()
override;
2794 UsingOrNextShadow(reinterpret_cast<
NamedDecl *>(Using)) {
2802 typedef Redeclarable<UsingShadowDecl> redeclarable_base;
2803 UsingShadowDecl *getNextRedeclarationImpl()
override {
2806 UsingShadowDecl *getPreviousDeclImpl()
override {
2809 UsingShadowDecl *getMostRecentDeclImpl()
override {
2844 assert(ND &&
"Target decl is null!");
2855 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
2872 void anchor()
override;
2889 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
2895 UsingLocation(UL), QualifierLoc(QualifierLoc),
2896 DNLoc(NameInfo.
getInfo()), FirstUsingShadow(
nullptr, HasTypenameKeyword) {
2959 return x.Current == y.Current;
2962 return x.Current != y.Current;
2989 bool HasTypenameKeyword);
3018 public Mergeable<UnresolvedUsingValueDecl> {
3019 void anchor()
override;
3037 UsingLocation(UsingLoc), QualifierLoc(QualifierLoc),
3102 public Mergeable<UnresolvedUsingTypenameDecl> {
3103 void anchor()
override;
3116 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
3118 TypenameLocation(TypenameLoc), QualifierLoc(QualifierLoc) { }
3160 virtual void anchor();
3161 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
3168 :
Decl(StaticAssert, DC, StaticAssertLoc),
3169 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
3170 RParenLoc(RParenLoc) { }
3185 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
3233 GetterId(Getter), SetterId(Setter) {}
llvm::iterator_range< base_class_iterator > base_class_range
unsigned getNumArrayIndices() const
Determine the number of implicit array indices used while described an array member initialization...
SourceLocation getEnd() const
bool hasFriends() const
Determines whether this record has any friends.
void setImplicit(bool I=true)
bool isDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is derived from the class Base.
bool needsImplicitMoveConstructor() const
Determine whether this class should get an implicit move constructor or if any existing special membe...
SourceLocation getIdentLocation() const
Returns the location of this using declaration's identifier.
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
capture_const_range captures() const
static bool classof(const Decl *D)
bool isBaseOfClass() const
Determine whether this base class is a base of a class declared with the 'class' keyword (vs...
QualType getConversionType() const
Returns the type that this conversion function is converting to.
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
bool isParsingBaseSpecifiers() const
QualType getType() const
Retrieves the type of the base class.
static UnresolvedUsingValueDecl * CreateDeserialized(ASTContext &C, unsigned ID)
method_range methods() const
static bool classof(const Decl *D)
MSInheritanceAttr::Spelling getMSInheritanceModel() const
Returns the inheritance model used for this record.
bool isUserProvided() const
Iterates through the using shadow declarations associated with this using declaration.
const UsingDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
redeclarable_base::redecl_iterator redecl_iterator
static bool classof(const Decl *D)
llvm::iterator_range< base_class_const_iterator > base_class_const_range
static AccessSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isInClassMemberInitializer() const
Determine whether this initializer is an implicit initializer generated for a field with an initializ...
UsingShadowDecl * pointer
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class...
DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL)
void setRangeEnd(SourceLocation E)
capture_const_iterator captures_begin() const
LazyDefinitionDataPtr(Decl *Canon)
void setInheritedConstructor(const CXXConstructorDecl *BaseCtor)
Set the constructor that this inheriting constructor is based on.
void setAccessSpecifierLoc(SourceLocation ASLoc)
Sets the location of the access specifier.
bool isSpecializationCopyingObject() const
Determine whether this is a member template specialization that would copy the object to itself...
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
const NamespaceDecl * getNamespace() const
bool hasNonTrivialDestructor() const
Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
void setPure(bool P=true)
llvm::iterator_range< conversion_iterator > getVisibleConversionFunctions()
Get all conversion functions visible in current class, including conversion function templates...
init_reverse_iterator init_rend()
method_iterator method_begin() const
Method begin iterator. Iterates in the order the methods were declared.
bool hasDefinition() const
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
RefQualifierKind getRefQualifier() const
Retrieve the ref-qualifier associated with this method.
static bool classof(const Decl *D)
bool hasUserDeclaredMoveOperation() const
Whether this class has a user-declared move constructor or assignment operator.
const FunctionDecl * isLocalClass() const
If the class is a local class [class.local], returns the enclosing function declaration.
friend_range friends() const
SourceLocation getRParenLoc() const
NamespaceDecl - Represent a C++ namespace.
specific_decl_iterator< CXXConstructorDecl > ctor_iterator
Iterator access to constructor members.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
A container of type source information.
bool defaultedDefaultConstructorIsConstexpr() const
Determine whether a defaulted default constructor for this class would be constexpr.
SourceLocation getLocEnd() const LLVM_READONLY
static bool classofKind(Kind K)
bool needsImplicitDestructor() const
Determine whether this class needs an implicit destructor to be lazily declared.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
bool hasUserDeclaredCopyAssignment() const
Determine whether this class has a user-declared copy assignment operator.
Represents a C++ constructor within a class.
const UnresolvedUsingTypenameDecl * getCanonicalDecl() const
bool isCopyAssignmentOperator() const
Determine whether this is a copy-assignment operator, regardless of whether it was declared implicitl...
bool ForallBasesCallback(const CXXRecordDecl *BaseDefinition, void *UserData)
Function type used by forallBases() as a callback.
friend bool operator!=(shadow_iterator x, shadow_iterator y)
static CXXConversionDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isExplicit, bool isConstexpr, SourceLocation EndLocation)
Expr * getInit() const
Get the initializer.
SourceLocation getRParenLoc() const
void finishedDefaultedOrDeletedMember(CXXMethodDecl *MD)
Indicates that the declaration of a defaulted or deleted special member function is now complete...
static bool classof(const Decl *D)
unsigned getNumCtorInitializers() const
Determine the number of arguments used to initialize the member or base.
llvm::iterator_range< capture_const_iterator > capture_const_range
bool isCLike() const
True if this class is C-like, without C++-specific features, e.g. it contains only public fields...
static MSPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL, IdentifierInfo *Getter, IdentifierInfo *Setter)
QualType getThisType(ASTContext &C) const
Returns the type of the this pointer.
const CXXRecordDecl * getCanonicalDecl() const
const CXXRecordDecl * getMostRecentDecl() const
Stores a list of template parameters for a TemplateDecl and its derived classes.
decl_iterator decls_end() const
bool hasNonTrivialMoveAssignment() const
Determine whether this class has a non-trivial move assignment operator (C++11 [class.copy]p25)
llvm::iterator_range< friend_iterator > friend_range
UsingShadowDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
void setArrayIndex(unsigned I, VarDecl *Index)
static AccessSpecDecl * Create(ASTContext &C, AccessSpecifier AS, DeclContext *DC, SourceLocation ASLoc, SourceLocation ColonLoc)
Represents any kind of function declaration, whether it is a concrete function or a function template...
bool isMoveAssignmentOperator() const
Determine whether this is a move assignment operator.
bool hasMutableFields() const
Determine whether this class, or any of its class subobjects, contains a mutable field.
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated. Returns null if this cl...
const DeclContext * getCommonAncestor() const
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
static bool classof(const Decl *D)
bool isUsualDeallocationFunction() const
Determine whether this is a usual deallocation function (C++ [basic.stc.dynamic.deallocation]p2), which is an overloaded delete or delete[] operator with a particular signature.
SourceLocation getEllipsisLoc() const
An UnresolvedSet-like class that might not have been loaded from the external AST source yet...
bool hasTrivialCopyConstructor() const
Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class...
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the kind of specialization or template instantiation this is.
reference operator*() const
Base wrapper for a particular "section" of type source info.
An iterator over the friend declarations of a class.
Provides common interface for the Decls that can be redeclared.
SourceLocation getLocEnd() const LLVM_READONLY
DeclarationName getName() const
getName - Returns the embedded declaration name.
MSVtorDispAttr::Mode getMSVtorDispMode() const
Controls when vtordisps will be emitted if this record is used as a virtual base. ...
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
method_iterator end_overridden_methods() const
CXXRecordDecl * getParent()
StringLiteral * getMessage()
static bool classof(const Decl *D)
const UnresolvedUsingValueDecl * getCanonicalDecl() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
CXXRecordDecl * getPreviousDecl()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
bool isDelegatingConstructor() const
Determine whether this constructor is a delegating constructor.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
static bool classofKind(Kind K)
bool hasNonTrivialCopyConstructor() const
Determine whether this class has a non-trivial copy constructor (C++ [class.copy]p6, C++11 [class.copy]p12)
void setLanguage(LanguageIDs L)
Set the language specified by this linkage specification.
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
bool isExplicitSpecified() const
Determine whether this constructor declaration has the explicit keyword specified.
SourceLocation getLocStart() const LLVM_READONLY
QualType getReturnType() const
CXXConstructorDecl * getTargetConstructor() const
When this constructor delegates to another, retrieve the target.
bool isMemberInitializer() const
Determine whether this initializer is initializing a non-static data member.
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class...
UsingShadowDecl * reference
static CXXRecordDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
void startDefinition()
Starts the definition of this tag declaration.
redecl_iterator redecls_begin() const
unsigned getIdentifierNamespace() const
CXXMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
CXXRecordDecl * getDefinition() const
static CXXCtorInitializer * Create(ASTContext &Context, FieldDecl *Member, SourceLocation MemberLoc, SourceLocation L, Expr *Init, SourceLocation R, VarDecl **Indices, unsigned NumIndices)
Creates a new member initializer that optionally contains array indices used to describe an elementwi...
static bool classofKind(Kind K)
unsigned shadow_size() const
Return the number of shadowed declarations associated with this using declaration.
static bool classof(const Decl *D)
ArrayRef< VarDecl * > getArrayIndexes()
UsingShadowDecl * value_type
TypeSourceInfo * getLambdaTypeInfo() const
bool hasInClassInitializer() const
Whether this class has any in-class initializers for non-static data members (including those in anon...
bool hasNonTrivialDefaultConstructor() const
Determine whether this class has a non-trivial default constructor (C++11 [class.ctor]p5).
const NamedDecl * getNominatedNamespaceAsWritten() const
bool forallBases(ForallBasesCallback *BaseMatches, void *UserData, bool AllowShortCircuit=true) const
Determines if the given callback holds for all the direct or indirect base classes of this type...
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
Represents an access specifier followed by colon ':'.
bool needsImplicitCopyAssignment() const
Determine whether this class needs an implicit copy assignment operator to be lazily declared...
void addShadowDecl(UsingShadowDecl *S)
static StaticAssertDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static CXXRecordDecl * CreateLambda(const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, bool DependentLambda, bool IsGeneric, LambdaCaptureDefault CaptureDefault)
bool isAnyDestructorNoReturn() const
Returns true if the class destructor, or any implicitly invoked destructors are marked noreturn...
NamespaceAliasDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
CXXBaseSpecifier * base_class_iterator
Iterator that traverses the base classes of a class.
pointer operator->() const
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
void getIndirectPrimaryBases(CXXIndirectPrimaryBaseSet &Bases) const
Get the indirect primary bases for this class.
Represents a C++ using-declaration.
UnresolvedUsingValueDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
bool implicitCopyConstructorHasConstParam() const
Determine whether an implicit copy constructor for this type would have a parameter with a const-qual...
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
friend_iterator friend_end() const
bool hasMoveConstructor() const
Determine whether this class has a move constructor.
UsingShadowDecl * getNextRedeclaration() const
unsigned getLambdaManglingNumber() const
If this is the closure type of a lambda expression, retrieve the number to be used for name mangling ...
void completeDefinition() override
Indicates that the definition of this class is now complete.
TypeDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation StartL=SourceLocation())
IdentifierInfo * getSetterId() const
std::reverse_iterator< init_const_iterator > init_const_reverse_iterator
CXXMethodDecl(Kind DK, ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, bool isConstexpr, SourceLocation EndLocation)
IndirectFieldDecl * getIndirectMember() const
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
SourceLocation getEllipsisLoc() const
For a pack expansion, determine the location of the ellipsis.
const CXXRecordDecl * getParent() const
shadow_iterator shadow_begin() const
const CXXMethodDecl * getMostRecentDecl() const
NamedDecl * getNominatedNamespaceAsWritten()
static UnresolvedUsingTypenameDecl * CreateDeserialized(ASTContext &C, unsigned ID)
FunctionDecl * isLocalClass()
static bool classof(const Decl *D)
bool hasCopyAssignmentWithConstParam() const
Determine whether this class has a copy assignment operator with a parameter type which is a referenc...
bool hasNonLiteralTypeFieldsOrBases() const
Determine whether this class has a non-literal or/ volatile type non-static data member or base class...
void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl)
Set the mangling number and context declaration for a lambda class.
bool isExplicitSpecified() const
static DeclContext * castToDeclContext(const LinkageSpecDecl *D)
const UsingShadowDecl * getCanonicalDecl() const
CXXRecordDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
const Type * getBaseClass() const
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
base_class_iterator bases_begin()
init_const_reverse_iterator init_rbegin() const
SourceLocation getLocEnd() const LLVM_READONLY
void setNumCtorInitializers(unsigned numCtorInitializers)
static UnresolvedUsingValueDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo)
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
static NamespaceAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation NamespaceLoc, SourceLocation AliasLoc, IdentifierInfo *Alias, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Namespace)
Represents a linkage specification.
base_class_const_range vbases() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isWritten() const
Determine whether this initializer is explicitly written in the source code.
decl_iterator decls_begin() const
bool isLambdaToBlockPointerConversion() const
Determine whether this conversion function is a conversion from a lambda closure type to a block poin...
init_iterator init_begin()
Retrieve an iterator to the first initializer.
CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false)
Find the method in RD that corresponds to this one.
shadow_iterator shadow_end() const
SourceLocation getAliasLoc() const
bool isAbstract() const
Determine whether this class has a pure virtual function.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
CXXRecordDecl(Kind K, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl)
UsingDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
void setBases(CXXBaseSpecifier const *const *Bases, unsigned NumBases)
Sets the base classes of this struct or class.
llvm::iterator_range< redecl_iterator > redecl_range
CXXConstructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool hasConstexprNonCopyMoveConstructor() const
Determine whether this class has at least one constexpr constructor other than the copy or move const...
TypeLoc getBaseClassLoc() const
llvm::iterator_range< shadow_iterator > shadow_range
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
CXXRecordDecl * getMostRecentDecl()
bool hasCopyConstructorWithConstParam() const
Determine whether this class has a copy constructor with a parameter type which is a reference to a c...
A little helper class used to produce diagnostics.
bool hasIrrelevantDestructor() const
Determine whether this class has a destructor which has no semantic effect.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
SourceLocation getLocStart() const LLVM_READONLY
base_class_const_iterator vbases_end() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
static bool classofKind(Kind K)
Represents a ValueDecl that came out of a declarator. Contains type source information through TypeSo...
bool needsImplicitMoveAssignment() const
Determine whether this class should get an implicit move assignment operator or if any existing speci...
FieldDecl * getAnonField() const
A lazy pointer to the definition data for a declaration. FIXME: This is a little CXXRecordDecl-specif...
init_reverse_iterator init_rbegin()
bool isGenericLambda() const
Determine whether this class describes a generic lambda function object (i.e. function call operator ...
init_const_range inits() const
static StaticAssertDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StaticAssertLoc, Expr *AssertExpr, StringLiteral *Message, SourceLocation RParenLoc, bool Failed)
ID
Defines the set of possible language-specific address spaces.
const CXXMethodDecl *const * method_iterator
static CXXDestructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isImplicitlyDeclared)
const CXXMethodDecl * getCanonicalDecl() const
static bool classof(const Decl *D)
static bool classofKind(Kind K)
bool isMoveConstructor() const
Determine whether this constructor is a move constructor (C++0x [class.copy]p3), which can be used to...
bool isDeleted() const
Whether this function has been deleted.
const LambdaCapture * capture_const_iterator
unsigned getTypeQualifiers() const
MSInheritanceAttr::Spelling calculateInheritanceModel() const
Calculate what the inheritance model would be for this class.
SourceLocation getLParenLoc() const
static bool classofKind(Kind K)
static LinkageSpecDecl * CreateDeserialized(ASTContext &C, unsigned ID)
friend_iterator friend_begin() const
CXXRecordDecl * getTemplateInstantiationPattern()
redeclarable_base::redecl_range redecl_range
const CXXBaseSpecifier * base_class_const_iterator
Iterator that traverses the base classes of a class.
llvm::iterator_range< specific_decl_iterator< CXXConstructorDecl > > ctor_range
conversion_iterator conversion_end() const
Represents a C++ destructor within a class.
std::ptrdiff_t difference_type
base_class_const_iterator bases_begin() const
bool isLiteral() const
Determine whether this class is a literal type.
const CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false) const
void setRBraceLoc(SourceLocation L)
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
DeclContext * getDeclContext()
base_class_iterator vbases_end()
const CXXConstructorDecl * getCanonicalDecl() const
bool hasUserDeclaredMoveConstructor() const
Determine whether this class has had a move constructor declared by the user.
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
llvm::iterator_range< init_iterator > init_range
SourceLocation getMemberLocation() const
bool isExplicit() const
Determine whether this constructor was marked "explicit" or not.
void setInheritConstructors(bool Inherit=true)
Set that this base class's constructors should be inherited.
static NamespaceAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
StorageClass
Storage classes.
bool isIndirectMemberInitializer() const
static bool FindNestedNameSpecifierMember(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)
Base-class lookup callback that determines whether there exists a member with the given name that can...
std::reverse_iterator< init_iterator > init_reverse_iterator
void setTypename(bool TN)
Sets whether the using declaration has 'typename'.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
init_const_reverse_iterator init_rend() const
bool isCopyConstructor() const
void setLocation(SourceLocation L)
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
DeclarationName getDeclName() const
unsigned getNumBases() const
Retrieves the number of base classes of this class.
base_class_const_range bases() const
Represents a C++ conversion function within a class.
static UsingDirectiveDecl * CreateDeserialized(ASTContext &C, unsigned ID)
shadow_range shadows() const
bool hasNonTrivialCopyAssignment() const
Determine whether this class has a non-trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool needsOverloadResolutionForCopyAssignment() const
Determine whether we need to eagerly declare a defaulted copy assignment operator for this class...
CXXMethodDecl * getMostRecentDecl()
bool hasUninitializedReferenceMember() const
Whether this class or any of its subobjects has any members of reference type which would make value-...
bool isExplicit() const
Whether this is an explicit conversion operator (C++11 and later).
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
FunctionDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
static CXXRecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=nullptr, bool DelayTypeCreation=false)
DeclarationNameInfo getNameInfo() const
CXXCtorInitializer ** init_iterator
Iterates through the member/base initializer list.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const Expr * getAssertExpr() const
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
void setSourceOrder(int pos)
Set the source order of this initializer.
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl. It will iterate at least once ...
void setColonLoc(SourceLocation CLoc)
Sets the location of the colon.
specific_decl_iterator< CXXMethodDecl > method_iterator
SourceLocation getExternLoc() const
IdentifierInfo * getGetterId() const
UnresolvedUsingTypenameDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
static UsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
NamespaceAliasDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
SourceRange getSourceRange() const LLVM_READONLY
Determine the source range covering the entire initializer.
shadow_iterator(UsingShadowDecl *C)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static CXXDestructorDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
void setOperatorDelete(FunctionDecl *OD)
static bool classofKind(Kind K)
method_iterator begin_overridden_methods() const
A set of all the primary bases for a class.
FieldDecl * getAnyMember() const
UsingShadowDecl * getNextUsingShadowDecl() const
The next using shadow declaration contained in the shadow decl chain of the using declaration which i...
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
static CXXConstructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isExplicit, bool isInline, bool isImplicitlyDeclared, bool isConstexpr)
bool isValid() const
Return true if this is a valid SourceLocation object.
const VarDecl * getArrayIndex(unsigned I) const
bool BaseMatchesCallback(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)
Function type used by lookupInBases() to determine whether a specific base class subobject matches th...
bool hasSimpleMoveConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous move constructor that ...
ASTContext & getASTContext() const LLVM_READONLY
unsigned size_overridden_methods() const
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
redeclarable_base::redecl_iterator redecl_iterator
Represents a dependent using declaration which was not marked with typename.
bool mayBeAbstract() const
Determine whether this class may end up being abstract, even though it is not yet known to be abstrac...
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
init_iterator init_end()
Retrieve an iterator past the last initializer.
const StringLiteral * getMessage() const
UnresolvedSetIterator conversion_iterator
void removeShadowDecl(UsingShadowDecl *S)
void setCtorInitializers(CXXCtorInitializer **Initializers)
Represents a static or instance method of a struct/union/class.
bool needsOverloadResolutionForMoveAssignment() const
Determine whether we need to eagerly declare a move assignment operator for this class.
SourceLocation getSourceLocation() const
Determine the source location of the initializer.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void addOverriddenMethod(const CXXMethodDecl *MD)
redecl_iterator redecls_end() const
bool isCopyOrMoveConstructor() const
Determine whether this a copy or move constructor.
bool isBaseVirtual() const
Returns whether the base is virtual or not.
bool hasUserProvidedDefaultConstructor() const
Whether this class has a user-provided default constructor per C++11.
bool hasInlineBody() const
void setImplicitMoveConstructorIsDeleted()
Set that we attempted to declare an implicitly move constructor, but overload resolution failed so we...
static bool classofKind(Kind K)
UsingDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
void setDeclName(DeclarationName N)
Set the name of this declaration.
static MSPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
static bool FindBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *BaseRecord)
Base-class lookup callback that determines whether the given base class specifier refers to a specifi...
static bool classof(const Decl *D)
RefQualifierKind
The kind of C++0x ref-qualifier associated with a function type, which determines whether a member fu...
static bool classof(const Decl *D)
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
void setIsParsingBaseSpecifiers()
SourceLocation getBegin() const
bool getInheritConstructors() const
Determine whether this base class's constructors get inherited.
void getCaptureFields(llvm::DenseMap< const VarDecl *, FieldDecl * > &Captures, FieldDecl *&ThisCapture) const
For a closure type, retrieve the mapping from captured variables and this to the non-static data memb...
method_iterator method_end() const
Method past-the-end iterator.
bool isVirtuallyDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is virtually derived from the class Base.
Represents a C++11 static_assert declaration.
int getSourceOrder() const
Return the source position of the initializer, counting from 0. If the initializer was implicit...
std::forward_iterator_tag iterator_category
QualType getType() const
Return the type wrapped by this type source info.
bool hasMoveAssignment() const
Determine whether this class has a move assignment operator.
bool isDynamicClass() const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
CXXMethodDecl * getLambdaStaticInvoker() const
Retrieve the lambda static invoker, the address of which is returned by the conversion operator...
SourceLocation getUsingLoc() const
Return the location of the using keyword.
CXXBaseSpecifier(SourceRange R, bool V, bool BC, AccessSpecifier A, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc)
bool hasTrivialCopyAssignment() const
Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool hasSimpleDestructor() const
true if we know for sure that this class has an accessible destructor that is not deleted...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
TagTypeKind
The kind of a tag type.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK)
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
static LinkageSpecDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation ExternLoc, SourceLocation LangLoc, LanguageIDs Lang, bool HasBraces)
static bool classof(const Decl *D)
bool hasTypename() const
Return true if the using declaration has 'typename'.
static CXXConversionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
bool lookupInBases(BaseMatchesCallback *BaseMatches, void *UserData, CXXBasePaths &Paths) const
Look for entities within the base classes of this C++ class, transitively searching all base class su...
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
static AnyFunctionDecl getFromNamedDecl(NamedDecl *ND)
const CXXRecordDecl * getPreviousDecl() const
llvm::iterator_range< init_const_iterator > init_const_range
bool hasSimpleMoveAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous move assignment operat...
bool hasVariantMembers() const
Determine whether this class has any variant members.
Reads an AST files chain containing the contents of a translation unit.
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
void removeConversion(const NamedDecl *Old)
llvm::iterator_range< specific_decl_iterator< CXXMethodDecl > > method_range
const NamespaceAliasDecl * getCanonicalDecl() const
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Represents a dependent using declaration which was marked with typename.
static UsingDirectiveDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation NamespaceLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Nominated, DeclContext *CommonAncestor)
bool hasTrivialDefaultConstructor() const
Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).
static UnresolvedUsingTypenameDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation TypenameLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TargetNameLoc, DeclarationName TargetName)
A mapping from each virtual member function to its set of final overriders.
LazyDefinitionDataPtr(T *Data)
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12) ...
bool hasUserDeclaredMoveAssignment() const
Determine whether this class has had a move assignment declared by the user.
base_class_iterator vbases_begin()
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
bool isCurrentInstantiation(const DeclContext *CurContext) const
Determine whether this dependent class is a current instantiation, when viewed from within the given ...
void setExternLoc(SourceLocation L)
FieldDecl * getMember() const
If this is a member initializer, returns the declaration of the non-static data member being initiali...
bool hasAnyDependentBases() const
Determine whether this class has any dependent base classes which are not the current instantiation...
bool hasUserDeclaredCopyConstructor() const
Determine whether this class has a user-declared copy constructor.
bool isLambda() const
Determine whether this class describes a lambda function object.
static bool FindVirtualBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *BaseRecord)
Base-class lookup callback that determines whether the given base class specifier refers to a specifi...
static AccessSpecifier MergeAccess(AccessSpecifier PathAccess, AccessSpecifier DeclAccess)
Calculates the access of a decl that is reached along a path.
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
bool hasTrivialMoveAssignment() const
Determine whether this class has a trivial move assignment operator (C++11 [class.copy]p25)
static bool classofKind(Kind K)
static inline::clang::AnyFunctionDecl getFromVoidPointer(void *P)
redeclarable_base::redecl_range redecl_range
UsingDecl * getUsingDecl() const
Gets the using declaration to which this declaration is tied.
Represents a C++ base or member initializer.
LanguageIDs
Represents the language in a linkage specification.
bool isConvertingConstructor(bool AllowExplicit) const
base_class_const_iterator bases_end() const
static CXXMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static __inline__ uint32_t uint32_t y
bool isLambdaStaticInvoker() const
Determine whether this is a lambda closure type's static member function that is used for the result ...
static bool classofKind(Kind K)
static LinkageSpecDecl * castFromDeclContext(const DeclContext *DC)
const DeclarationNameLoc & getInfo() const
static UsingShadowDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, UsingDecl *Using, NamedDecl *Target)
SourceLocation getRBraceLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
bool isTrivial() const
Determine whether this class is considered trivial.
TypeSourceInfo * getTypeSourceInfo() const
Retrieves the type and source location of the base class.
static CXXMethodDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, bool isConstexpr, SourceLocation EndLocation)
NamedDecl * get() const
Retrieve the underlying function or function template.
void setInstantiationOfMemberClass(CXXRecordDecl *RD, TemplateSpecializationKind TSK)
Specify that this record is an instantiation of the member class RD.
AnyFunctionDecl(FunctionDecl *FD)
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
Represents a base class of a C++ class.
bool isAnyMemberInitializer() const
const CXXConstructorDecl * getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
void setDescribedClassTemplate(ClassTemplateDecl *Template)
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list. Returns null if the class does not represent a...
bool isDefaultConstructor() const
static bool classofKind(Kind K)
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
__PTRDIFF_TYPE__ ptrdiff_t
bool hasNonTrivialMoveConstructor() const
Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12) ...
static bool classofKind(Kind K)
const NamespaceDecl * getNominatedNamespace() const
ValueDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T)
void setImplicitMoveAssignmentIsDeleted()
Set that we attempted to declare an implicit move assignment operator, but overload resolution failed...
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, unsigned ID)
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
Represents a C++ struct/union/class.
bool hasUserDeclaredDestructor() const
Determine whether this class has a user-declared destructor.
bool isTriviallyCopyable() const
Determine whether this class is considered trivially copyable per (C++11 [class]p6).
bool implicitCopyAssignmentHasConstParam() const
Determine whether an implicit copy assignment operator for this type would have a parameter with a co...
ctor_iterator ctor_begin() const
static bool classof(const Decl *D)
bool needsImplicitDefaultConstructor() const
Determine if we need to declare a default constructor for this class.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Provides information a specialization of a member of a class template, which may be a member function...
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
base_class_iterator bases_end()
friend bool operator==(shadow_iterator x, shadow_iterator y)
Decl(Kind DK, DeclContext *DC, SourceLocation L)
shadow_iterator & operator++()
static UsingDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool HasTypenameKeyword)
Declaration of a class template.
static void * getAsVoidPointer(::clang::AnyFunctionDecl F)
Writes an AST file containing the contents of a translation unit.
SourceLocation getAccessSpecifierLoc() const
The location of the access specifier.
capture_const_iterator captures_end() const
bool needsImplicitCopyConstructor() const
Determine whether this class needs an implicit copy constructor to be lazily declared.
const FunctionDecl * getOperatorDelete() const
Kind
Lists the kind of concrete classes of Decl.
static bool FindTagMember(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *Name)
Base-class lookup callback that determines whether there exists a tag with the given name...
NamespaceAliasDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
VarDecl * getArrayIndex(unsigned I)
Retrieve a particular array index variable used to describe an array member initialization.
bool isStandardLayout() const
Determine whether this class has standard layout per (C++ [class]p7)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
conversion_iterator conversion_begin() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
bool isDependentLambda() const
Determine whether this lambda expression was known to be dependent at the time it was created...
NamedDecl * getMostRecentDecl()
bool isProvablyNotDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is provably not derived from the type Base.
CXXCtorInitializer *const * init_const_iterator
Iterates through the member/base initializer list.
static bool classof(const Decl *D)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
bool hasDefaultConstructor() const
Determine whether this class has any default constructors.
base_class_const_iterator vbases_begin() const
shadow_iterator operator++(int)
ctor_iterator ctor_end() const
A trivial tuple used to represent a source range.
static bool classofKind(Kind K)
SourceLocation getLocation() const
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
FunctionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static DeclarationName getUsingDirectiveName()
getUsingDirectiveName - Return name for all using-directives.
void setAccess(AccessSpecifier AS)
Represents a C++ namespace alias.
static UsingDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceRange getSourceRange() const LLVM_READONLY
Retrieves the source range that contains the entire base specifier.
void getFinalOverriders(CXXFinalOverriderMap &FinaOverriders) const
Retrieve the final overriders for each virtual member function in the class hierarchy where this clas...
Represents C++ using-directive.
bool hasConstexprDefaultConstructor() const
Determine whether this class has a constexpr default constructor.
bool isPolymorphic() const
LambdaCaptureDefault getLambdaCaptureDefault() const
bool nullFieldOffsetIsZero() const
init_const_iterator init_end() const
Retrieve an iterator past the last initializer.
base_class_range vbases()
Declaration of a template function.
void setTargetDecl(NamedDecl *ND)
Sets the underlying declaration which has been brought into the local scope.
void pushFriendDecl(FriendDecl *FD)
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
bool hasUserDeclaredConstructor() const
Determine whether this class has any user-declared constructors.
static bool FindOrdinaryMember(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *Name)
Base-class lookup callback that determines whether there exists a member with the given name...
Defines the LambdaCapture class.
void viewInheritance(ASTContext &Context) const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
DeclarationNameInfo getNameInfo() const
bool isPOD() const
Whether this class is a POD-type (C++ [class]p4)