16 #ifndef LLVM_CLANG_AST_DECLCXX_H
17 #define LLVM_CLANG_AST_DECLCXX_H
25 #include "llvm/ADT/DenseMap.h"
26 #include "llvm/ADT/PointerIntPair.h"
27 #include "llvm/Support/Compiler.h"
31 class ClassTemplateDecl;
32 class ClassTemplateSpecializationDecl;
33 class ConstructorUsingShadowDecl;
36 class CXXConstructorDecl;
37 class CXXConversionDecl;
38 class CXXDestructorDecl;
41 class CXXMemberLookupCriteria;
42 class CXXFinalOverriderMap;
43 class CXXIndirectPrimaryBaseSet;
82 return ::clang::AnyFunctionDecl::getFromNamedDecl(
83 static_cast< ::clang::NamedDecl*>(P));
86 enum { NumLowBitsAvailable = 2 };
104 virtual void anchor();
110 :
Decl(AccessSpec, DC, ASLoc), ColonLoc(ColonLoc) {
114 :
Decl(AccessSpec, Empty) { }
170 unsigned Virtual : 1;
176 unsigned BaseOfClass : 1;
186 unsigned InheritConstructors : 1;
199 : Range(R), EllipsisLoc(EllipsisLoc), Virtual(V), BaseOfClass(BC),
200 Access(A), InheritConstructors(
false), BaseTypeInfo(TInfo) { }
222 InheritConstructors = Inherit;
268 enum SpecialMemberFlags {
269 SMF_DefaultConstructor = 0x1,
270 SMF_CopyConstructor = 0x2,
271 SMF_MoveConstructor = 0x4,
272 SMF_CopyAssignment = 0x8,
273 SMF_MoveAssignment = 0x10,
274 SMF_Destructor = 0x20,
278 struct DefinitionData {
282 unsigned UserDeclaredConstructor : 1;
285 unsigned UserDeclaredSpecialMembers : 6;
288 unsigned Aggregate : 1;
291 unsigned PlainOldData : 1;
301 unsigned Polymorphic : 1;
305 unsigned Abstract : 1;
321 unsigned IsStandardLayout : 1;
327 unsigned HasNoNonEmptyBases : 1;
330 unsigned HasPrivateFields : 1;
333 unsigned HasProtectedFields : 1;
336 unsigned HasPublicFields : 1;
339 unsigned HasMutableFields : 1;
343 unsigned HasVariantMembers : 1;
346 unsigned HasOnlyCMembers : 1;
350 unsigned HasInClassInitializer : 1;
357 unsigned HasUninitializedReferenceMember : 1;
361 unsigned HasUninitializedFields : 1;
365 unsigned HasInheritedConstructor : 1;
369 unsigned HasInheritedAssignment : 1;
374 unsigned NeedOverloadResolutionForMoveConstructor : 1;
375 unsigned NeedOverloadResolutionForMoveAssignment : 1;
376 unsigned NeedOverloadResolutionForDestructor : 1;
382 unsigned DefaultedMoveConstructorIsDeleted : 1;
383 unsigned DefaultedMoveAssignmentIsDeleted : 1;
384 unsigned DefaultedDestructorIsDeleted : 1;
393 unsigned HasTrivialSpecialMembers : 6;
401 unsigned DeclaredNonTrivialSpecialMembers : 6;
404 unsigned HasIrrelevantDestructor : 1;
408 unsigned HasConstexprNonCopyMoveConstructor : 1;
412 unsigned HasDefaultedDefaultConstructor : 1;
416 unsigned DefaultedDefaultConstructorIsConstexpr : 1;
422 unsigned HasConstexprDefaultConstructor : 1;
426 unsigned HasNonLiteralTypeFieldsOrBases : 1;
430 unsigned ComputedVisibleConversions : 1;
434 unsigned UserProvidedDefaultConstructor : 1;
438 unsigned DeclaredSpecialMembers : 6;
442 unsigned ImplicitCopyConstructorHasConstParam : 1;
446 unsigned ImplicitCopyAssignmentHasConstParam : 1;
450 unsigned HasDeclaredCopyConstructorWithConstParam : 1;
454 unsigned HasDeclaredCopyAssignmentWithConstParam : 1;
457 unsigned IsLambda : 1;
460 unsigned IsParsingBaseSpecifiers : 1;
500 if (!Bases.isOffset())
501 return Bases.get(
nullptr);
502 return getBasesSlowCase();
507 if (!VBases.isOffset())
508 return VBases.get(
nullptr);
509 return getVBasesSlowCase();
513 return llvm::makeArrayRef(getBases(), NumBases);
516 return llvm::makeArrayRef(getVBases(), NumVBases);
524 struct DefinitionData *DefinitionData;
527 struct LambdaDefinitionData :
public DefinitionData {
531 bool Dependent,
bool IsGeneric,
533 : DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric),
534 CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0),
535 ManglingNumber(0), ContextDecl(
nullptr), Captures(
nullptr),
542 PlainOldData =
false;
543 HasNonLiteralTypeFieldsOrBases =
true;
554 unsigned Dependent : 1;
557 unsigned IsGenericLambda : 1;
560 unsigned CaptureDefault : 2;
563 unsigned NumCaptures : 15;
566 unsigned NumExplicitCaptures : 13;
570 unsigned ManglingNumber;
587 struct DefinitionData *dataPtr()
const {
590 return DefinitionData;
593 struct DefinitionData &data()
const {
594 auto *DD = dataPtr();
595 assert(DD &&
"queried property of class with no definition");
599 struct LambdaDefinitionData &getLambdaData()
const {
602 auto *DD = DefinitionData;
603 assert(DD && DD->IsLambda &&
"queried lambda property of non-lambda class");
604 return static_cast<LambdaDefinitionData&
>(*DD);
616 llvm::PointerUnion<ClassTemplateDecl*, MemberSpecializationInfo*>
617 TemplateOrInstantiation;
631 void addedMember(
Decl *D);
633 void markedVirtualFunctionPure();
662 return cast_or_null<CXXRecordDecl>(
670 return cast<CXXRecordDecl>(
681 auto *DD = DefinitionData ? DefinitionData : dataPtr();
682 return DD ? DD->Definition :
nullptr;
691 bool DelayTypeCreation =
false);
694 bool DependentLambda,
bool IsGeneric,
699 return data().Polymorphic || data().NumVBases != 0;
705 return data().IsParsingBaseSpecifiers;
715 typedef llvm::iterator_range<base_class_const_iterator>
757 typedef llvm::iterator_range<specific_decl_iterator<CXXMethodDecl>>
776 typedef llvm::iterator_range<specific_decl_iterator<CXXConstructorDecl>>
791 typedef llvm::iterator_range<friend_iterator>
friend_range;
800 return data().FirstFriend.isValid();
807 !data().DefaultedMoveConstructorIsDeleted;
813 !data().DefaultedMoveAssignmentIsDeleted;
819 !data().DefaultedDestructorIsDeleted;
824 return (data().DeclaredSpecialMembers & SMF_DefaultConstructor) ||
833 return !data().UserDeclaredConstructor &&
834 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
845 return data().UserDeclaredConstructor;
851 return data().UserProvidedDefaultConstructor;
858 return data().UserDeclaredSpecialMembers & SMF_CopyConstructor;
864 return !(data().DeclaredSpecialMembers & SMF_CopyConstructor);
870 return data().HasMutableFields;
876 return data().ImplicitCopyConstructorHasConstParam;
882 return data().HasDeclaredCopyConstructorWithConstParam ||
893 return data().UserDeclaredSpecialMembers &
894 (SMF_MoveConstructor | SMF_MoveAssignment);
900 return data().UserDeclaredSpecialMembers & SMF_MoveConstructor;
905 return (data().DeclaredSpecialMembers & SMF_MoveConstructor) ||
912 assert((data().DefaultedMoveConstructorIsDeleted ||
914 "move constructor should not be deleted");
915 data().DefaultedMoveConstructorIsDeleted =
true;
921 return !(data().DeclaredSpecialMembers & SMF_MoveConstructor) &&
931 return data().NeedOverloadResolutionForMoveConstructor;
939 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
945 return !(data().DeclaredSpecialMembers & SMF_CopyAssignment);
951 return data().HasMutableFields;
957 return data().ImplicitCopyAssignmentHasConstParam;
964 return data().HasDeclaredCopyAssignmentWithConstParam ||
972 return data().UserDeclaredSpecialMembers & SMF_MoveAssignment;
977 return (data().DeclaredSpecialMembers & SMF_MoveAssignment) ||
984 assert((data().DefaultedMoveAssignmentIsDeleted ||
986 "move assignment should not be deleted");
987 data().DefaultedMoveAssignmentIsDeleted =
true;
994 return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
1004 return data().NeedOverloadResolutionForMoveAssignment;
1011 return data().UserDeclaredSpecialMembers & SMF_Destructor;
1017 return !(data().DeclaredSpecialMembers & SMF_Destructor);
1023 return data().NeedOverloadResolutionForDestructor;
1029 auto *DD = DefinitionData;
1030 return DD && DD->IsLambda;
1069 void getCaptureFields(llvm::DenseMap<const VarDecl *, FieldDecl *> &Captures,
1079 return isLambda() ? getLambdaData().Captures :
nullptr;
1088 return data().Conversions.get(getASTContext()).begin();
1091 return data().Conversions.get(getASTContext()).end();
1124 data().HasUninitializedReferenceMember;
1135 bool isPOD()
const {
return data().PlainOldData; }
1178 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1184 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1186 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1192 return data().HasConstexprNonCopyMoveConstructor ||
1200 return data().DefaultedDefaultConstructorIsConstexpr &&
1206 return data().HasConstexprDefaultConstructor ||
1214 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1220 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1228 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1234 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1236 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1242 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1248 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1256 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1262 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1264 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1270 return data().HasTrivialSpecialMembers & SMF_Destructor;
1276 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1282 return !data().HasUninitializedFields ||
1283 !(data().HasDefaultedDefaultConstructor ||
1293 return data().HasIrrelevantDestructor;
1299 return data().HasNonLiteralTypeFieldsOrBases;
1305 return data().HasInheritedConstructor;
1311 return data().HasInheritedAssignment;
1422 if (
const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(getDeclContext()))
1423 return RD->isLocalClass();
1491 typedef llvm::function_ref<bool(const CXXRecordDecl *BaseDefinition)>
1508 bool AllowShortCircuit =
true)
const;
1618 assert(DeclAccess !=
AS_none);
1620 return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
1655 assert(
isLambda() &&
"Not a lambda closure type!");
1656 return getLambdaData().ManglingNumber;
1669 assert(
isLambda() &&
"Not a lambda closure type!");
1670 return getLambdaData().ContextDecl;
1676 getLambdaData().ManglingNumber = ManglingNumber;
1677 getLambdaData().ContextDecl = ContextDecl;
1692 return !MSInheritanceAttr::hasOnlyOneField(
false,
1713 return isLambda() && getLambdaData().Dependent;
1717 return getLambdaData().MethodTyInfo;
1722 return K >= firstCXXRecord && K <= lastCXXRecord;
1737 void anchor()
override;
1744 :
FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo,
1745 SC, isInline, isConstexpr) {
1773 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
1774 OOK == OO_Array_Delete;
1812 return cast<CXXMethodDecl>(
1891 bool MayBeBase =
false);
1895 bool MayBeBase =
false)
const {
1903 return K >= firstCXXMethod && K <= lastCXXMethod;
1927 llvm::PointerUnion3<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
1950 unsigned IsDelegating : 1;
1954 unsigned IsVirtual : 1;
1958 unsigned IsWritten : 1;
1964 unsigned SourceOrderOrNumArrayIndices : 13;
1999 VarDecl **Indices,
unsigned NumIndices);
2025 return Init->getStmtClass() == Stmt::CXXDefaultInitExprClass;
2042 return MemberOrEllipsisLocation;
2089 return MemberOrEllipsisLocation;
2105 return IsWritten ?
static_cast<int>(SourceOrderOrNumArrayIndices) : -1;
2116 assert(!IsWritten &&
2117 "calling twice setSourceOrder() on the same initializer");
2118 assert(SourceOrderOrNumArrayIndices == 0 &&
2119 "setSourceOrder() used when there are implicit array indices");
2121 "setSourceOrder() used to make an initializer implicit");
2123 SourceOrderOrNumArrayIndices =
static_cast<unsigned>(pos);
2132 return IsWritten ? 0 : SourceOrderOrNumArrayIndices;
2139 return getTrailingObjects<VarDecl *>()[I];
2143 return getTrailingObjects<VarDecl *>()[I];
2147 getTrailingObjects<VarDecl *>()[I] = Index;
2150 return llvm::makeArrayRef(getTrailingObjects<VarDecl *>(),
2169 : Shadow(Shadow), BaseCtor(BaseCtor) {}
2171 explicit operator bool()
const {
return Shadow; }
2190 void anchor()
override;
2196 unsigned NumCtorInitializers : 30;
2201 unsigned IsExplicitSpecified : 1;
2205 unsigned IsInheritingConstructor : 1;
2213 :
CXXMethodDecl(CXXConstructor, C, RD, StartLoc, NameInfo, T, TInfo,
2215 CtorInitializers(
nullptr), NumCtorInitializers(0),
2216 IsExplicitSpecified(isExplicitSpecified),
2217 IsInheritingConstructor((
bool)Inherited) {
2218 setImplicit(isImplicitlyDeclared);
2220 *getTrailingObjects<InheritedConstructor>() = Inherited;
2225 bool InheritsConstructor);
2229 bool isExplicit,
bool isInline,
bool isImplicitlyDeclared,
2258 const auto *ConstThis =
this;
2274 typedef std::reverse_iterator<init_const_iterator>
2294 return NumCtorInitializers;
2298 NumCtorInitializers = numCtorInitializers;
2302 CtorInitializers = Initializers;
2338 unsigned TypeQuals = 0;
2352 unsigned TypeQuals = 0;
2384 return IsInheritingConstructor ? *getTrailingObjects<InheritedConstructor>()
2415 void anchor()
override;
2422 bool isInline,
bool isImplicitlyDeclared)
2423 :
CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo,
2425 OperatorDelete(
nullptr) {
2426 setImplicit(isImplicitlyDeclared);
2435 bool isImplicitlyDeclared);
2440 return cast<CXXDestructorDecl>(
getFirstDecl())->OperatorDelete;
2462 void anchor()
override;
2466 bool IsExplicitSpecified : 1;
2473 :
CXXMethodDecl(CXXConversion, C, RD, StartLoc, NameInfo, T, TInfo,
2474 SC_None, isInline, isConstexpr, EndLocation),
2475 IsExplicitSpecified(isExplicitSpecified) { }
2524 virtual void anchor();
2538 unsigned Language : 3;
2544 unsigned HasBraces : 1;
2553 Language(lang), HasBraces(HasBraces), ExternLoc(ExternLoc),
2558 SourceLocation ExternLoc,
2571 assert(!RBraceLoc.
isValid() || HasBraces);
2580 HasBraces = RBraceLoc.
isValid();
2616 void anchor()
override;
2647 :
NamedDecl(UsingDirective, DC, IdentLoc, getName()), UsingLoc(UsingLoc),
2648 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
2649 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) { }
2664 return NominatedNamespace;
2720 void anchor()
override;
2742 NamespaceLoc(NamespaceLoc), IdentLoc(IdentLoc),
2743 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
2791 return AD->getNamespace();
2793 return cast<NamespaceDecl>(Namespace);
2836 void anchor()
override;
2866 return new (
C, DC)
UsingShadowDecl(UsingShadow, C, DC, Loc, Using, Target);
2894 assert(ND &&
"Target decl is null!");
2896 IdentifierNamespace = ND->getIdentifierNamespace();
2905 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
2910 return K == Decl::UsingShadow || K == Decl::ConstructorUsingShadow;
2928 void anchor()
override;
2944 unsigned IsVirtual : 1;
2948 bool TargetInVirtualBase)
2951 NominatedBaseClassShadowDecl(
2952 dyn_cast<ConstructorUsingShadowDecl>(Target)),
2953 ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
2954 IsVirtual(TargetInVirtualBase) {
2959 if (!TargetInVirtualBase && NominatedBaseClassShadowDecl &&
2961 ConstructedBaseClassShadowDecl =
2962 NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
2981 return cast<CXXRecordDecl>(getDeclContext());
2984 return cast<CXXRecordDecl>(getDeclContext());
2992 return NominatedBaseClassShadowDecl;
2998 return ConstructedBaseClassShadowDecl;
3008 return cast<CXXRecordDecl>((ConstructedBaseClassShadowDecl
3009 ? ConstructedBaseClassShadowDecl
3011 ->getDeclContext());
3040 void anchor()
override;
3057 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
3063 UsingLocation(UL), QualifierLoc(QualifierLoc),
3064 DNLoc(NameInfo.
getInfo()), FirstUsingShadow(
nullptr, HasTypenameKeyword) {
3127 return x.Current == y.Current;
3130 return x.Current != y.Current;
3157 bool HasTypenameKeyword);
3186 public Mergeable<UnresolvedUsingValueDecl> {
3187 void anchor()
override;
3205 UsingLocation(UsingLoc), QualifierLoc(QualifierLoc),
3270 public Mergeable<UnresolvedUsingTypenameDecl> {
3271 void anchor()
override;
3284 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
3286 TypenameLocation(TypenameLoc), QualifierLoc(QualifierLoc) { }
3328 virtual void anchor();
3329 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
3336 :
Decl(StaticAssert, DC, StaticAssertLoc),
3337 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
3338 RParenLoc(RParenLoc) { }
3353 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
3401 GetterId(Getter), SetterId(Setter) {}
3410 static bool classof(
const Decl *D) {
return D->getKind() == MSProperty; }
llvm::iterator_range< base_class_iterator > base_class_range
Defines the clang::ASTContext interface.
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.
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
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.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
A (possibly-)qualified type.
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 allowConstDefaultInit() const
Determine whether declaring a const variable with this type is ok per core issue 253.
bool isUserProvided() const
True if this method is user-declared and was not deleted or defaulted on its first declaration...
Iterates through the using shadow declarations associated with this using declaration.
const UsingDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
FunctionType - C99 6.7.5.3 - Function Declarators.
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
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.
bool hasDefinition() const
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
RefQualifierKind getRefQualifier() const
Retrieve the ref-qualifier associated with this method.
The base class of the type hierarchy.
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
bool forallBases(ForallBasesCallback BaseMatches, bool AllowShortCircuit=true) const
Determines if the given callback holds for all the direct or indirect base classes of this type...
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.
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.
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
const UnresolvedUsingTypenameDecl * getCanonicalDecl() const
bool isCopyAssignmentOperator() const
Determine whether this is a copy-assignment operator, regardless of whether it was declared implicitl...
friend bool operator!=(shadow_iterator x, shadow_iterator y)
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
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.
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
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
static bool FindOMPReductionMember(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, DeclarationName Name)
Base-class lookup callback that determines whether there exists an OpenMP declare reduction member wi...
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
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.
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.
RecordDecl - Represents a struct/union/class.
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
An iterator over the friend declarations of a class.
Description of a constructor that was inherited from a base 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.
One of these records is kept for each identifier that is lexed.
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()
Returns the parent of this method declaration, which is the class in which this method is defined...
StringLiteral * getMessage()
static bool classof(const Decl *D)
const UnresolvedUsingValueDecl * getCanonicalDecl() const
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
SourceRange getSourceRange() const override LLVM_READONLY
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').
static bool classof(const Decl *D)
bool isExplicitSpecified() const
Determine whether this constructor declaration has the explicit keyword specified.
SourceLocation getLocStart() const LLVM_READONLY
QualType getReturnType() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool hasInheritedConstructor() const
Determine whether this class has a using-declaration that names a user-declared base class constructo...
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)
bool isPure() const
Whether this virtual function is pure, i.e.
void startDefinition()
Starts the definition of this tag declaration.
redecl_iterator redecls_begin() const
CXXMethodDecl * getCanonicalDecl() override
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.
The iterator over UnresolvedSets.
static bool classof(const Decl *D)
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
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
static bool classofKind(Kind K)
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
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 isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...
bool hasMoveConstructor() const
Determine whether this class has a move constructor.
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
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
Returns the parent of this method declaration, which is the class in which this method is defined...
bool isDefaulted() const
Whether this function is defaulted per C++0x.
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...
TypeDecl - Represents a declaration of a type.
void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl)
Set the mangling number and context declaration for a lambda class.
llvm::function_ref< bool(const CXXBaseSpecifier *Specifier, CXXBasePath &Path)> BaseMatchesCallback
Function type used by lookupInBases() to determine whether a specific base class subobject matches th...
bool isExplicitSpecified() const
Whether this conversion function declaration is marked "explicit", meaning that it can only be used f...
static DeclContext * castToDeclContext(const LinkageSpecDecl *D)
const UsingShadowDecl * getCanonicalDecl() const
CXXRecordDecl * getCanonicalDecl() override
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
SourceRange getSourceRange() const override LLVM_READONLY
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)
CXXConstructorDecl * getConstructor() const
Get the constructor or constructor template in the derived class correspnding to this using shadow de...
Represents a linkage specification.
base_class_const_range vbases() const
SourceRange getSourceRange() const override LLVM_READONLY
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
bool isWritten() const
Determine whether this initializer is explicitly written in the source code.
decl_iterator decls_begin() const
detail::InMemoryDirectory::const_iterator I
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
Returns the location of the alias name, i.e.
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.
CXXConstructorDecl * getConstructor() const
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
bool hasConstexprNonCopyMoveConstructor() const
Determine whether this class has at least one constexpr constructor other than the copy or move const...
TypeLoc getBaseClassLoc() const
If this is a base class initializer, returns the type of the base class with location information...
llvm::iterator_range< shadow_iterator > shadow_range
InheritedConstructor(ConstructorUsingShadowDecl *Shadow, CXXConstructorDecl *BaseCtor)
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.
Represents a prototype with parameter type info, e.g.
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.
bool needsImplicitMoveAssignment() const
Determine whether this class should get an implicit move assignment operator or if any existing speci...
FieldDecl * getAnonField() const
init_reverse_iterator init_rbegin()
bool isGenericLambda() const
Determine whether this class describes a generic lambda function object (i.e.
init_const_range inits() const
static StaticAssertDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StaticAssertLoc, Expr *AssertExpr, StringLiteral *Message, SourceLocation RParenLoc, bool Failed)
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)
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
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++11 [class.copy]p3), which can be used to...
bool isDeleted() const
Whether this function has been deleted.
const LambdaCapture * capture_const_iterator
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
unsigned getTypeQualifiers() const
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
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...
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
static bool FindNestedNameSpecifierMember(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, DeclarationName Name)
Base-class lookup callback that determines whether there exists a member with the given name that can...
base_class_iterator vbases_end()
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
const CXXConstructorDecl * getCanonicalDecl() const
llvm::function_ref< bool(const CXXRecordDecl *BaseDefinition)> ForallBasesCallback
Function type used by forallBases() as a callback.
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)
static CXXConstructorDecl * CreateDeserialized(ASTContext &C, unsigned ID, bool InheritsConstructor)
StorageClass
Storage classes.
ArrayRef< VarDecl * > getArrayIndices()
bool isIndirectMemberInitializer() const
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
static bool FindOrdinaryMember(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, DeclarationName Name)
Base-class lookup callback that determines whether there exists a member with the given name...
bool isCopyConstructor() const
Whether this constructor is a copy constructor (C++ [class.copy]p2, which can be used to copy the cla...
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
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
unsigned getNumBases() const
Retrieves the number of base classes of this class.
base_class_const_range bases() const
void setDescribedClassTemplate(ClassTemplateDecl *Template)
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
const Expr * getAssertExpr() const
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.
void setColonLoc(SourceLocation CLoc)
Sets the location of the colon.
specific_decl_iterator< CXXMethodDecl > method_iterator
Iterator access to method members.
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
static CXXDestructorDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Encodes a location in the source.
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.
bool isValid() const
Return true if this is a valid SourceLocation object.
const VarDecl * getArrayIndex(unsigned I) const
bool hasSimpleMoveConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous move constructor that ...
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
init_iterator init_end()
Retrieve an iterator past the last initializer.
const StringLiteral * getMessage() const
static bool FindBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, const CXXRecordDecl *BaseRecord)
Base-class lookup callback that determines whether the given base class specifier refers to a specifi...
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)
ASTContext::overridden_method_range overridden_method_range
UsingDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
static MSPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
static ConstructorUsingShadowDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static bool classof(const Decl *D)
RefQualifierKind
The kind of C++11 ref-qualifier associated with a function type.
static bool classof(const Decl *D)
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
static ConstructorUsingShadowDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, UsingDecl *Using, NamedDecl *Target, bool IsVirtual)
void setIsParsingBaseSpecifiers()
SourceLocation getBegin() const
const T * castAs() const
Member-template castAs<specific type>.
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.
std::forward_iterator_tag iterator_category
ConstructorUsingShadowDecl * getShadowDecl() const
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
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)
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
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...
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
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)
Returns true if the given operator is implicitly static in a record context.
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').
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
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 setConstructor(NamedDecl *Ctor)
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
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)
Removes a conversion function from this class.
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).
DeclarationName - The name of a declaration.
bool lookupInBases(BaseMatchesCallback BaseMatches, CXXBasePaths &Paths) const
Look for entities within the base classes of this C++ class, transitively searching all base class su...
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.
UsingShadowDecl(Kind K, ASTContext &C, DeclContext *DC, SourceLocation Loc, UsingDecl *Using, NamedDecl *Target)
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...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
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.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
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
const T * getAs() const
Member-template getAs<specific type>'.
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
Whether this constructor is a converting constructor (C++ [class.conv.ctor]), which can be used for u...
base_class_const_iterator bases_end() const
static CXXMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
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.
static bool FindTagMember(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, DeclarationName Name)
Base-class lookup callback that determines whether there exists a tag with the given name...
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
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
TemplateParameterList * getGenericLambdaTemplateParameterList() const
Retrieve the generic lambda's template parameter list.
bool isDefaultConstructor() const
Whether this constructor is a default constructor (C++ [class.ctor]p5), which can be used to default-...
static bool classofKind(Kind K)
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
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...
bool isAggregate() const
Determine whether this class is an aggregate (C++ [dcl.init.aggr]), which is a class with no user-dec...
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.
An object for streaming information to a record.
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)
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.
StringLiteral - This represents a string literal expression, e.g.
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
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
conversion_iterator conversion_begin() const
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
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.
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
bool hasDefaultConstructor() const
Determine whether this class has any default constructors.
An instance of this class represents the declaration of a property member.
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)
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
FunctionDecl * getCanonicalDecl() override
NamedDecl - This represents a decl with a name.
const CXXRecordDecl * getParent() const
Returns the parent of this using shadow declaration, which is the class in which this is declared...
static DeclarationName getUsingDirectiveName()
getUsingDirectiveName - Return name for all using-directives.
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
Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inher...
LambdaCaptureDefault getLambdaCaptureDefault() const
bool nullFieldOffsetIsZero() const
In the Microsoft C++ ABI, use zero for the field offset of a null data member pointer if we can guara...
static bool FindVirtualBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, const CXXRecordDecl *BaseRecord)
Base-class lookup callback that determines whether the given base class specifier refers to a specifi...
static CXXConstructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isExplicit, bool isInline, bool isImplicitlyDeclared, bool isConstexpr, InheritedConstructor Inherited=InheritedConstructor())
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
bool hasInheritedAssignment() const
Determine whether this class has a using-declaration that names a base class assignment operator...
init_const_iterator init_end() const
Retrieve an iterator past the last initializer.
base_class_range vbases()
overridden_method_range overridden_methods() const
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.
Defines the LambdaCapture class.
DeclContext(Decl::Kind K)
void viewInheritance(ASTContext &Context) const
Renders and displays an inheritance diagram for this C++ class and all of its base classes (transitiv...
SourceRange getSourceRange() const override LLVM_READONLY
CXXRecordDecl * getParent()
DeclarationNameInfo getNameInfo() const
bool isPOD() const
Whether this class is a POD-type (C++ [class]p4)