Warning, /include/clang/AST/CXXRecordDeclDefinitionBits.def is written in an unsupported language. File is not indexed.
0001 //===-- CXXRecordDeclDefinitionBits.def - Class definition bits -*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file enumerates the various bitfields that we want to store on C++ class
0010 // definitions.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 //
0014 /// @file CXXRecordDeclDefinitionBits.def
0015 ///
0016 /// In this file, each of the bitfields representing data about a C++ class
0017 /// results in an expansion of the FIELD macro, which should be defined before
0018 /// including this file.
0019 ///
0020 /// The macro have three operands:
0021 ///
0022 /// Name: The name of the field, as a member of CXXRecordDecl::DefinitionData.
0023 ///
0024 /// BitWidth: The width of the field in bits.
0025 ///
0026 /// MergePolicy: How to behave when the value of the field is different in
0027 /// multiple translation units, one of:
0028 /// NO_MERGE: It is an ODR violation if the fields do not match.
0029 /// MERGE_OR: Merge the fields by ORing them together.
0030
0031 #ifndef FIELD
0032 #error define FIELD before including this file
0033 #endif
0034
0035 /// True if this class has any user-declared constructors.
0036 FIELD(UserDeclaredConstructor, 1, NO_MERGE)
0037
0038 /// The user-declared special members which this class has.
0039 FIELD(UserDeclaredSpecialMembers, 6, NO_MERGE)
0040
0041 /// True when this class is an aggregate.
0042 FIELD(Aggregate, 1, NO_MERGE)
0043
0044 /// True when this class is a POD-type.
0045 FIELD(PlainOldData, 1, NO_MERGE)
0046
0047 /// True when this class is empty for traits purposes, that is:
0048 /// * has no data members other than 0-width bit-fields and empty fields
0049 /// marked [[no_unique_address]]
0050 /// * has no virtual function/base, and
0051 /// * doesn't inherit from a non-empty class.
0052 /// Doesn't take union-ness into account.
0053 FIELD(Empty, 1, NO_MERGE)
0054
0055 /// True when this class is polymorphic, i.e., has at
0056 /// least one virtual member or derives from a polymorphic class.
0057 FIELD(Polymorphic, 1, NO_MERGE)
0058
0059 /// True when this class is abstract, i.e., has at least
0060 /// one pure virtual function, (that can come from a base class).
0061 FIELD(Abstract, 1, NO_MERGE)
0062
0063 /// True when this class is standard-layout, per the applicable
0064 /// language rules (including DRs).
0065 FIELD(IsStandardLayout, 1, NO_MERGE)
0066
0067 /// True when this class was standard-layout under the C++11
0068 /// definition.
0069 ///
0070 /// C++11 [class]p7. A standard-layout class is a class that:
0071 /// * has no non-static data members of type non-standard-layout class (or
0072 /// array of such types) or reference,
0073 /// * has no virtual functions (10.3) and no virtual base classes (10.1),
0074 /// * has the same access control (Clause 11) for all non-static data
0075 /// members
0076 /// * has no non-standard-layout base classes,
0077 /// * either has no non-static data members in the most derived class and at
0078 /// most one base class with non-static data members, or has no base
0079 /// classes with non-static data members, and
0080 /// * has no base classes of the same type as the first non-static data
0081 /// member.
0082 FIELD(IsCXX11StandardLayout, 1, NO_MERGE)
0083
0084 /// True when any base class has any declared non-static data
0085 /// members or bit-fields.
0086 /// This is a helper bit of state used to implement IsStandardLayout more
0087 /// efficiently.
0088 FIELD(HasBasesWithFields, 1, NO_MERGE)
0089
0090 /// True when any base class has any declared non-static data
0091 /// members.
0092 /// This is a helper bit of state used to implement IsCXX11StandardLayout
0093 /// more efficiently.
0094 FIELD(HasBasesWithNonStaticDataMembers, 1, NO_MERGE)
0095
0096 /// True when there are private non-static data members.
0097 FIELD(HasPrivateFields, 1, NO_MERGE)
0098
0099 /// True when there are protected non-static data members.
0100 FIELD(HasProtectedFields, 1, NO_MERGE)
0101
0102 /// True when there are private non-static data members.
0103 FIELD(HasPublicFields, 1, NO_MERGE)
0104
0105 /// True if this class (or any subobject) has mutable fields.
0106 FIELD(HasMutableFields, 1, NO_MERGE)
0107
0108 /// True if this class (or any nested anonymous struct or union)
0109 /// has variant members.
0110 FIELD(HasVariantMembers, 1, NO_MERGE)
0111
0112 /// True if there no non-field members declared by the user.
0113 FIELD(HasOnlyCMembers, 1, NO_MERGE)
0114
0115 /// True if there is an '__init' method defined by the user.
0116 FIELD(HasInitMethod, 1, NO_MERGE)
0117
0118 /// True if any field has an in-class initializer, including those
0119 /// within anonymous unions or structs.
0120 FIELD(HasInClassInitializer, 1, NO_MERGE)
0121
0122 /// True if any field is of reference type, and does not have an
0123 /// in-class initializer.
0124 ///
0125 /// In this case, value-initialization of this class is illegal in C++98
0126 /// even if the class has a trivial default constructor.
0127 FIELD(HasUninitializedReferenceMember, 1, NO_MERGE)
0128
0129 /// True if any non-mutable field whose type doesn't have a user-
0130 /// provided default ctor also doesn't have an in-class initializer.
0131 FIELD(HasUninitializedFields, 1, NO_MERGE)
0132
0133 /// True if there are any member using-declarations that inherit
0134 /// constructors from a base class.
0135 FIELD(HasInheritedConstructor, 1, NO_MERGE)
0136
0137 /// True if there are any member using-declarations that inherit
0138 /// default constructors from a base class.
0139 FIELD(HasInheritedDefaultConstructor, 1, NO_MERGE)
0140
0141 /// True if there are any member using-declarations named
0142 /// 'operator='.
0143 FIELD(HasInheritedAssignment, 1, NO_MERGE)
0144
0145 /// These flags are \c true if a defaulted corresponding special
0146 /// member can't be fully analyzed without performing overload resolution.
0147 /// @{
0148 FIELD(NeedOverloadResolutionForCopyConstructor, 1, NO_MERGE)
0149 FIELD(NeedOverloadResolutionForMoveConstructor, 1, NO_MERGE)
0150 FIELD(NeedOverloadResolutionForCopyAssignment, 1, NO_MERGE)
0151 FIELD(NeedOverloadResolutionForMoveAssignment, 1, NO_MERGE)
0152 FIELD(NeedOverloadResolutionForDestructor, 1, NO_MERGE)
0153 /// @}
0154
0155 /// These flags are \c true if an implicit defaulted corresponding
0156 /// special member would be defined as deleted.
0157 /// @{
0158 FIELD(DefaultedCopyConstructorIsDeleted, 1, NO_MERGE)
0159 FIELD(DefaultedMoveConstructorIsDeleted, 1, NO_MERGE)
0160 FIELD(DefaultedCopyAssignmentIsDeleted, 1, NO_MERGE)
0161 FIELD(DefaultedMoveAssignmentIsDeleted, 1, NO_MERGE)
0162 FIELD(DefaultedDestructorIsDeleted, 1, NO_MERGE)
0163 /// @}
0164
0165 /// The trivial special members which this class has, per
0166 /// C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25,
0167 /// C++11 [class.dtor]p5, or would have if the member were not suppressed.
0168 ///
0169 /// This excludes any user-declared but not user-provided special members
0170 /// which have been declared but not yet defined.
0171 FIELD(HasTrivialSpecialMembers, 6, MERGE_OR)
0172
0173 /// These bits keep track of the triviality of special functions for the
0174 /// purpose of calls. Only the bits corresponding to SMF_CopyConstructor,
0175 /// SMF_MoveConstructor, and SMF_Destructor are meaningful here.
0176 FIELD(HasTrivialSpecialMembersForCall, 6, MERGE_OR)
0177
0178 /// The declared special members of this class which are known to be
0179 /// non-trivial.
0180 ///
0181 /// This excludes any user-declared but not user-provided special members
0182 /// which have been declared but not yet defined, and any implicit special
0183 /// members which have not yet been declared.
0184 FIELD(DeclaredNonTrivialSpecialMembers, 6, MERGE_OR)
0185
0186 /// These bits keep track of the declared special members that are
0187 /// non-trivial for the purpose of calls.
0188 /// Only the bits corresponding to SMF_CopyConstructor,
0189 /// SMF_MoveConstructor, and SMF_Destructor are meaningful here.
0190 FIELD(DeclaredNonTrivialSpecialMembersForCall, 6, MERGE_OR)
0191
0192 /// True when this class has a destructor with no semantic effect.
0193 FIELD(HasIrrelevantDestructor, 1, NO_MERGE)
0194
0195 /// True when this class has at least one user-declared constexpr
0196 /// constructor which is neither the copy nor move constructor.
0197 FIELD(HasConstexprNonCopyMoveConstructor, 1, MERGE_OR)
0198
0199 /// True if this class has a (possibly implicit) defaulted default
0200 /// constructor.
0201 FIELD(HasDefaultedDefaultConstructor, 1, MERGE_OR)
0202
0203 /// True if a defaulted default constructor for this class would
0204 /// be constexpr.
0205 FIELD(DefaultedDefaultConstructorIsConstexpr, 1, NO_MERGE)
0206
0207 /// True if this class has a constexpr default constructor.
0208 ///
0209 /// This is true for either a user-declared constexpr default constructor
0210 /// or an implicitly declared constexpr default constructor.
0211 FIELD(HasConstexprDefaultConstructor, 1, MERGE_OR)
0212
0213 /// True if a defaulted destructor for this class would be constexpr.
0214 FIELD(DefaultedDestructorIsConstexpr, 1, NO_MERGE)
0215
0216 /// True when this class contains at least one non-static data
0217 /// member or base class of non-literal or volatile type.
0218 FIELD(HasNonLiteralTypeFieldsOrBases, 1, NO_MERGE)
0219
0220 /// True if this class is a structural type, assuming it is a literal type.
0221 FIELD(StructuralIfLiteral, 1, NO_MERGE)
0222
0223 /// Whether we have a C++11 user-provided default constructor (not
0224 /// explicitly deleted or defaulted).
0225 FIELD(UserProvidedDefaultConstructor, 1, NO_MERGE)
0226
0227 /// The special members which have been declared for this class,
0228 /// either by the user or implicitly.
0229 FIELD(DeclaredSpecialMembers, 6, MERGE_OR)
0230
0231 /// Whether an implicit copy constructor could have a const-qualified
0232 /// parameter, for initializing virtual bases and for other subobjects.
0233 FIELD(ImplicitCopyConstructorCanHaveConstParamForVBase, 1, NO_MERGE)
0234 FIELD(ImplicitCopyConstructorCanHaveConstParamForNonVBase, 1, NO_MERGE)
0235
0236 /// Whether an implicit copy assignment operator would have a
0237 /// const-qualified parameter.
0238 FIELD(ImplicitCopyAssignmentHasConstParam, 1, NO_MERGE)
0239
0240 /// Whether any declared copy constructor has a const-qualified
0241 /// parameter.
0242 FIELD(HasDeclaredCopyConstructorWithConstParam, 1, MERGE_OR)
0243
0244 /// Whether any declared copy assignment operator has either a
0245 /// const-qualified reference parameter or a non-reference parameter.
0246 FIELD(HasDeclaredCopyAssignmentWithConstParam, 1, MERGE_OR)
0247
0248 /// Whether the destructor is no-return. Either explicitly, or if any
0249 /// base classes or fields have a no-return destructor
0250 FIELD(IsAnyDestructorNoReturn, 1, NO_MERGE)
0251
0252 /// Whether the record type is intangible (if any base classes or fields have
0253 /// type that is intangible). HLSL only.
0254 FIELD(IsHLSLIntangible, 1, NO_MERGE)
0255
0256 #undef FIELD