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");
131 const CXXRecordDecl *baseClass;
133 CallBaseDtor(
const CXXRecordDecl *base,
bool baseIsVirtual)
134 : baseClass(base), baseIsVirtual(baseIsVirtual) {}
136 void emit(CIRGenFunction &cgf)
override {
137 const CXXRecordDecl *derivedClass =
140 const CXXDestructorDecl *d = baseClass->getDestructor();
144 assert(cgf.
currSrcLoc &&
"expected source location");
149 false, addr, thisTy);
155struct DynamicThisUseChecker
156 : ConstEvaluatedExprVisitor<DynamicThisUseChecker> {
157 using super = ConstEvaluatedExprVisitor<DynamicThisUseChecker>;
159 bool usesThis =
false;
161 DynamicThisUseChecker(
const ASTContext &
c) : super(
c) {}
168 void VisitCXXThisExpr(
const CXXThisExpr *e) { usesThis =
true; }
173 DynamicThisUseChecker checker(
c);
175 return checker.usesThis;
197 return builder.createBaseClassAddr(loc, thisAddr,
convertType(base),
205 assert(
curFuncDecl &&
"loading 'this' without a func declaration?");
226 loc, thisPtr, classDecl, baseClassDecl, isBaseVirtual);
256 bool constructVBases = ctorType !=
Ctor_Base &&
259 if (constructVBases &&
260 !
cgm.getTarget().getCXXABI().hasConstructorVariants()) {
262 "emitCtorPrologue: virtual base without variants");
267 auto allInits = cd->
inits();
270 auto virtualBaseEnd = std::find_if(
272 return !(Init->isBaseInitializer() && Init->isBaseVirtual());
275 auto nonVirtualBaseEnd = std::find_if(virtualBaseEnd, allInits.end(),
277 return !Init->isBaseInitializer();
281 auto virtualBaseInits = llvm::make_range(allInits.begin(), virtualBaseEnd);
282 auto nonVirtualBaseInits =
283 llvm::make_range(virtualBaseEnd, nonVirtualBaseEnd);
284 auto memberInits = llvm::make_range(nonVirtualBaseEnd, allInits.end());
289 if (
cgm.getCodeGenOpts().StrictVTablePointers &&
290 cgm.getCodeGenOpts().OptimizationLevel > 0 &&
295 "emitCtorPrologue: strict vtable pointers for vbase");
302 if (!constructVBases)
304 emitInitializer(virtualBaseInit);
311 assert(!nonVirtualBaseInit->isBaseVirtual());
312 emitInitializer(nonVirtualBaseInit);
327 assert(!member->isBaseInitializer());
328 assert(member->isAnyMemberInitializer() &&
329 "Delegating initializer on non-delegating constructor");
336 CharUnits nonVirtualOffset, mlir::Value virtualOffset,
338 mlir::Type baseValueTy = {},
bool assumeNotNull =
true) {
340 assert(!nonVirtualOffset.
isZero() || virtualOffset !=
nullptr);
343 mlir::Value baseOffset;
344 if (!nonVirtualOffset.
isZero()) {
348 "applyNonVirtualAndVirtualOffset: virtual and non-virtual offset");
351 assert(baseValueTy &&
"expected base type");
354 loc, addr, baseValueTy, nonVirtualOffset.
getQuantity(),
358 baseOffset = virtualOffset;
367 mlir::Value adjusted = cir::PtrStrideOp::create(
368 cgf.
getBuilder(), loc, charPtrType, charPtr, baseOffset);
375 assert(nearestVBase &&
"virtual offset without vbase?");
383 return Address(ptr, alignment);
389 mlir::Value vtableAddressPoint =
390 cgm.getCXXABI().getVTableAddressPointInStructor(
393 if (!vtableAddressPoint)
397 mlir::Value virtualOffset{};
400 mlir::Type baseValueTy;
401 if (
cgm.getCXXABI().isVirtualOffsetNeededForVTableField(*
this, vptr)) {
404 virtualOffset =
cgm.getCXXABI().getVirtualBaseClassOffset(
416 if (!nonVirtualOffset.
isZero() || virtualOffset) {
418 loc, *
this, classAddr, nonVirtualOffset, virtualOffset,
427 auto vtablePtr = cir::VTableGetVPtrOp::create(
428 builder, loc, builder.getPtrToVPtrType(), classAddr.
getPointer());
430 builder.createStore(loc, vtableAddressPoint, vtableField);
442 if (
cgm.getCXXABI().doStructorsInitializeVPtrs(rd))
447 cgm.getCXXABI().initializeHiddenVirtualInheritanceMembers(*
this, rd);
457 false, vtableClass, vbases,
465 bool baseIsNonVirtualPrimaryBase,
471 if (!baseIsNonVirtualPrimaryBase) {
473 VPtr vptr = {base, nearestVBase, offsetFromNearestVBase, vtableClass};
474 vptrs.push_back(vptr);
479 for (
const auto &nextBase : rd->
bases()) {
480 const auto *baseDecl =
482 nextBase.getType()->castAs<RecordType>()->getOriginalDecl())
483 ->getDefinitionOrSelf();
486 if (!baseDecl->isDynamicClass())
491 bool baseDeclIsNonVirtualPrimaryBase;
494 if (nextBase.isVirtual()) {
496 if (!vbases.insert(baseDecl).second)
502 nextBaseDecl = baseDecl;
505 baseDeclIsNonVirtualPrimaryBase =
false;
509 nextBaseDecl = nearestVBase;
511 baseOffsetFromNearestVBase =
513 baseDeclIsNonVirtualPrimaryBase = layout.
getPrimaryBase() == baseDecl;
517 baseOffsetFromNearestVBase,
518 baseDeclIsNonVirtualPrimaryBase, vtableClass, vbases,
524 assert(
curFuncDecl &&
"loading 'this' without a func declaration?");
579 return std::min(actualBaseAlign, expectedTargetAlign);
603 if (actualBaseAlign >= expectedBaseAlign)
604 return expectedTargetAlign;
609 return std::min(actualBaseAlign, expectedTargetAlign);
641 bool zeroInitialize) {
645 newPointerIsChecked, zeroInitialize);
666 auto arrayTy = mlir::cast<cir::ArrayType>(arrayBase.
getElementType());
667 mlir::Type elementType = arrayTy.getElementType();
670 while (
auto maybeArrayTy = mlir::dyn_cast<cir::ArrayType>(elementType))
671 elementType = maybeArrayTy.getElementType();
672 cir::PointerType ptrToElmType = builder.getPointerTo(elementType);
675 if (
auto constantCount = numElements.getDefiningOp<cir::ConstantOp>()) {
676 if (
auto constIntAttr = constantCount.getValueAttr<cir::IntAttr>()) {
678 if (constIntAttr.getUInt() == 0)
681 arrayTy = cir::ArrayType::get(elementType, constIntAttr.getUInt());
685 if (constantCount.use_empty())
686 constantCount.erase();
727 mlir::Value arrayOp =
728 builder.createPtrBitcast(arrayBase.
getPointer(), arrayTy);
729 builder.create<cir::ArrayCtor>(
730 *
currSrcLoc, arrayOp, [&](mlir::OpBuilder &
b, mlir::Location loc) {
731 mlir::BlockArgument arg =
732 b.getInsertionBlock()->addArgument(ptrToElmType, loc);
742 builder.create<cir::YieldOp>(loc);
752 FunctionArgList::const_iterator i = args.begin(), e = args.end();
753 assert(i != e &&
"no parameters to constructor");
762 if (
cgm.getCXXABI().needsVTTParameter(
curGD)) {
763 cgm.errorNYI(loc,
"emitDelegateCXXConstructorCall: VTT parameter");
768 for (; i != e; ++i) {
777 true, thisAddr, delegateArgs, loc);
782 assert(assignOp->isCopyAssignmentOperator() ||
783 assignOp->isMoveAssignmentOperator());
784 const Stmt *rootS = assignOp->getBody();
786 "Body of an implicit assignment operator should be compound stmt.");
798 for (
Stmt *
s : rootCS->body())
800 cgm.errorNYI(
s->getSourceRange(),
801 std::string(
"emitImplicitAssignmentOperatorBody: ") +
802 s->getStmtClassName());
809 cgm.getTypes().arrangeCXXMethodDeclaration(callOperator);
810 cir::FuncOp calleePtr =
cgm.getAddrOfFunction(
811 GlobalDecl(callOperator),
cgm.getTypes().getFunctionType(calleeFnInfo));
829 if (!resultType->isVoidType() && returnSlot.
isNull()) {
830 if (
getLangOpts().ObjCAutoRefCount && resultType->isObjCRetainableType())
832 "emitForwardingCallToLambda: ObjCAutoRefCount");
836 "emitForwardingCallToLambda: return slot is not null");
864 void *InsertPos =
nullptr;
867 assert(correspondingCallOpSpecialization);
887 const auto *record =
type->castAsCXXRecordDecl();
906struct CallDtorDelete final : EHScopeStack::Cleanup {
909 void emit(CIRGenFunction &cgf)
override {
911 const CXXRecordDecl *classDecl = dtor->
getParent();
913 loadThisForDtorDelete(cgf, dtor),
919 const FieldDecl *field;
924 : field(field), destroyer(destroyer) {}
926 void emit(CIRGenFunction &cgf)
override {
933 assert(lv.isSimple());
936 cgf.
emitDestroy(lv.getAddress(), field->getType(), destroyer);
950 "Should not emit dtor epilogue for non-exported trivial dtor!");
956 "operator delete missing - EnterDtorCleanups");
962 "deleting destructor with destroying operator delete");
983 auto *baseClassDecl = base.getType()->castAsCXXRecordDecl();
985 if (baseClassDecl->hasTrivialDestructor()) {
1005 if (base.isVirtual())
1008 CXXRecordDecl *baseClassDecl = base.getType()->getAsCXXRecordDecl();
1027 const RecordType *rt =
type->getAsUnionType();
1028 if (rt && rt->getOriginalDecl()->isAnonymousStructOrUnion())
1033 ehStack.pushCleanup<DestroyField>(cleanupKind, field,
1056 "emitDelegatingCXXConstructorCall: exception");
1063 bool forVirtualBase,
bool delegating,
1065 cgm.getCXXABI().emitDestructorCall(*
this, dd,
type, forVirtualBase,
1066 delegating, thisAddr, thisTy);
1071 if (!
cgm.getCXXABI().needsVTTParameter(gd))
1077 uint64_t subVTTIndex;
1082 }
else if (rd == base) {
1085 assert(!
cgm.getCXXABI().needsVTTParameter(
curGD) &&
1086 "doing no-op VTT offset in base dtor/ctor?");
1087 assert(!forVirtualBase &&
"Can't have same class as virtual base!");
1096 assert(subVTTIndex != 0 &&
"Sub-VTT index must be greater than zero!");
1100 if (
cgm.getCXXABI().needsVTTParameter(
curGD)) {
1103 return builder.createVTTAddrPoint(loc, vtt.getType(), vtt, subVTTIndex);
1106 cir::GlobalOp vtt =
cgm.getVTables().getAddrOfVTT(rd);
1107 return builder.createVTTAddrPoint(
1108 loc, builder.getPointerTo(
cgm.VoidPtrTy),
1109 mlir::FlatSymbolRefAttr::get(vtt.getSymNameAttr()), subVTTIndex);
1115 llvm::iterator_range<CastExpr::path_const_iterator> path,
1117 assert(!path.empty() &&
"Base path should not be empty!");
1122 if ((*path.begin())->isVirtual()) {
1123 vBase = (*start)->getType()->castAsCXXRecordDecl();
1130 CharUnits nonVirtualOffset =
cgm.computeNonVirtualBaseClassOffset(
1131 vBase ? vBase : derived, {start, path.end()});
1136 if (vBase && derived->
hasAttr<FinalAttr>()) {
1139 nonVirtualOffset += vBaseOffset;
1144 mlir::Type baseValueTy =
convertType((path.end()[-1])->getType());
1149 if (nonVirtualOffset.
isZero() && !vBase) {
1151 return builder.createBaseClassAddr(
getLoc(loc), value, baseValueTy, 0,
1158 mlir::Value virtualOffset =
nullptr;
1160 virtualOffset =
cgm.getCXXABI().getVirtualBaseClassOffset(
1161 getLoc(loc), *
this, value, derived, vBase);
1166 getLoc(loc), *
this, value, nonVirtualOffset, virtualOffset, derived,
1167 vBase, baseValueTy,
not nullCheckValue);
1178 if (!
cgm.getCodeGenOpts().WholeProgramVTables)
1181 if (
cgm.getCodeGenOpts().VirtualFunctionElimination)
1191 auto vtablePtr = cir::VTableGetVPtrOp::create(
1192 builder, loc, builder.getPtrToVPtrType(), thisAddr.
getPointer());
1195 auto vtable = builder.createLoad(loc, vtablePtrAddr);
1198 if (
cgm.getCodeGenOpts().OptimizationLevel > 0 &&
1199 cgm.getCodeGenOpts().StrictVTablePointers) {
1208 bool forVirtualBase,
1252 bool passPrototypeArgs =
true;
1257 "emitCXXConstructorCall: inherited constructor");
1263 cgm.getCXXABI().addImplicitConstructorArgs(*
this, d,
type, forVirtualBase,
1271 cir::CIRCallOpInterface
c;
static void emit(Program &P, llvm::SmallVectorImpl< std::byte > &Code, const T &Val, bool &Success)
Helper to write bytecode and bail out if 32-bit offsets become invalid.
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...
Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited.
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
mlir::Value cxxStructorImplicitParamValue
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...
void emitDeleteCall(const FunctionDecl *deleteFD, mlir::Value ptr, QualType deleteTy)
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)
CleanupKind getCleanupKind(QualType::DestructionKind kind)
AggValueSlot::Overlap_t getOverlapForFieldInit(const FieldDecl *fd)
EHScopeStack ehStack
Tracks function scope overall cleanup handling.
void enterDtorCleanups(const CXXDestructorDecl *dtor, CXXDtorType type)
Enter the cleanups necessary to complete the given phase of destruction for a destructor.
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)
LValue emitLValueForField(LValue base, const clang::FieldDecl *field)
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 emitDestroy(Address addr, QualType type, Destroyer *destroyer)
Immediately perform the destruction of the given object.
Destroyer * getDestroyer(clang::QualType::DestructionKind kind)
void Destroyer(CIRGenFunction &cgf, Address addr, QualType ty)
void emitComplexExprIntoLValue(const Expr *e, LValue dest, bool isInit)
LValue makeAddrLValue(Address addr, QualType ty, AlignmentSource source=AlignmentSource::Type)
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)
Information for lazily generating a cleanup.
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 base class of a C++ class.
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.
const FunctionDecl * getOperatorDelete() const
Expr * getOperatorDeleteThisArg() const
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.
QualType getFunctionObjectParameterType() const
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)
base_class_range vbases()
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.
const CXXBaseSpecifier *const * path_const_iterator
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.
bool isDestroyingOperatorDelete() const
Determine whether this is a destroying operator delete.
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.
field_range fields() const
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_Base
Base object dtor.
@ Dtor_Complete
Complete object dtor.
@ Dtor_Deleting
Deleting dtor.
U cast(CodeGen::Address addr)
static bool addressSpace()
static bool ehCleanupFlags()
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