65 for (
const auto *nd : indirectField->
chain()) {
80 "Must have member initializer!");
81 assert(memberInit->
getInit() &&
"Must have initializer!");
114 "emitMemberInitializer: array of non-record type");
131struct DynamicThisUseChecker
132 : ConstEvaluatedExprVisitor<DynamicThisUseChecker> {
133 using super = ConstEvaluatedExprVisitor<DynamicThisUseChecker>;
135 bool usesThis =
false;
137 DynamicThisUseChecker(
const ASTContext &
c) : super(
c) {}
144 void VisitCXXThisExpr(
const CXXThisExpr *e) { usesThis =
true; }
149 DynamicThisUseChecker checker(
c);
151 return checker.usesThis;
173 return builder.createBaseClassAddr(loc, thisAddr,
convertType(base),
181 assert(
curFuncDecl &&
"loading 'this' without a func declaration?");
202 loc, thisPtr, classDecl, baseClassDecl, isBaseVirtual);
232 bool constructVBases = ctorType !=
Ctor_Base &&
235 if (constructVBases &&
236 !
cgm.getTarget().getCXXABI().hasConstructorVariants()) {
238 "emitCtorPrologue: virtual base without variants");
243 auto allInits = cd->
inits();
246 auto virtualBaseEnd = std::find_if(
248 return !(Init->isBaseInitializer() && Init->isBaseVirtual());
251 auto nonVirtualBaseEnd = std::find_if(virtualBaseEnd, allInits.end(),
253 return !Init->isBaseInitializer();
257 auto virtualBaseInits = llvm::make_range(allInits.begin(), virtualBaseEnd);
258 auto nonVirtualBaseInits =
259 llvm::make_range(virtualBaseEnd, nonVirtualBaseEnd);
260 auto memberInits = llvm::make_range(nonVirtualBaseEnd, allInits.end());
265 if (
cgm.getCodeGenOpts().StrictVTablePointers &&
266 cgm.getCodeGenOpts().OptimizationLevel > 0 &&
271 "emitCtorPrologue: strict vtable pointers for vbase");
278 if (!constructVBases)
280 emitInitializer(virtualBaseInit);
287 assert(!nonVirtualBaseInit->isBaseVirtual());
288 emitInitializer(nonVirtualBaseInit);
303 assert(!member->isBaseInitializer());
304 assert(member->isAnyMemberInitializer() &&
305 "Delegating initializer on non-delegating constructor");
312 CharUnits nonVirtualOffset, mlir::Value virtualOffset,
314 mlir::Type baseValueTy = {},
bool assumeNotNull =
true) {
316 assert(!nonVirtualOffset.
isZero() || virtualOffset !=
nullptr);
319 mlir::Value baseOffset;
320 if (!nonVirtualOffset.
isZero()) {
324 "applyNonVirtualAndVirtualOffset: virtual and non-virtual offset");
327 assert(baseValueTy &&
"expected base type");
330 loc, addr, baseValueTy, nonVirtualOffset.
getQuantity(),
334 baseOffset = virtualOffset;
343 mlir::Value adjusted = cir::PtrStrideOp::create(
344 cgf.
getBuilder(), loc, charPtrType, charPtr, baseOffset);
351 assert(nearestVBase &&
"virtual offset without vbase?");
359 return Address(ptr, alignment);
365 mlir::Value vtableAddressPoint =
366 cgm.getCXXABI().getVTableAddressPointInStructor(
369 if (!vtableAddressPoint)
373 mlir::Value virtualOffset{};
376 mlir::Type baseValueTy;
377 if (
cgm.getCXXABI().isVirtualOffsetNeededForVTableField(*
this, vptr)) {
380 virtualOffset =
cgm.getCXXABI().getVirtualBaseClassOffset(
392 if (!nonVirtualOffset.
isZero() || virtualOffset) {
394 loc, *
this, classAddr, nonVirtualOffset, virtualOffset,
403 auto vtablePtr = cir::VTableGetVPtrOp::create(
404 builder, loc, builder.getPtrToVPtrType(), classAddr.
getPointer());
406 builder.createStore(loc, vtableAddressPoint, vtableField);
418 if (
cgm.getCXXABI().doStructorsInitializeVPtrs(rd))
423 cgm.getCXXABI().initializeHiddenVirtualInheritanceMembers(*
this, rd);
433 false, vtableClass, vbases,
441 bool baseIsNonVirtualPrimaryBase,
447 if (!baseIsNonVirtualPrimaryBase) {
449 VPtr vptr = {base, nearestVBase, offsetFromNearestVBase, vtableClass};
450 vptrs.push_back(vptr);
455 for (
const auto &nextBase : rd->
bases()) {
456 const auto *baseDecl =
458 nextBase.getType()->castAs<RecordType>()->getOriginalDecl())
459 ->getDefinitionOrSelf();
462 if (!baseDecl->isDynamicClass())
467 bool baseDeclIsNonVirtualPrimaryBase;
470 if (nextBase.isVirtual()) {
472 if (!vbases.insert(baseDecl).second)
478 nextBaseDecl = baseDecl;
481 baseDeclIsNonVirtualPrimaryBase =
false;
485 nextBaseDecl = nearestVBase;
487 baseOffsetFromNearestVBase =
489 baseDeclIsNonVirtualPrimaryBase = layout.
getPrimaryBase() == baseDecl;
493 baseOffsetFromNearestVBase,
494 baseDeclIsNonVirtualPrimaryBase, vtableClass, vbases,
500 assert(
curFuncDecl &&
"loading 'this' without a func declaration?");
555 return std::min(actualBaseAlign, expectedTargetAlign);
579 if (actualBaseAlign >= expectedBaseAlign)
580 return expectedTargetAlign;
585 return std::min(actualBaseAlign, expectedTargetAlign);
617 bool zeroInitialize) {
621 newPointerIsChecked, zeroInitialize);
642 auto arrayTy = mlir::cast<cir::ArrayType>(arrayBase.
getElementType());
643 mlir::Type elementType = arrayTy.getElementType();
646 while (
auto maybeArrayTy = mlir::dyn_cast<cir::ArrayType>(elementType))
647 elementType = maybeArrayTy.getElementType();
648 cir::PointerType ptrToElmType = builder.getPointerTo(elementType);
651 if (
auto constantCount = numElements.getDefiningOp<cir::ConstantOp>()) {
652 if (
auto constIntAttr = constantCount.getValueAttr<cir::IntAttr>()) {
654 if (constIntAttr.getUInt() == 0)
657 arrayTy = cir::ArrayType::get(elementType, constIntAttr.getUInt());
661 if (constantCount.use_empty())
662 constantCount.erase();
703 mlir::Value arrayOp =
704 builder.createPtrBitcast(arrayBase.
getPointer(), arrayTy);
705 builder.create<cir::ArrayCtor>(
706 *
currSrcLoc, arrayOp, [&](mlir::OpBuilder &
b, mlir::Location loc) {
707 mlir::BlockArgument arg =
708 b.getInsertionBlock()->addArgument(ptrToElmType, loc);
718 builder.create<cir::YieldOp>(loc);
728 FunctionArgList::const_iterator i = args.begin(), e = args.end();
729 assert(i != e &&
"no parameters to constructor");
738 if (
cgm.getCXXABI().needsVTTParameter(
curGD)) {
739 cgm.errorNYI(loc,
"emitDelegateCXXConstructorCall: VTT parameter");
744 for (; i != e; ++i) {
753 true, thisAddr, delegateArgs, loc);
758 assert(assignOp->isCopyAssignmentOperator() ||
759 assignOp->isMoveAssignmentOperator());
760 const Stmt *rootS = assignOp->getBody();
762 "Body of an implicit assignment operator should be compound stmt.");
774 for (
Stmt *
s : rootCS->body())
776 cgm.errorNYI(
s->getSourceRange(),
777 std::string(
"emitImplicitAssignmentOperatorBody: ") +
778 s->getStmtClassName());
785 cgm.getTypes().arrangeCXXMethodDeclaration(callOperator);
786 cir::FuncOp calleePtr =
cgm.getAddrOfFunction(
787 GlobalDecl(callOperator),
cgm.getTypes().getFunctionType(calleeFnInfo));
805 if (!resultType->isVoidType() && returnSlot.
isNull()) {
806 if (
getLangOpts().ObjCAutoRefCount && resultType->isObjCRetainableType())
808 "emitForwardingCallToLambda: ObjCAutoRefCount");
812 "emitForwardingCallToLambda: return slot is not null");
840 void *InsertPos =
nullptr;
843 assert(correspondingCallOpSpecialization);
863 const auto *record =
type->castAsCXXRecordDecl();
891 "emitDelegatingCXXConstructorCall: exception");
898 bool forVirtualBase,
bool delegating,
900 cgm.getCXXABI().emitDestructorCall(*
this, dd,
type, forVirtualBase,
901 delegating, thisAddr, thisTy);
906 if (!
cgm.getCXXABI().needsVTTParameter(gd))
912 uint64_t subVTTIndex;
917 }
else if (rd == base) {
920 assert(!
cgm.getCXXABI().needsVTTParameter(
curGD) &&
921 "doing no-op VTT offset in base dtor/ctor?");
922 assert(!forVirtualBase &&
"Can't have same class as virtual base!");
931 assert(subVTTIndex != 0 &&
"Sub-VTT index must be greater than zero!");
935 if (
cgm.getCXXABI().needsVTTParameter(
curGD)) {
938 return builder.createVTTAddrPoint(loc, vtt.getType(), vtt, subVTTIndex);
941 cir::GlobalOp vtt =
cgm.getVTables().getAddrOfVTT(rd);
942 return builder.createVTTAddrPoint(
943 loc, builder.getPointerTo(
cgm.VoidPtrTy),
944 mlir::FlatSymbolRefAttr::get(vtt.getSymNameAttr()), subVTTIndex);
950 llvm::iterator_range<CastExpr::path_const_iterator> path,
952 assert(!path.empty() &&
"Base path should not be empty!");
954 if ((*path.begin())->isVirtual()) {
957 cgm.errorNYI(loc,
"getAddrOfBaseClass: virtual base");
965 cgm.computeNonVirtualBaseClassOffset(derived, path);
968 mlir::Type baseValueTy =
convertType((path.end()[-1])->getType());
975 if (nonVirtualOffset.
isZero()) {
977 return builder.createBaseClassAddr(
getLoc(loc), value, baseValueTy, 0,
984 value = builder.createBaseClassAddr(
getLoc(loc), value, baseValueTy,
997 if (!
cgm.getCodeGenOpts().WholeProgramVTables)
1000 if (
cgm.getCodeGenOpts().VirtualFunctionElimination)
1010 auto vtablePtr = cir::VTableGetVPtrOp::create(
1011 builder, loc, builder.getPtrToVPtrType(), thisAddr.
getPointer());
1014 auto vtable = builder.createLoad(loc, vtablePtrAddr);
1017 if (
cgm.getCodeGenOpts().OptimizationLevel > 0 &&
1018 cgm.getCodeGenOpts().StrictVTablePointers) {
1027 bool forVirtualBase,
1071 bool passPrototypeArgs =
true;
1076 "emitCXXConstructorCall: inherited constructor");
1082 cgm.getCXXABI().addImplicitConstructorArgs(*
this, d,
type, forVirtualBase,
1090 cir::CIRCallOpInterface
c;
static bool baseInitializerUsesThis(ASTContext &c, const Expr *init)
static Address applyNonVirtualAndVirtualOffset(mlir::Location loc, CIRGenFunction &cgf, Address addr, CharUnits nonVirtualOffset, mlir::Value virtualOffset, const CXXRecordDecl *derivedClass, const CXXRecordDecl *nearestVBase, mlir::Type baseValueTy={}, bool assumeNotNull=true)
static void emitMemberInitializer(CIRGenFunction &cgf, const CXXRecordDecl *classDecl, CXXCtorInitializer *memberInit, const CXXConstructorDecl *constructor, FunctionArgList &args)
static bool isInitializerOfDynamicClass(const CXXCtorInitializer *baseInit)
static void emitLValueForAnyFieldInitialization(CIRGenFunction &cgf, CXXCtorInitializer *memberInit, LValue &lhs)
Defines the clang::Expr interface and subclasses for C++ expressions.
C Language Family Type Representation.
__device__ __2f16 float __ockl_bool s
__device__ __2f16 float c
mlir::Value createBitcast(mlir::Value src, mlir::Type newTy)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const ConstantArrayType * getAsConstantArrayType(QualType T) const
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D,...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
CanQualType getCanonicalTagType(const TagDecl *TD) const
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
CharUnits getNonVirtualAlignment() const
getNonVirtualAlignment - Get the non-virtual alignment (in chars) of an object, which is the alignmen...
CharUnits getBaseClassOffset(const CXXRecordDecl *Base) const
getBaseClassOffset - Get the offset, in chars, for the given base class.
CharUnits getVBaseClassOffset(const CXXRecordDecl *VBase) const
getVBaseClassOffset - Get the offset, in chars, for the given base class.
const CXXRecordDecl * getPrimaryBase() const
getPrimaryBase - Get the primary base for this record.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
const CXXRecordDecl * getBase() const
getBase - Returns the base class declaration.
CharUnits getBaseOffset() const
getBaseOffset - Returns the base class offset.
mlir::Value getPointer() const
mlir::Type getElementType() const
Address withElementType(CIRGenBuilderTy &builder, mlir::Type ElemTy) const
Return address with different element type, a bitcast pointer, and the same alignment.
clang::CharUnits getAlignment() const
static AggValueSlot forAddr(Address addr, clang::Qualifiers quals, IsDestructed_t isDestructed, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed)
static AggValueSlot forLValue(const LValue &LV, IsDestructed_t isDestructed, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed)
Address getAddress() const
Address createBaseClassAddr(mlir::Location loc, Address addr, mlir::Type destType, unsigned offset, bool assumeNotNull)
static CIRGenCallee forDirect(mlir::Operation *funcPtr, const CIRGenCalleeInfo &abstractInfo=CIRGenCalleeInfo())
A scope within which we are constructing the fields of an object which might use a CXXDefaultInitExpr...
static bool isConstructorDelegationValid(const clang::CXXConstructorDecl *ctor)
Checks whether the given constructor is a valid subject for the complete-to-base constructor delegati...
void emitLambdaDelegatingInvokeBody(const CXXMethodDecl *md)
void emitCallArgs(CallArgList &args, PrototypeWrapper prototype, llvm::iterator_range< clang::CallExpr::const_arg_iterator > argRange, AbstractCallee callee=AbstractCallee(), unsigned paramsToSkip=0)
mlir::Type convertType(clang::QualType t)
static cir::TypeEvaluationKind getEvaluationKind(clang::QualType type)
Return the cir::TypeEvaluationKind of QualType type.
clang::GlobalDecl curGD
The GlobalDecl for the current function being compiled or the global variable currently being initial...
const clang::LangOptions & getLangOpts() const
void emitForwardingCallToLambda(const CXXMethodDecl *lambdaCallOperator, CallArgList &callArgs)
mlir::Value loadCXXThis()
Load the value for 'this'.
LValue makeNaturalAlignPointeeAddrLValue(mlir::Value v, clang::QualType t)
Given a value of type T* that may not be to a complete object, construct an l-vlaue withi the natural...
clang::CharUnits cxxThisAlignment
const clang::Decl * curFuncDecl
Address loadCXXThisAddress()
LValue makeNaturalAlignAddrLValue(mlir::Value val, QualType ty)
mlir::Value getVTTParameter(GlobalDecl gd, bool forVirtualBase, bool delegating)
Return the VTT parameter that should be passed to a base constructor/destructor with virtual bases.
mlir::Location getLoc(clang::SourceLocation srcLoc)
Helpers to convert Clang's SourceLocation to a MLIR Location.
void initializeVTablePointers(mlir::Location loc, const clang::CXXRecordDecl *rd)
void initializeVTablePointer(mlir::Location loc, const VPtr &vptr)
Address getAddressOfBaseClass(Address value, const CXXRecordDecl *derived, llvm::iterator_range< CastExpr::path_const_iterator > path, bool nullCheckValue, SourceLocation loc)
void emitDelegateCXXConstructorCall(const clang::CXXConstructorDecl *ctor, clang::CXXCtorType ctorType, const FunctionArgList &args, clang::SourceLocation loc)
void emitBaseInitializer(mlir::Location loc, const CXXRecordDecl *classDecl, CXXCtorInitializer *baseInit)
void emitExprAsInit(const clang::Expr *init, const clang::ValueDecl *d, LValue lvalue, bool capturedByInit=false)
Emit an expression as an initializer for an object (variable, field, etc.) at the given location.
mlir::Value emitArrayLength(const clang::ArrayType *arrayType, QualType &baseType, Address &addr)
Computes the length of an array in elements, as well as the base element type and a properly-typed fi...
void emitNullInitialization(mlir::Location loc, Address destPtr, QualType ty)
VPtrsVector getVTablePointers(const clang::CXXRecordDecl *vtableClass)
AggValueSlot::Overlap_t getOverlapForFieldInit(const FieldDecl *fd)
void emitImplicitAssignmentOperatorBody(FunctionArgList &args)
void emitCtorPrologue(const clang::CXXConstructorDecl *ctor, clang::CXXCtorType ctorType, FunctionArgList &args)
This routine generates necessary code to initialize base classes and non-static data members belongin...
mlir::Value loadCXXVTT()
Load the VTT parameter to base constructors/destructors have virtual bases.
static Destroyer destroyCXXObject
void emitCXXConstructorCall(const clang::CXXConstructorDecl *d, clang::CXXCtorType type, bool forVirtualBase, bool delegating, AggValueSlot thisAVS, const clang::CXXConstructExpr *e)
mlir::Value getVTablePtr(mlir::Location loc, Address thisAddr, const clang::CXXRecordDecl *vtableClass)
Return the Value of the vtable pointer member pointed to by thisAddr.
llvm::SmallPtrSet< const clang::CXXRecordDecl *, 4 > VisitedVirtualBasesSetTy
void emitReturnOfRValue(mlir::Location loc, RValue rv, QualType ty)
bool shouldEmitVTableTypeCheckedLoad(const CXXRecordDecl *rd)
Returns whether we should perform a type checked load when loading a virtual function for virtual cal...
RValue emitCall(const CIRGenFunctionInfo &funcInfo, const CIRGenCallee &callee, ReturnValueSlot returnValue, const CallArgList &args, cir::CIRCallOpInterface *callOp, mlir::Location loc)
const clang::Decl * curCodeDecl
This is the inner-most code context, which includes blocks.
LValue emitLValueForFieldInitialization(LValue base, const clang::FieldDecl *field, llvm::StringRef fieldName)
Like emitLValueForField, excpet that if the Field is a reference, this will return the address of the...
mlir::Value emitScalarExpr(const clang::Expr *e)
Emit the computation of the specified expression of scalar type.
void emitInitializerForField(clang::FieldDecl *field, LValue lhs, clang::Expr *init)
Address getAddressOfDirectBaseInCompleteClass(mlir::Location loc, Address value, const CXXRecordDecl *derived, const CXXRecordDecl *base, bool baseIsVirtual)
Convert the given pointer to a complete class to the given direct base.
CIRGenBuilderTy & getBuilder()
AggValueSlot::Overlap_t getOverlapForBaseInit(const CXXRecordDecl *rd, const CXXRecordDecl *baseRD, bool isVirtual)
Determine whether a base class initialization may overlap some other object.
void emitComplexExprIntoLValue(const Expr *e, LValue dest, bool isInit)
void emitCXXDestructorCall(const CXXDestructorDecl *dd, CXXDtorType type, bool forVirtualBase, bool delegating, Address thisAddr, QualType thisTy)
llvm::SmallVector< VPtr, 4 > VPtrsVector
void emitLambdaStaticInvokeBody(const CXXMethodDecl *md)
void emitCXXAggrConstructorCall(const CXXConstructorDecl *ctor, const clang::ArrayType *arrayType, Address arrayBegin, const CXXConstructExpr *e, bool newPointerIsChecked, bool zeroInitialize=false)
Emit a loop to call a particular constructor for each of several members of an array.
void emitDelegateCallArg(CallArgList &args, const clang::VarDecl *param, clang::SourceLocation loc)
We are performing a delegate call; that is, the current function is delegating to another one.
std::optional< mlir::Location > currSrcLoc
Use to track source locations across nested visitor traversals.
clang::ASTContext & getContext() const
void emitStoreThroughLValue(RValue src, LValue dst, bool isInit=false)
Store the specified rvalue into the specified lvalue, where both are guaranteed to the have the same ...
mlir::LogicalResult emitStmt(const clang::Stmt *s, bool useCurrentScope, llvm::ArrayRef< const Attr * > attrs={})
Address createMemTemp(QualType t, mlir::Location loc, const Twine &name="tmp", Address *alloca=nullptr, mlir::OpBuilder::InsertPoint ip={})
Create a temporary memory object of the given type, with appropriate alignmen and cast it to the defa...
void emitDelegatingCXXConstructorCall(const CXXConstructorDecl *ctor, const FunctionArgList &args)
void emitAggExpr(const clang::Expr *e, AggValueSlot slot)
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
clang::ASTContext & getASTContext() const
CharUnits getDynamicOffsetAlignment(CharUnits actualBaseAlign, const CXXRecordDecl *baseDecl, CharUnits expectedTargetAlign)
TODO: Add TBAAAccessInfo.
CharUnits getVBaseAlignment(CharUnits derivedAlign, const CXXRecordDecl *derived, const CXXRecordDecl *vbase)
Returns the assumed alignment of a virtual base of a class.
void add(RValue rvalue, clang::QualType type)
Type for representing both the decl and type of parameters to a function.
This trivial value class is used to represent the result of an expression that is evaluated.
static RValue get(mlir::Value v)
Contains the address where the return value of a function can be stored, and whether the address is v...
Represents a call to a C++ constructor.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Represents a C++ constructor within a class.
init_iterator init_begin()
Retrieve an iterator to the first initializer.
bool isDelegatingConstructor() const
Determine whether this constructor is a delegating constructor.
bool isCopyOrMoveConstructor(unsigned &TypeQuals) const
Determine whether this is a copy or move constructor.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
Represents a C++ base or member initializer.
Expr * getInit() const
Get the initializer.
SourceRange getSourceRange() const LLVM_READONLY
Determine the source range covering the entire initializer.
bool isAnyMemberInitializer() const
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
bool isIndirectMemberInitializer() const
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
FieldDecl * getAnyMember() const
IndirectFieldDecl * getIndirectMember() const
bool isBaseVirtual() const
Returns whether the base is virtual or not.
Represents a C++ destructor within a class.
Represents a static or instance method of a struct/union/class.
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined.
QualType getThisType() const
Return the type of the this pointer.
Represents a C++ struct/union/class.
bool isGenericLambda() const
Determine whether this class describes a generic lambda function object (i.e.
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
bool isAbstract() const
Determine whether this class has a pure virtual function.
bool isDynamicClass() const
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
CharUnits - This is an opaque type for sizes expressed in character units.
CharUnits alignmentAtOffset(CharUnits offset) const
Given that this is a non-zero alignment value, what is the alignment at the given offset?
bool isZero() const
isZero - Test whether the quantity equals zero.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
CharUnits alignmentOfArrayElement(CharUnits elementSize) const
Given that this is the alignment of the first element of an array, return the minimum alignment of an...
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
Represents the canonical version of C arrays with a specified constant size.
SourceLocation getBeginLoc() const LLVM_READONLY
This represents one expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Represents a member of a struct/union/class.
Represents a function declaration or definition.
bool isFunctionTemplateSpecialization() const
Determine whether this function is a function template specialization.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
ArrayRef< ParmVarDecl * > parameters() const
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
bool isVariadic() const
Whether this function is variadic.
const TemplateArgumentList * getTemplateSpecializationArgs() const
Retrieve the template arguments used to produce this function template specialization from the primar...
bool isDefaulted() const
Whether this function is defaulted.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Represents a prototype with parameter type info, e.g.
bool isVariadic() const
Whether this function prototype is variadic.
Declaration of a template function.
FunctionDecl * findSpecialization(ArrayRef< TemplateArgument > Args, void *&InsertPos)
Return the specialization with the provided arguments if it exists, otherwise return the insertion po...
QualType getReturnType() const
GlobalDecl - represents a global declaration.
CXXCtorType getCtorType() const
const Decl * getDecl() const
Represents a field injected from an anonymous union/struct into the parent scope.
ArrayRef< NamedDecl * > chain() const
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
A (possibly-)qualified type.
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after.
The collection of all-type qualifiers we support.
Encodes a location in the source.
Stmt - This represents one statement.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
A template argument list.
ArrayRef< TemplateArgument > asArray() const
Produce this as an array ref.
SourceLocation getBeginLoc() const LLVM_READONLY
The base class of the type hierarchy.
CXXRecordDecl * castAsCXXRecordDecl() const
const T * castAs() const
Member-template castAs<specific type>.
bool isRecordType() const
Represents a variable declaration or definition.
@ Type
The l-value was considered opaque, so the alignment was determined from a type.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const AstTypeMatcher< ArrayType > arrayType
The JSON file list parser is used to communicate input to InstallAPI.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
CXXCtorType
C++ constructor types.
@ Ctor_Base
Base object ctor.
@ Ctor_Complete
Complete object ctor.
bool isa(CodeGen::Address addr)
CXXDtorType
C++ destructor types.
@ Dtor_Complete
Complete object dtor.
U cast(CodeGen::Address addr)
static bool addressSpace()
static bool aggValueSlotGC()
static bool isMemcpyEquivalentSpecialMember()
static bool hiddenVisibility()
static bool runCleanupsScope()
static bool opCallArgEvaluationOrder()
static bool createInvariantGroup()
static bool isTrivialCtorOrDtor()
static bool assignMemcpyizer()
static bool ctorMemcpyizer()
static bool requiresCleanups()
static bool generateDebugInfo()
static bool incrementProfileCounter()
Similar to AddedStructorArgs, but only notes the number of additional arguments.
const clang::CXXRecordDecl * vtableClass
clang::CharUnits offsetFromNearestVBase
const clang::CXXRecordDecl * nearestVBase
clang::BaseSubobject base
cir::PointerType UInt8PtrTy