36 if (
const DeclRefExpr *dre = dyn_cast<DeclRefExpr>(e)) {
37 const VarDecl *
var = dyn_cast<VarDecl>(dre->getDecl());
38 return (var &&
var->hasAttr<BlocksAttr>());
47 if (op->isAssignmentOp() || op->isPtrMemOp())
51 if (op->getOpcode() == BO_Comma)
59 dyn_cast<AbstractConditionalOperator>(e)) {
65 if (
const Expr *src = op->getSourceExpr())
72 }
else if (
const CastExpr *
cast = dyn_cast<CastExpr>(e)) {
73 if (
cast->getCastKind() == CK_LValueToRValue)
79 }
else if (
const UnaryOperator *uop = dyn_cast<UnaryOperator>(e)) {
83 }
else if (
const MemberExpr *mem = dyn_cast<MemberExpr>(e)) {
94class AggExprEmitter :
public StmtVisitor<AggExprEmitter> {
105 void withReturnValueSlot(
const Expr *e,
106 llvm::function_ref<RValue(ReturnValueSlot)> fn);
108 AggValueSlot ensureSlot(mlir::Location loc, QualType t) {
109 if (!dest.isIgnored())
111 return cgf.createAggTemp(t, loc,
"agg.tmp.ensured");
114 void ensureDest(mlir::Location loc, QualType ty) {
115 if (!dest.isIgnored())
117 dest = cgf.createAggTemp(ty, loc,
"agg.tmp.ensured");
121 AggExprEmitter(CIRGenFunction &cgf, AggValueSlot dest)
122 : cgf(cgf), dest(dest) {}
127 void emitAggLoadOfLValue(
const Expr *e);
129 void emitArrayInit(Address destPtr, cir::ArrayType arrayTy, QualType arrayQTy,
130 Expr *exprToVisit, ArrayRef<Expr *> args,
134 void emitFinalDestCopy(QualType
type,
const LValue &src);
136 void emitCopy(QualType
type,
const AggValueSlot &dest,
137 const AggValueSlot &src);
139 void emitInitializationToLValue(Expr *e, LValue lv);
141 void emitNullInitializationToLValue(mlir::Location loc, LValue lv);
143 void Visit(Expr *e) { StmtVisitor<AggExprEmitter>::Visit(e); }
145 void VisitArraySubscriptExpr(ArraySubscriptExpr *e) {
146 emitAggLoadOfLValue(e);
149 void VisitCallExpr(
const CallExpr *e);
150 void VisitStmtExpr(
const StmtExpr *e) {
151 CIRGenFunction::StmtExprEvaluation eval(cgf);
154 (void)cgf.emitCompoundStmt(*e->
getSubStmt(), &retAlloca, dest);
157 void VisitBinAssign(
const BinaryOperator *e) {
160 assert(cgf.getContext().hasSameUnqualifiedType(e->
getLHS()->
getType(),
162 "Invalid assignment");
167 "block var reference with side effects");
171 LValue lhs = cgf.emitLValue(e->
getLHS());
187 cgf.emitAggExpr(e->
getRHS(), lhsSlot);
190 emitFinalDestCopy(e->
getType(), lhs);
192 if (!dest.isIgnored() && !dest.isExternallyDestructed() &&
198 void VisitDeclRefExpr(DeclRefExpr *e) { emitAggLoadOfLValue(e); }
200 void VisitInitListExpr(InitListExpr *e);
201 void VisitCXXConstructExpr(
const CXXConstructExpr *e);
203 void visitCXXParenListOrInitListExpr(Expr *e, ArrayRef<Expr *> args,
204 FieldDecl *initializedFieldInUnion,
206 void VisitCXXDefaultInitExpr(CXXDefaultInitExpr *die) {
207 CIRGenFunction::CXXDefaultInitExprScope Scope(cgf, die);
210 void VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *e) {
213 bool wasExternallyDestructed = dest.isExternallyDestructed();
217 dest.setExternallyDestructed();
222 if (!wasExternallyDestructed)
226 void VisitExprWithCleanups(ExprWithCleanups *e);
231 case CK_LValueToRValue:
236 "AggExprEmitter: volatile lvalue-to-rvalue cast");
239 case CK_UserDefinedConversion:
240 case CK_ConstructorConversion:
243 "Implicit cast types must be compatible");
248 std::string(
"AggExprEmitter: VisitCastExpr: ") +
253 void VisitStmt(Stmt *
s) {
254 cgf.cgm.errorNYI(
s->getSourceRange(),
255 std::string(
"AggExprEmitter::VisitStmt: ") +
256 s->getStmtClassName());
258 void VisitParenExpr(ParenExpr *pe) { Visit(pe->
getSubExpr()); }
259 void VisitGenericSelectionExpr(GenericSelectionExpr *ge) {
262 void VisitCoawaitExpr(CoawaitExpr *e) {
263 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitCoawaitExpr");
265 void VisitCoyieldExpr(CoyieldExpr *e) {
266 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitCoyieldExpr");
268 void VisitUnaryCoawait(UnaryOperator *e) {
269 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitUnaryCoawait");
271 void VisitUnaryExtension(UnaryOperator *e) { Visit(e->
getSubExpr()); }
272 void VisitSubstNonTypeTemplateParmExpr(SubstNonTypeTemplateParmExpr *e) {
274 "AggExprEmitter: VisitSubstNonTypeTemplateParmExpr");
276 void VisitConstantExpr(ConstantExpr *e) {
277 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitConstantExpr");
279 void VisitMemberExpr(MemberExpr *e) { emitAggLoadOfLValue(e); }
280 void VisitUnaryDeref(UnaryOperator *e) { emitAggLoadOfLValue(e); }
281 void VisitStringLiteral(StringLiteral *e) { emitAggLoadOfLValue(e); }
282 void VisitCompoundLiteralExpr(CompoundLiteralExpr *e);
284 void VisitPredefinedExpr(
const PredefinedExpr *e) {
286 "AggExprEmitter: VisitPredefinedExpr");
288 void VisitBinaryOperator(
const BinaryOperator *e) {
290 "AggExprEmitter: VisitBinaryOperator");
292 void VisitPointerToDataMemberBinaryOperator(
const BinaryOperator *e) {
294 "AggExprEmitter: VisitPointerToDataMemberBinaryOperator");
296 void VisitBinComma(
const BinaryOperator *e) {
297 cgf.emitIgnoredExpr(e->
getLHS());
300 void VisitBinCmp(
const BinaryOperator *e) {
301 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitBinCmp");
303 void VisitCXXRewrittenBinaryOperator(CXXRewrittenBinaryOperator *e) {
305 "AggExprEmitter: VisitCXXRewrittenBinaryOperator");
307 void VisitObjCMessageExpr(ObjCMessageExpr *e) {
309 "AggExprEmitter: VisitObjCMessageExpr");
311 void VisitObjCIVarRefExpr(ObjCIvarRefExpr *e) {
313 "AggExprEmitter: VisitObjCIVarRefExpr");
316 void VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *e) {
318 LValue destLV = cgf.makeAddrLValue(dest.getAddress(), e->
getType());
319 emitInitializationToLValue(e->
getBase(), destLV);
322 void VisitAbstractConditionalOperator(
const AbstractConditionalOperator *e) {
324 "AggExprEmitter: VisitAbstractConditionalOperator");
327 void VisitCXXParenListInitExpr(CXXParenListInitExpr *e) {
333 void VisitArrayInitLoopExpr(
const ArrayInitLoopExpr *e,
334 llvm::Value *outerBegin =
nullptr) {
336 "AggExprEmitter: VisitArrayInitLoopExpr");
338 void VisitImplicitValueInitExpr(ImplicitValueInitExpr *e) {
340 "AggExprEmitter: VisitImplicitValueInitExpr");
342 void VisitNoInitExpr(NoInitExpr *e) {
343 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitNoInitExpr");
345 void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *dae) {
346 CIRGenFunction::CXXDefaultArgExprScope scope(cgf, dae);
349 void VisitCXXInheritedCtorInitExpr(
const CXXInheritedCtorInitExpr *e) {
351 "AggExprEmitter: VisitCXXInheritedCtorInitExpr");
353 void VisitCXXStdInitializerListExpr(CXXStdInitializerListExpr *e) {
355 "AggExprEmitter: VisitCXXStdInitializerListExpr");
357 void VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *e) {
359 "AggExprEmitter: VisitCXXScalarValueInitExpr");
361 void VisitCXXTypeidExpr(CXXTypeidExpr *e) {
362 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitCXXTypeidExpr");
364 void VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *e) {
367 void VisitOpaqueValueExpr(OpaqueValueExpr *e) {
369 "AggExprEmitter: VisitOpaqueValueExpr");
372 void VisitPseudoObjectExpr(PseudoObjectExpr *e) {
374 "AggExprEmitter: VisitPseudoObjectExpr");
377 void VisitVAArgExpr(VAArgExpr *e) {
380 mlir::Value vaArgValue = cgf.emitVAArg(e);
384 Address tmpAddr = cgf.createMemTemp(e->
getType(), loc,
"vaarg.tmp");
387 cgf.emitAggregateStore(vaArgValue, tmpAddr);
390 LValue tmpLValue = cgf.makeAddrLValue(tmpAddr, e->
getType());
393 emitFinalDestCopy(e->
getType(), tmpLValue);
396 void VisitCXXThrowExpr(
const CXXThrowExpr *e) {
397 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitCXXThrowExpr");
399 void VisitAtomicExpr(AtomicExpr *e) {
400 cgf.cgm.errorNYI(e->
getSourceRange(),
"AggExprEmitter: VisitAtomicExpr");
413 if (
auto *ile = dyn_cast<InitListExpr>(e)) {
414 if (ile->getNumInits())
419 if (
const auto *cons = dyn_cast_or_null<CXXConstructExpr>(e))
420 return cons->getConstructor()->isDefaultConstructor() &&
421 cons->getConstructor()->isTrivial();
428void AggExprEmitter::emitAggLoadOfLValue(
const Expr *e) {
434 emitFinalDestCopy(e->
getType(), lv);
437void AggExprEmitter::VisitCompoundLiteralExpr(CompoundLiteralExpr *e) {
441 emitAggLoadOfLValue(e);
462void AggExprEmitter::emitArrayInit(Address destPtr, cir::ArrayType arrayTy,
463 QualType arrayQTy, Expr *e,
464 ArrayRef<Expr *> args, Expr *arrayFiller) {
468 const uint64_t numInitElements = args.size();
470 const QualType elementType =
474 cgf.
cgm.
errorNYI(loc,
"initialized array requires destruction");
480 const mlir::Type cirElementType = cgf.
convertType(elementType);
481 const cir::PointerType cirElementPtrType =
484 auto begin = cir::CastOp::create(builder, loc, cirElementPtrType,
485 cir::CastKind::array_to_ptrdecay,
488 const CharUnits elementSize =
490 const CharUnits elementAlign =
498 mlir::Value element = begin;
505 for (uint64_t i = 0; i != numInitElements; ++i) {
512 const Address address = Address(element, cirElementType, elementAlign);
513 const LValue elementLV = cgf.
makeAddrLValue(address, elementType);
514 emitInitializationToLValue(args[i], elementLV);
517 const uint64_t numArrayElements = arrayTy.getSize();
525 if (numInitElements != numArrayElements &&
526 !(dest.
isZeroed() && hasTrivialFiller &&
529 if (numInitElements) {
531 element = cir::PtrStrideOp::create(builder, loc, cirElementPtrType,
543 cir::ConstantOp numArrayElementsConst = builder.
getConstInt(
544 loc, mlir::cast<cir::IntType>(cgf.
ptrDiffTy), numArrayElements);
545 mlir::Value end = cir::PtrStrideOp::create(builder, loc, cirElementPtrType,
546 begin, numArrayElementsConst);
551 [&](mlir::OpBuilder &
b, mlir::Location loc) {
552 cir::LoadOp currentElement = builder.
createLoad(loc, tmpAddr);
553 cir::CmpOp cmp = cir::CmpOp::create(builder, loc, cir::CmpOpKind::ne,
554 currentElement, end);
558 [&](mlir::OpBuilder &
b, mlir::Location loc) {
559 cir::LoadOp currentElement = builder.
createLoad(loc, tmpAddr);
565 Address(currentElement, cirElementType, elementAlign),
568 emitInitializationToLValue(arrayFiller, elementLV);
570 emitNullInitializationToLValue(loc, elementLV);
574 cgf.
cgm.
errorNYI(loc,
"update destructed array element for EH");
580 loc, mlir::cast<cir::IntType>(cgf.
ptrDiffTy), 1);
581 auto nextElement = cir::PtrStrideOp::create(
582 builder, loc, cirElementPtrType, currentElement, one);
591void AggExprEmitter::emitFinalDestCopy(QualType
type,
const LValue &src) {
606 emitCopy(
type, dest, srcAgg);
613void AggExprEmitter::emitCopy(QualType
type,
const AggValueSlot &dest,
614 const AggValueSlot &src) {
627void AggExprEmitter::emitInitializationToLValue(Expr *e, LValue lv) {
628 const QualType
type = lv.getType();
634 return emitNullInitializationToLValue(loc, lv);
640 if (
type->isReferenceType()) {
665void AggExprEmitter::VisitCXXConstructExpr(
const CXXConstructExpr *e) {
670void AggExprEmitter::emitNullInitializationToLValue(mlir::Location loc,
672 const QualType
type = lv.getType();
697void AggExprEmitter::VisitLambdaExpr(
LambdaExpr *e) {
700 [[maybe_unused]] LValue slotLV =
707 for (
auto [curField, capture, captureInit] : llvm::zip(
710 llvm::StringRef fieldName = curField->getName();
711 if (capture.capturesVariable()) {
712 assert(!curField->isBitField() &&
"lambdas don't have bitfield members!");
713 ValueDecl *v = capture.getCapturedVar();
716 }
else if (capture.capturesThis()) {
726 if (curField->hasCapturedVLAType())
729 emitInitializationToLValue(captureInit, lv);
733 curField->getType().isDestructedType())
738void AggExprEmitter::VisitExprWithCleanups(ExprWithCleanups *e) {
739 CIRGenFunction::RunCleanupsScope cleanups(cgf);
743void AggExprEmitter::VisitCallExpr(
const CallExpr *e) {
750 e, [&](ReturnValueSlot slot) {
return cgf.
emitCallExpr(e, slot); });
753void AggExprEmitter::withReturnValueSlot(
754 const Expr *e, llvm::function_ref<RValue(ReturnValueSlot)> fn) {
758 bool requiresDestruction =
760 if (requiresDestruction)
763 "withReturnValueSlot: return value requiring destruction is NYI");
778 fn(ReturnValueSlot(retAddr));
781void AggExprEmitter::VisitInitListExpr(InitListExpr *e) {
783 llvm_unreachable(
"GNU array range designator extension");
788 visitCXXParenListOrInitListExpr(
792void AggExprEmitter::visitCXXParenListOrInitListExpr(
793 Expr *e, ArrayRef<Expr *> args, FieldDecl *initializedFieldInUnion,
797 const AggValueSlot dest = ensureSlot(loc, e->
getType());
800 cir::ArrayType arrayTy =
807 "visitCXXParenListOrInitListExpr variable array type");
813 "visitCXXParenListOrInitListExpr array type");
823 unsigned numInitElements = args.size();
830 unsigned curInitIndex = 0;
833 if (
auto *cxxrd = dyn_cast<CXXRecordDecl>(record)) {
834 assert(numInitElements >= cxxrd->getNumBases() &&
835 "missing initializer for base class");
836 for (
auto &base : cxxrd->bases()) {
837 assert(!base.isVirtual() &&
"should not see vbases here");
838 CXXRecordDecl *baseRD = base.getType()->getAsCXXRecordDecl();
848 if (base.getType().isDestructedType()) {
850 "push deferred deactivation cleanup");
857 CIRGenFunction::FieldConstructionScope fcScope(cgf, dest.
getAddress());
861 if (record->isUnion()) {
863 "visitCXXParenListOrInitListExpr union type");
869 for (
const FieldDecl *field : record->fields()) {
871 if (field->getType()->isIncompleteArrayType())
875 if (field->isUnnamedBitField())
881 if (curInitIndex == numInitElements && dest.
isZeroed() &&
889 if (curInitIndex < numInitElements) {
891 CIRGenFunction::SourceLocRAIIObject loc{
892 cgf, cgf.
getLoc(record->getSourceRange())};
893 emitInitializationToLValue(args[curInitIndex++], lv);
902 if (field->getType().isDestructedType()) {
904 "visitCXXParenListOrInitListExpr destructor");
928 getContext().getASTRecordLayout(baseRD).getSize() <=
937 AggExprEmitter(*
this, slot).Visit(
const_cast<Expr *
>(e));
952 assert((record->hasTrivialCopyConstructor() ||
953 record->hasTrivialCopyAssignment() ||
954 record->hasTrivialMoveConstructor() ||
955 record->hasTrivialMoveAssignment() ||
956 record->hasAttr<TrivialABIAttr>() || record->isUnion()) &&
957 "Trying to aggregate-copy a type without a trivial copy/move "
958 "constructor or assignment operator");
960 if (record->isEmpty())
983 typeInfo =
getContext().getTypeInfoDataSizeInChars(ty);
985 typeInfo =
getContext().getTypeInfoInChars(ty);
995 cgm.errorNYI(
"emitAggregateCopy: GC");
997 [[maybe_unused]] cir::CopyOp copyOp =
static bool isBlockVarRef(const Expr *E)
Is the value of the given expression possibly a reference to or into a __block variable?
static bool isTrivialFiller(Expr *e)
__device__ __2f16 float __ockl_bool s
cir::ConditionOp createCondition(mlir::Value condition)
Create a loop condition.
cir::PtrStrideOp createPtrStride(mlir::Location loc, mlir::Value base, mlir::Value stride)
cir::PointerType getPointerTo(mlir::Type ty)
cir::DoWhileOp createDoWhile(mlir::Location loc, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> condBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> bodyBuilder)
Create a do-while operation.
cir::ConstantOp getConstantInt(mlir::Location loc, mlir::Type ty, int64_t value)
cir::YieldOp createYield(mlir::Location loc, mlir::ValueRange value={})
Create a yield operation.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
uint64_t getFieldOffset(unsigned FieldNo) const
getFieldOffset - Get the offset of the given field index, in bits.
CharUnits getBaseClassOffset(const CXXRecordDecl *Base) const
getBaseClassOffset - Get the offset, in chars, for the given base class.
CharUnits getNonVirtualSize() const
getNonVirtualSize - Get the non-virtual size (in chars) of an object, which is the size of the object...
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
QualType getElementType() const
A builtin binary operation expression such as "x + y" or "x <= y".
mlir::Value getPointer() const
mlir::Type getElementType() const
clang::CharUnits getAlignment() const
IsZeroed_t isZeroed() const
Overlap_t mayOverlap() const
static AggValueSlot forAddr(Address addr, clang::Qualifiers quals, IsDestructed_t isDestructed, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed)
IsDestructed_t isExternallyDestructed() const
static AggValueSlot forLValue(const LValue &LV, IsDestructed_t isDestructed, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed)
Address getAddress() const
void setExternallyDestructed(bool destructed=true)
IsAliased_t isPotentiallyAliased() const
void setVolatile(bool flag)
cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal)
cir::LoadOp createLoad(mlir::Location loc, Address addr, bool isVolatile=false)
static bool hasScalarEvaluationKind(clang::QualType type)
mlir::Type convertType(clang::QualType t)
static cir::TypeEvaluationKind getEvaluationKind(clang::QualType type)
Return the cir::TypeEvaluationKind of QualType type.
CIRGenTypes & getTypes() const
const clang::LangOptions & getLangOpts() const
cir::AllocaOp createTempAlloca(mlir::Type ty, mlir::Location loc, const Twine &name="tmp", mlir::Value arraySize=nullptr, bool insertIntoFnEntryBlock=false)
This creates an alloca and inserts it into the entry block if ArraySize is nullptr,...
RValue emitCallExpr(const clang::CallExpr *e, ReturnValueSlot returnValue=ReturnValueSlot())
LValue emitLValue(const clang::Expr *e)
Emit code to compute a designator that specifies the location of the expression.
void emitAggregateCopy(LValue dest, LValue src, QualType eltTy, AggValueSlot::Overlap_t mayOverlap, bool isVolatile=false)
Emit an aggregate copy.
mlir::Location getLoc(clang::SourceLocation srcLoc)
Helpers to convert Clang's SourceLocation to a MLIR Location.
void emitNullInitialization(mlir::Location loc, Address destPtr, QualType ty)
RValue emitReferenceBindingToExpr(const Expr *e)
Emits a reference binding to the passed in expression.
AggValueSlot::Overlap_t getOverlapForFieldInit(const FieldDecl *fd)
void emitCXXConstructExpr(const clang::CXXConstructExpr *e, AggValueSlot dest)
LValue emitAggExprToLValue(const Expr *e)
void emitStoreOfScalar(mlir::Value value, Address addr, bool isVolatile, clang::QualType ty, LValueBaseInfo baseInfo, bool isInit=false, bool isNontemporal=false)
static bool hasAggregateEvaluationKind(clang::QualType type)
void emitScalarInit(const clang::Expr *init, mlir::Location loc, LValue lvalue, bool capturedByInit=false)
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, bool ignoreResultAssign=false)
Emit the computation of the specified expression of scalar type.
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)
LValue makeAddrLValue(Address addr, QualType ty, AlignmentSource source=AlignmentSource::Type)
mlir::Value emitStoreThroughBitfieldLValue(RValue src, LValue dstresult)
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 ...
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 emitAggExpr(const clang::Expr *e, AggValueSlot slot)
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
const clang::LangOptions & getLangOpts() const
mlir::Value emitNullConstant(QualType t, mlir::Location loc)
Return the result of value-initializing the given type, i.e.
llvm::DenseMap< const clang::FieldDecl *, llvm::StringRef > lambdaFieldToName
Keep a map between lambda fields and names, this needs to be per module since lambdas might get gener...
bool isZeroInitializable(clang::QualType ty)
Return whether a type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Address getAddress() const
static RValue get(mlir::Value v)
CXXTemporary * getTemporary()
const Expr * getSubExpr() const
Expr * getExpr()
Get the initialization expression that will be used.
MutableArrayRef< Expr * > getInitExprs()
FieldDecl * getInitializedFieldInUnion()
Represents a C++ struct/union/class.
SourceRange getSourceRange() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range of the expression.
SourceRange getSourceRange() const LLVM_READONLY
QualType getCallReturnType(const ASTContext &Ctx) const
getCallReturnType - Get the return type of the call expr.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
CastKind getCastKind() const
static const char * getCastKindName(CastKind CK)
CharUnits alignmentOfArrayElement(CharUnits elementSize) const
Given that this is the alignment of the first element of an array, return the minimum alignment of an...
Expr * getChosenSubExpr() const
getChosenSubExpr - Return the subexpression chosen according to the condition.
const Expr * getInitializer() const
A reference to a declared variable, function, enum, etc.
InitListExpr * getUpdater() const
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
bool HasSideEffects(const ASTContext &Ctx, bool IncludePossibleEffects=true) const
HasSideEffects - This routine returns true for all those expressions which have any effect other than...
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.
unsigned getFieldIndex() const
Returns the index of this field within its record, as appropriate for passing to ASTRecordLayout::get...
const RecordDecl * getParent() const
Returns the parent of this field declaration, which is the struct in which this field is defined.
const Expr * getSubExpr() const
Expr * getResultExpr()
Return the result expression of this controlling expression.
bool isTransparent() const
Is this a transparent initializer list (that is, an InitListExpr that is purely syntactic,...
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
bool hadArrayRangeDesignator() const
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
const Expr * getInit(unsigned Init) const
ArrayRef< Expr * > inits()
llvm::iterator_range< capture_init_iterator > capture_inits()
Retrieve the initialization expressions for this lambda's captures.
capture_range captures() const
Retrieve this lambda's captures.
CXXRecordDecl * getLambdaClass() const
Retrieve the class that corresponds to the lambda.
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
const Expr * getSubExpr() const
A (possibly-)qualified type.
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after.
bool isPODType(const ASTContext &Context) const
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
Represents a struct/union/class.
field_range fields() const
CompoundStmt * getSubStmt()
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
bool isConstantArrayType() const
bool isReferenceType() const
bool isVariableArrayType() const
RecordDecl * castAsRecordDecl() const
bool isAnyComplexType() const
bool isRecordType() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Expr * getSubExpr() const
Represents a variable declaration or definition.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
constexpr Variable var(Literal L)
Returns the variable of L.
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
U cast(CodeGen::Address addr)
static bool emitLifetimeMarkers()
static bool aggValueSlotDestructedFlag()
static bool aggValueSlotGC()
static bool aggValueSlotAlias()
static bool opLoadStoreAtomic()
static bool aggEmitFinalDestCopyRValue()
static bool aggValueSlotVolatile()
static bool opScopeCleanupRegion()
static bool atomicTypes()
static bool cudaSupport()
static bool requiresCleanups()
clang::CharUnits getPointerAlign() const