25 unsigned NumPublicPaths = 0;
38 if (PathElement.Base->isVirtual())
41 if (NumPublicPaths > 1)
47 PathElement.Base->getType()->getAsCXXRecordDecl());
52 if (NumPublicPaths == 0)
56 if (NumPublicPaths > 1)
73 if (
Base->isVirtual())
81 auto *BaseDecl =
Base->getType()->castAsCXXRecordDecl();
82 return BaseDecl->isEmpty() ||
99 auto *BaseDecl =
Base->getType()->castAsCXXRecordDecl();
100 if (
Base->isVirtual()) {
102 if (!Bases.VirtualBases.insert(BaseDecl).second) {
107 if (Bases.NonVirtualBases.count(BaseDecl))
112 if (!Bases.NonVirtualBases.insert(BaseDecl).second) {
117 if (Bases.VirtualBases.count(BaseDecl))
123 for (
const auto &I : BaseDecl->bases())
134 for (
const auto &I : RD->
bases())
142 return !RecordTy->getDecl()->getDefinitionOrSelf()->isCompleteDefinition();
146 if (
const auto *RecordTy = dyn_cast<RecordType>(Ty)) {
151 if (
const auto *PointerTy = dyn_cast<PointerType>(Ty))
154 if (
const auto *MemberPointerTy = dyn_cast<MemberPointerType>(Ty)) {
156 if (!MemberPointerTy->getMostRecentCXXRecordDecl()->hasDefinition())
168 if (
Type.isConstQualified())
170 if (
Type.isVolatileQualified())
172 if (
Type.isRestrictQualified())
183 if (Proto->isNothrow()) {
211 case BuiltinType::Void:
212 case BuiltinType::NullPtr:
213 case BuiltinType::Bool:
214 case BuiltinType::WChar_S:
215 case BuiltinType::WChar_U:
216 case BuiltinType::Char_U:
217 case BuiltinType::Char_S:
218 case BuiltinType::UChar:
219 case BuiltinType::SChar:
220 case BuiltinType::Short:
221 case BuiltinType::UShort:
222 case BuiltinType::Int:
223 case BuiltinType::UInt:
224 case BuiltinType::Long:
225 case BuiltinType::ULong:
226 case BuiltinType::LongLong:
227 case BuiltinType::ULongLong:
228 case BuiltinType::Half:
229 case BuiltinType::Float:
230 case BuiltinType::Double:
231 case BuiltinType::LongDouble:
232 case BuiltinType::Float16:
233 case BuiltinType::Float128:
234 case BuiltinType::Ibm128:
235 case BuiltinType::Char8:
236 case BuiltinType::Char16:
237 case BuiltinType::Char32:
238 case BuiltinType::Int128:
239 case BuiltinType::UInt128:
242#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
243 case BuiltinType::Id:
244#include "clang/Basic/OpenCLImageTypes.def"
245#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) case BuiltinType::Id:
246#include "clang/Basic/OpenCLExtensionTypes.def"
247 case BuiltinType::OCLSampler:
248 case BuiltinType::OCLEvent:
249 case BuiltinType::OCLClkEvent:
250 case BuiltinType::OCLQueue:
251 case BuiltinType::OCLReserveID:
252#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
253#include "clang/Basic/AArch64ACLETypes.def"
254#define PPC_VECTOR_TYPE(Name, Id, Size) case BuiltinType::Id:
255#include "clang/Basic/PPCTypes.def"
256#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
257#include "clang/Basic/RISCVVTypes.def"
258#define WASM_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
259#include "clang/Basic/WebAssemblyReferenceTypes.def"
260#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) case BuiltinType::Id:
261#include "clang/Basic/AMDGPUTypes.def"
262#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
263#include "clang/Basic/HLSLIntangibleTypes.def"
264#define HLSL_PACKED_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
265#include "clang/Basic/HLSLPackedTypes.def"
266#define SPIRV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
267#include "clang/Basic/SPIRVTypes.def"
268 case BuiltinType::ShortAccum:
269 case BuiltinType::Accum:
270 case BuiltinType::LongAccum:
271 case BuiltinType::UShortAccum:
272 case BuiltinType::UAccum:
273 case BuiltinType::ULongAccum:
274 case BuiltinType::ShortFract:
275 case BuiltinType::Fract:
276 case BuiltinType::LongFract:
277 case BuiltinType::UShortFract:
278 case BuiltinType::UFract:
279 case BuiltinType::ULongFract:
280 case BuiltinType::SatShortAccum:
281 case BuiltinType::SatAccum:
282 case BuiltinType::SatLongAccum:
283 case BuiltinType::SatUShortAccum:
284 case BuiltinType::SatUAccum:
285 case BuiltinType::SatULongAccum:
286 case BuiltinType::SatShortFract:
287 case BuiltinType::SatFract:
288 case BuiltinType::SatLongFract:
289 case BuiltinType::SatUShortFract:
290 case BuiltinType::SatUFract:
291 case BuiltinType::SatULongFract:
292 case BuiltinType::BFloat16:
293 case BuiltinType::MetaInfo:
296 case BuiltinType::Dependent:
297#define BUILTIN_TYPE(Id, SingletonId)
298#define PLACEHOLDER_TYPE(Id, SingletonId) case BuiltinType::Id:
299#include "clang/AST/BuiltinTypes.def"
300 llvm_unreachable(
"asking for RRTI for a placeholder type!");
302 case BuiltinType::ObjCId:
303 case BuiltinType::ObjCClass:
304 case BuiltinType::ObjCSel:
305 llvm_unreachable(
"FIXME: Objective-C types are unsupported!");
308 llvm_unreachable(
"Invalid BuiltinType Kind!");
313 const BuiltinType *BuiltinTy = dyn_cast<BuiltinType>(PointeeTy);
329 if (
const BuiltinType *BuiltinTy = dyn_cast<BuiltinType>(Ty))
334 if (
const PointerType *PointerTy = dyn_cast<PointerType>(Ty))
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D,...
QualType getFunctionTypeWithExceptionSpec(QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI) const
Get a function type and produce the equivalent function type with the specified exception specificati...
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
CharUnits getBaseClassOffset(const CXXRecordDecl *Base) const
getBaseClassOffset - Get the offset, in chars, for the given base class.
This class is used for builtin types like 'int'.
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
Represents a base class of a C++ class.
Represents a C++ struct/union/class.
unsigned getNumBases() const
Retrieves the number of base classes of this class.
base_class_iterator bases_begin()
const CXXBaseSpecifier * base_class_const_iterator
Iterator that traverses the base classes of a class.
bool isDynamicClass() const
bool isDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is derived from the class Base.
This is an opaque type for sizes expressed in character units.
static CharUnits fromQuantity(QuantityType Quantity)
Construct a CharUnits quantity from a raw integer type.
Represents a prototype with parameter type info, e.g.
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
A (possibly-)qualified type.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
The collection of all-type qualifiers we support.
The base class of the type hierarchy.
const T * getAs() const
Member-template getAs<specific type>'.
unsigned extractPBaseFlags(const ASTContext &Ctx, QualType &Type)
Compute the flags for a __pbase_type_info, and remove the corresponding pieces from Type.
@ VMI_NonDiamondRepeat
VMI_NonDiamondRepeat - Class has non-diamond repeated inheritance.
@ VMI_DiamondShaped
VMI_DiamondShaped - Class is diamond shaped.
bool containsIncompleteClassType(QualType Ty)
Returns whether the given type contains an incomplete class type.
static bool typeInfoIsInStandardLibrary(const BuiltinType *Ty)
Given a builtin type, returns whether the type info for that type is defined in the standard library.
bool canUseSingleInheritance(const CXXRecordDecl *RD)
Return whether the given record decl has a "single, public, non-virtual base at offset zero (i....
static bool isIncompleteClassType(const RecordType *RecordTy)
Returns whether the given record type is incomplete.
unsigned computeVMIClassTypeInfoFlags(const CXXRecordDecl *RD)
Compute the value of the flags member in abi::__vmi_class_type_info.
CharUnits computeOffsetHint(ASTContext &Ctx, const CXXRecordDecl *Src, const CXXRecordDecl *Dst)
Compute the src2dst_offset hint as described in the Itanium C++ ABI [2.9.7].
bool isStandardLibraryRTTIDescriptor(QualType Ty)
Returns whether the type information for the given type exists in the standard library.
@ PTI_Restrict
PTI_Restrict - Type has restrict qualifier.
@ PTI_Const
PTI_Const - Type has const qualifier.
@ PTI_Noexcept
PTI_TransactionSafe - Pointee is transaction_safe function (C++ TM TS).
@ PTI_Volatile
PTI_Volatile - Type has volatile qualifier.
@ PTI_Incomplete
PTI_Incomplete - Type is incomplete.
@ EST_None
no exception specification
Represents an element in a path from a derived class to a base class.