23 #include "llvm/IR/Constants.h" 24 #include "llvm/IR/Function.h" 25 #include "llvm/IR/GlobalVariable.h" 26 #include "llvm/IR/Intrinsics.h" 27 #include "llvm/IR/IntrinsicInst.h" 28 using namespace clang;
29 using namespace CodeGen;
36 class AggExprEmitter :
public StmtVisitor<AggExprEmitter> {
57 void withReturnValueSlot(
const Expr *E,
62 : CGF(cgf), Builder(CGF.Builder), Dest(Dest),
63 IsResultUnused(IsResultUnused) { }
72 void EmitAggLoadOfLValue(
const Expr *E);
87 void EmitMoveFromReturnSlot(
const Expr *E,
RValue Src);
89 void EmitArrayInit(
Address DestPtr, llvm::ArrayType *AType,
93 if (CGF.
getLangOpts().getGC() && TypeRequiresGCollection(T))
98 bool TypeRequiresGCollection(
QualType T);
104 void Visit(
Expr *E) {
109 void VisitStmt(
Stmt *S) {
133 void VisitDeclRefExpr(
DeclRefExpr *E) { EmitAggLoadOfLValue(E); }
134 void VisitMemberExpr(
MemberExpr *ME) { EmitAggLoadOfLValue(ME); }
135 void VisitUnaryDeref(
UnaryOperator *E) { EmitAggLoadOfLValue(E); }
136 void VisitStringLiteral(
StringLiteral *E) { EmitAggLoadOfLValue(E); }
139 EmitAggLoadOfLValue(E);
142 EmitAggLoadOfLValue(E);
147 void VisitCallExpr(
const CallExpr *E);
148 void VisitStmtExpr(
const StmtExpr *E);
150 void VisitPointerToDataMemberBinaryOperator(
const BinaryOperator *BO);
157 EmitAggLoadOfLValue(E);
182 void VisitCXXTypeidExpr(
CXXTypeidExpr *E) { EmitAggLoadOfLValue(E); }
189 return EmitFinalDestCopy(E->
getType(), LV);
203 EmitFinalDestCopy(E->
getType(), Res);
215 void AggExprEmitter::EmitAggLoadOfLValue(
const Expr *E) {
224 EmitFinalDestCopy(E->
getType(), LV);
228 bool AggExprEmitter::TypeRequiresGCollection(
QualType T) {
231 if (!RecordTy)
return false;
235 if (isa<CXXRecordDecl>(Record) &&
236 (cast<CXXRecordDecl>(Record)->hasNonTrivialCopyConstructor() ||
237 !cast<CXXRecordDecl>(Record)->hasTrivialDestructor()))
244 void AggExprEmitter::withReturnValueSlot(
247 bool RequiresDestruction =
264 llvm::IntrinsicInst *LifetimeStartInst =
nullptr;
272 if (LifetimeSizePtr) {
274 cast<llvm::IntrinsicInst>(std::prev(Builder.GetInsertPoint()));
275 assert(LifetimeStartInst->getIntrinsicID() ==
276 llvm::Intrinsic::lifetime_start &&
277 "Last insertion wasn't a lifetime.start?");
288 if (RequiresDestruction)
295 EmitFinalDestCopy(E->
getType(), Src);
297 if (!RequiresDestruction && LifetimeStartInst) {
308 assert(src.
isAggregate() &&
"value must be aggregate value!");
310 EmitFinalDestCopy(type, srcLV, EVK_RValue);
314 void AggExprEmitter::EmitFinalDestCopy(
QualType type,
const LValue &src,
327 if (SrcValueKind == EVK_RValue) {
349 EmitCopy(type, Dest, srcAgg);
385 assert(Array.
isSimple() &&
"initializer_list array not a simple lvalue");
390 assert(ArrayType &&
"std::initializer_list constructed from non-array");
401 if (!Field->getType()->isPointerType() ||
402 !Ctx.
hasSameType(Field->getType()->getPointeeType(),
414 Builder.CreateInBoundsGEP(ArrayPtr.getPointer(), IdxStart,
"arraystart");
425 if (Field->getType()->isPointerType() &&
426 Ctx.
hasSameType(Field->getType()->getPointeeType(),
431 Builder.CreateInBoundsGEP(ArrayPtr.getPointer(), IdxEnd,
"arrayend");
448 if (isa<ImplicitValueInitExpr>(E))
451 if (
auto *ILE = dyn_cast<InitListExpr>(E)) {
452 if (ILE->getNumInits())
457 if (
auto *Cons = dyn_cast_or_null<CXXConstructExpr>(E))
458 return Cons->getConstructor()->isDefaultConstructor() &&
459 Cons->getConstructor()->isTrivial();
466 void AggExprEmitter::EmitArrayInit(
Address DestPtr, llvm::ArrayType *AType,
470 uint64_t NumArrayElements = AType->getNumElements();
471 assert(NumInitElements <= NumArrayElements);
481 Builder.CreateInBoundsGEP(DestPtr.
getPointer(), indices,
"arrayinit.begin");
490 if (NumInitElements * elementSize.
getQuantity() > 16 &&
496 auto GV =
new llvm::GlobalVariable(
499 llvm::GlobalValue::PrivateLinkage, C,
"constinit",
500 nullptr, llvm::GlobalVariable::NotThreadLocal,
505 EmitFinalDestCopy(ArrayQTy, CGF.
MakeAddrLValue(GV, ArrayQTy, Align));
516 llvm::Instruction *cleanupDominator =
nullptr;
523 "arrayinit.endOfInit");
524 cleanupDominator = Builder.
CreateStore(begin, endOfInit);
545 for (uint64_t i = 0; i != NumInitElements; ++i) {
548 element = Builder.CreateInBoundsGEP(element, one,
"arrayinit.element");
558 EmitInitializationToLValue(E->
getInit(i), elementLV);
568 if (NumInitElements != NumArrayElements &&
569 !(Dest.
isZeroed() && hasTrivialFiller &&
576 if (NumInitElements) {
577 element = Builder.CreateInBoundsGEP(element, one,
"arrayinit.start");
582 llvm::Value *end = Builder.CreateInBoundsGEP(begin,
583 llvm::ConstantInt::get(CGF.
SizeTy, NumArrayElements),
586 llvm::BasicBlock *entryBB = Builder.GetInsertBlock();
591 llvm::PHINode *currentElement =
592 Builder.CreatePHI(element->getType(), 2,
"arrayinit.cur");
593 currentElement->addIncoming(element, entryBB);
606 EmitInitializationToLValue(filler, elementLV);
608 EmitNullInitializationToLValue(elementLV);
613 Builder.CreateInBoundsGEP(currentElement, one,
"arrayinit.next");
619 llvm::Value *done = Builder.CreateICmpEQ(nextElement, end,
622 Builder.CreateCondBr(done, endBB, bodyBB);
623 currentElement->addIncoming(nextElement, Builder.GetInsertBlock());
654 EmitAggLoadOfLValue(E);
667 if (
CastExpr *castE = dyn_cast<CastExpr>(op)) {
668 if (castE->getCastKind() ==
kind)
669 return castE->getSubExpr();
670 if (castE->getCastKind() == CK_NoOp)
677 void AggExprEmitter::VisitCastExpr(
CastExpr *E) {
678 if (
const auto *ECE = dyn_cast<ExplicitCastExpr>(E))
683 assert(isa<CXXDynamicCastExpr>(E) &&
"CK_Dynamic without a dynamic_cast?");
714 case CK_DerivedToBase:
715 case CK_BaseToDerived:
716 case CK_UncheckedDerivedToBase: {
717 llvm_unreachable(
"cannot perform hierarchy conversion in EmitAggExpr: " 718 "should have been unpacked before we got here");
721 case CK_NonAtomicToAtomic:
722 case CK_AtomicToNonAtomic: {
723 bool isToAtomic = (E->
getCastKind() == CK_NonAtomicToAtomic);
728 if (isToAtomic) std::swap(atomicType, valueType);
741 (isToAtomic ? CK_AtomicToNonAtomic : CK_NonAtomicToAtomic);
747 "peephole significantly changed types?");
787 return EmitFinalDestCopy(valueType, rvalue);
790 case CK_LValueToRValue:
801 case CK_UserDefinedConversion:
802 case CK_ConstructorConversion:
805 "Implicit cast types must be compatible");
809 case CK_LValueBitCast:
810 llvm_unreachable(
"should not be emitting lvalue bitcast as rvalue");
814 case CK_ArrayToPointerDecay:
815 case CK_FunctionToPointerDecay:
816 case CK_NullToPointer:
817 case CK_NullToMemberPointer:
818 case CK_BaseToDerivedMemberPointer:
819 case CK_DerivedToBaseMemberPointer:
820 case CK_MemberPointerToBoolean:
821 case CK_ReinterpretMemberPointer:
822 case CK_IntegralToPointer:
823 case CK_PointerToIntegral:
824 case CK_PointerToBoolean:
827 case CK_IntegralCast:
828 case CK_BooleanToSignedIntegral:
829 case CK_IntegralToBoolean:
830 case CK_IntegralToFloating:
831 case CK_FloatingToIntegral:
832 case CK_FloatingToBoolean:
833 case CK_FloatingCast:
834 case CK_CPointerToObjCPointerCast:
835 case CK_BlockPointerToObjCPointerCast:
836 case CK_AnyPointerToBlockPointerCast:
837 case CK_ObjCObjectLValueCast:
838 case CK_FloatingRealToComplex:
839 case CK_FloatingComplexToReal:
840 case CK_FloatingComplexToBoolean:
841 case CK_FloatingComplexCast:
842 case CK_FloatingComplexToIntegralComplex:
843 case CK_IntegralRealToComplex:
844 case CK_IntegralComplexToReal:
845 case CK_IntegralComplexToBoolean:
846 case CK_IntegralComplexCast:
847 case CK_IntegralComplexToFloatingComplex:
848 case CK_ARCProduceObject:
849 case CK_ARCConsumeObject:
850 case CK_ARCReclaimReturnedObject:
851 case CK_ARCExtendBlockObject:
852 case CK_CopyAndAutoreleaseBlockObject:
853 case CK_BuiltinFnToFnPtr:
854 case CK_ZeroToOCLOpaqueType:
855 case CK_AddressSpaceConversion:
856 case CK_IntToOCLSampler:
857 case CK_FixedPointCast:
858 case CK_FixedPointToBoolean:
859 llvm_unreachable(
"cast kind invalid for aggregate types");
863 void AggExprEmitter::VisitCallExpr(
const CallExpr *E) {
865 EmitAggLoadOfLValue(E);
885 void AggExprEmitter::VisitStmtExpr(
const StmtExpr *E) {
899 const char *NameSuffix =
"") {
902 ArgTy = CT->getElementType();
906 "member pointers may only be compared for equality");
908 CGF, LHS, RHS, MPT,
false);
914 llvm::CmpInst::Predicate FCmp;
915 llvm::CmpInst::Predicate SCmp;
916 llvm::CmpInst::Predicate UCmp;
918 CmpInstInfo InstInfo = [&]() -> CmpInstInfo {
919 using FI = llvm::FCmpInst;
920 using II = llvm::ICmpInst;
923 return {
"cmp.lt", FI::FCMP_OLT, II::ICMP_SLT, II::ICMP_ULT};
925 return {
"cmp.gt", FI::FCMP_OGT, II::ICMP_SGT, II::ICMP_UGT};
927 return {
"cmp.eq", FI::FCMP_OEQ, II::ICMP_EQ, II::ICMP_EQ};
929 llvm_unreachable(
"Unrecognised CompareKind enum");
933 return Builder.CreateFCmp(InstInfo.FCmp, LHS, RHS,
934 llvm::Twine(InstInfo.Name) + NameSuffix);
938 return Builder.CreateICmp(Inst, LHS, RHS,
939 llvm::Twine(InstInfo.Name) + NameSuffix);
942 llvm_unreachable(
"unsupported aggregate binary expression should have " 943 "already been handled");
947 using llvm::BasicBlock;
955 "cannot copy non-trivially copyable aggregate");
960 if (ArgTy->isVectorType())
962 E,
"aggregate three-way comparison with vector arguments");
963 if (!ArgTy->isIntegralOrEnumerationType() && !ArgTy->isRealFloatingType() &&
964 !ArgTy->isNullPtrType() && !ArgTy->isPointerType() &&
965 !ArgTy->isMemberPointerType() && !ArgTy->isAnyComplexType()) {
968 bool IsComplex = ArgTy->isAnyComplexType();
971 auto EmitOperand = [&](
Expr *E) -> std::pair<Value *, Value *> {
980 auto LHSValues = EmitOperand(E->
getLHS()),
981 RHSValues = EmitOperand(E->
getRHS());
985 K, IsComplex ?
".r" :
"");
990 RHSValues.second, K,
".i");
991 return Builder.CreateAnd(Cmp, CmpImag,
"and.eq");
994 return Builder.getInt(VInfo->getIntValue());
998 if (ArgTy->isNullPtrType()) {
1001 Select = Builder.CreateSelect(
1006 Builder.CreateSelect(EmitCmp(
CK_Less), EmitCmpRes(CmpInfo.
getLess()),
1008 Select = Builder.CreateSelect(EmitCmp(
CK_Equal),
1010 SelectOne,
"sel.eq");
1012 Value *SelectEq = Builder.CreateSelect(
1017 SelectEq,
"sel.gt");
1018 Select = Builder.CreateSelect(
1019 EmitCmp(
CK_Less), EmitCmpRes(CmpInfo.
getLess()), SelectGT,
"sel.lt");
1034 void AggExprEmitter::VisitBinaryOperator(
const BinaryOperator *E) {
1036 VisitPointerToDataMemberBinaryOperator(E);
1041 void AggExprEmitter::VisitPointerToDataMemberBinaryOperator(
1044 EmitFinalDestCopy(E->
getType(), LV);
1054 if (
const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) {
1056 return (var && var->
hasAttr<BlocksAttr>());
1065 if (op->isAssignmentOp() || op->isPtrMemOp())
1069 if (op->getOpcode() == BO_Comma)
1077 = dyn_cast<AbstractConditionalOperator>(E)) {
1083 = dyn_cast<OpaqueValueExpr>(E)) {
1084 if (
const Expr *src = op->getSourceExpr())
1091 }
else if (
const CastExpr *
cast = dyn_cast<CastExpr>(E)) {
1092 if (
cast->getCastKind() == CK_LValueToRValue)
1098 }
else if (
const UnaryOperator *uop = dyn_cast<UnaryOperator>(E)) {
1102 }
else if (
const MemberExpr *mem = dyn_cast<MemberExpr>(E)) {
1118 &&
"Invalid assignment");
1134 if (LHS.getType()->isAtomicType() ||
1175 EmitFinalDestCopy(E->
getType(), LHS);
1178 void AggExprEmitter::
1200 assert(CGF.
HaveInsertPoint() &&
"expression evaluation ended with no IP!");
1201 CGF.
Builder.CreateBr(ContBlock);
1217 void AggExprEmitter::VisitChooseExpr(
const ChooseExpr *CE) {
1221 void AggExprEmitter::VisitVAArgExpr(
VAArgExpr *VE) {
1246 if (!wasExternallyDestructed)
1256 void AggExprEmitter::VisitCXXInheritedCtorInitExpr(
1265 AggExprEmitter::VisitLambdaExpr(
LambdaExpr *E) {
1296 return IL->getValue() == 0;
1299 return FL->getValue().isPosZero();
1301 if ((isa<ImplicitValueInitExpr>(E) || isa<CXXScalarValueInitExpr>(E)) &&
1305 if (
const CastExpr *ICE = dyn_cast<CastExpr>(E))
1306 return ICE->getCastKind() == CK_NullToPointer &&
1310 return CL->getValue() == 0;
1318 AggExprEmitter::EmitInitializationToLValue(
Expr *E,
LValue LV) {
1325 }
else if (isa<ImplicitValueInitExpr>(E) || isa<CXXScalarValueInitExpr>(E)) {
1326 return EmitNullInitializationToLValue(LV);
1327 }
else if (isa<NoInitExpr>(E)) {
1355 llvm_unreachable(
"bad evaluation kind");
1358 void AggExprEmitter::EmitNullInitializationToLValue(
LValue lv) {
1385 void AggExprEmitter::VisitInitListExpr(
InitListExpr *E) {
1392 if (llvm::Constant* C = CGF.
CGM.EmitConstantExpr(E, E->
getType(), &CGF)) {
1393 llvm::GlobalVariable* GV =
1394 new llvm::GlobalVariable(CGF.
CGM.
getModule(), C->getType(),
true,
1429 llvm::Instruction *cleanupDominator =
nullptr;
1431 unsigned curInitIndex = 0;
1434 if (
auto *CXXRD = dyn_cast<CXXRecordDecl>(record)) {
1435 assert(E->
getNumInits() >= CXXRD->getNumBases() &&
1436 "missing initializer for base class");
1437 for (
auto &
Base : CXXRD->bases()) {
1438 assert(!
Base.isVirtual() &&
"should not see vbases here");
1439 auto *BaseRD =
Base.getType()->getAsCXXRecordDecl();
1452 Base.getType().isDestructedType()) {
1471 for (
const auto *Field : record->
fields())
1472 assert(Field->isUnnamedBitfield() &&
"Only unnamed bitfields allowed");
1481 if (NumInitElements) {
1483 EmitInitializationToLValue(E->
getInit(0), FieldLoc);
1486 EmitNullInitializationToLValue(FieldLoc);
1494 for (
const auto *field : record->
fields()) {
1496 if (field->getType()->isIncompleteArrayType())
1500 if (field->isUnnamedBitfield())
1506 if (curInitIndex == NumInitElements && Dest.
isZeroed() &&
1515 if (curInitIndex < NumInitElements) {
1517 EmitInitializationToLValue(E->
getInit(curInitIndex++), LV);
1520 EmitNullInitializationToLValue(LV);
1526 bool pushedCleanup =
false;
1528 = field->getType().isDestructedType()) {
1531 if (!cleanupDominator)
1534 llvm::Constant::getNullValue(CGF.
Int8PtrTy),
1540 pushedCleanup =
true;
1546 if (!pushedCleanup && LV.
isSimple())
1547 if (llvm::GetElementPtrInst *GEP =
1548 dyn_cast<llvm::GetElementPtrInst>(LV.
getPointer()))
1549 if (GEP->use_empty())
1550 GEP->eraseFromParent();
1555 for (
unsigned i = cleanups.size(); i != 0; --i)
1559 if (cleanupDominator)
1560 cleanupDominator->eraseFromParent();
1569 uint64_t numElements = E->
getArraySize().getZExtValue();
1577 llvm::Value *begin = Builder.CreateInBoundsGEP(destPtr.getPointer(), indices,
1592 llvm::BasicBlock *entryBB = Builder.GetInsertBlock();
1597 llvm::PHINode *index =
1598 Builder.CreatePHI(zero->getType(), 2,
"arrayinit.index");
1599 index->addIncoming(zero, entryBB);
1600 llvm::Value *element = Builder.CreateInBoundsGEP(begin, index);
1606 if (outerBegin->getType() != element->getType())
1607 outerBegin = Builder.
CreateBitCast(outerBegin, element->getType());
1632 AggExprEmitter(CGF, elementSlot,
false)
1633 .VisitArrayInitLoopExpr(InnerLoop, outerBegin);
1635 EmitInitializationToLValue(E->
getSubExpr(), elementLV);
1640 index, llvm::ConstantInt::get(CGF.
SizeTy, 1),
"arrayinit.next");
1641 index->addIncoming(nextIndex, Builder.GetInsertBlock());
1645 nextIndex, llvm::ConstantInt::get(CGF.
SizeTy, numElements),
1648 Builder.CreateCondBr(done, endBB, bodyBB);
1661 EmitInitializationToLValue(E->
getBase(), DestLV);
1682 ILE = dyn_cast<InitListExpr>(ILE->
getInit(0));
1690 if (!RT->isUnionType()) {
1694 unsigned ILEElement = 0;
1695 if (
auto *CXXRD = dyn_cast<CXXRecordDecl>(SD))
1696 while (ILEElement != CXXRD->getNumBases())
1699 for (
const auto *Field : SD->
fields()) {
1702 if (Field->getType()->isIncompleteArrayType() ||
1705 if (Field->isUnnamedBitfield())
1711 if (Field->getType()->isReferenceType())
1718 return NumNonZeroBytes;
1724 for (
unsigned i = 0, e = ILE->
getNumInits(); i != e; ++i)
1726 return NumNonZeroBytes;
1743 const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1756 if (NumNonZeroBytes*4 > Size)
1778 assert(E && hasAggregateEvaluationKind(E->
getType()) &&
1779 "Invalid aggregate expression to emit");
1781 "slot has bits but no address");
1786 AggExprEmitter(*
this, Slot, Slot.
isIgnored()).Visit(const_cast<Expr*>(E));
1790 assert(hasAggregateEvaluationKind(E->
getType()) &&
"Invalid argument!");
1815 getContext().getASTRecordLayout(BaseRD).getSize() <=
1839 "Trying to aggregate-copy a type without a trivial copy/move " 1840 "constructor or assignment operator");
1861 std::pair<CharUnits, CharUnits>
TypeInfo;
1863 TypeInfo = getContext().getTypeInfoDataSizeInChars(Ty);
1865 TypeInfo = getContext().getTypeInfoInChars(Ty);
1868 if (TypeInfo.first.isZero()) {
1870 if (
auto *VAT = dyn_cast_or_null<VariableArrayType>(
1871 getContext().getAsArrayType(Ty))) {
1873 SizeVal = emitArrayLength(VAT, BaseEltTy, DestPtr);
1874 TypeInfo = getContext().getTypeInfoInChars(BaseEltTy);
1875 assert(!TypeInfo.first.isZero());
1876 SizeVal = Builder.CreateNUWMul(
1878 llvm::ConstantInt::get(SizeTy, TypeInfo.first.getQuantity()));
1882 SizeVal = llvm::ConstantInt::get(SizeTy, TypeInfo.first.getQuantity());
1907 CGM.getObjCRuntime().EmitGCMemmoveCollectable(*
this, DestPtr, SrcPtr,
1912 QualType BaseType = getContext().getBaseElementType(Ty);
1915 CGM.getObjCRuntime().EmitGCMemmoveCollectable(*
this, DestPtr, SrcPtr,
1922 auto Inst = Builder.
CreateMemCpy(DestPtr, SrcPtr, SizeVal, isVolatile);
1927 if (llvm::MDNode *TBAAStructTag = CGM.getTBAAStructInfo(Ty))
1928 Inst->setMetadata(llvm::LLVMContext::MD_tbaa_struct, TBAAStructTag);
1930 if (CGM.getCodeGenOpts().NewStructPathTBAA) {
1933 CGM.DecorateInstructionWithTBAA(Inst, TBAAInfo);
const llvm::DataLayout & getDataLayout() const
const Expr * getSubExpr() const
ReturnValueSlot - Contains the address where the return value of a function can be stored...
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
Defines the clang::ASTContext interface.
Expr * getChosenSubExpr() const
getChosenSubExpr - Return the subexpression chosen according to the condition.
Address getAddress() const
void end(CodeGenFunction &CGF)
Destroyer * getDestroyer(QualType::DestructionKind destructionKind)
A (possibly-)qualified type.
bool isPODType(const ASTContext &Context) const
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
llvm::Type * ConvertTypeForMem(QualType T)
void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount)
EmitBranchOnBoolExpr - Emit a branch on a boolean condition (e.g.
RValue EmitCoyieldExpr(const CoyieldExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
Address CreateMemTemp(QualType T, const Twine &Name="tmp", Address *Alloca=nullptr)
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignmen and cas...
void enterFullExpression(const FullExpr *E)
bool HaveInsertPoint() const
HaveInsertPoint - True if an insertion point is defined.
CompoundStmt * getSubStmt()
const Expr * getInit(unsigned Init) const
Stmt - This represents one statement.
Address GetAddressOfDirectBaseInCompleteClass(Address Value, const CXXRecordDecl *Derived, const CXXRecordDecl *Base, bool BaseIsVirtual)
GetAddressOfBaseOfCompleteClass - Convert the given pointer to a complete class to the given direct b...
llvm::Constant * tryEmitForInitializer(const VarDecl &D)
Try to emit the initiaizer of the given declaration as an abstract constant.
CharUnits getBaseClassOffset(const CXXRecordDecl *Base) const
getBaseClassOffset - Get the offset, in chars, for the given base class.
NeedsGCBarriers_t requiresGCollection() const
llvm::Value * getPointer() const
bool isRecordType() const
Address EmitVAArg(VAArgExpr *VE, Address &VAListAddr)
Generate code to get an argument from the passed in pointer and update it accordingly.
virtual void EmitGCMemmoveCollectable(CodeGen::CodeGenFunction &CGF, Address DestPtr, Address SrcPtr, llvm::Value *Size)=0
RValue EmitPseudoObjectRValue(const PseudoObjectExpr *e, AggValueSlot slot=AggValueSlot::ignored())
RValue EmitCoawaitExpr(const CoawaitExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
bool isTransparent() const
Is this a transparent initializer list (that is, an InitListExpr that is purely syntactic, and whose semantics are that of the sole contained initializer)?
Defines the C++ template declaration subclasses.
ParenExpr - This represents a parethesized expression, e.g.
Expr * getFalseExpr() const
void EmitStoreThroughLValue(RValue Src, LValue Dst, bool isInit=false)
EmitStoreThroughLValue - Store the specified rvalue into the specified lvalue, where both are guarant...
void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit)
EmitComplexExprIntoLValue - Emit the given expression of complex type and place its result into the s...
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Represents a call to a C++ constructor.
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12) ...
stable_iterator stable_begin() const
Create a stable reference to the top of the EH stack.
void setZeroed(bool V=true)
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
LValue EmitLValueForFieldInitialization(LValue Base, const FieldDecl *Field)
EmitLValueForFieldInitialization - Like EmitLValueForField, except that if the Field is a reference...
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
IsAliased_t isPotentiallyAliased() const
const Expr * getResultExpr() const
The generic selection's result expression.
void EmitAtomicStore(RValue rvalue, LValue lvalue, bool isInit)
QualType getElementType() const
static bool isBlockVarRef(const Expr *E)
Is the value of the given expression possibly a reference to or into a __block variable?
static Expr * findPeephole(Expr *op, CastKind kind)
Attempt to look through various unimportant expressions to find a cast of the given kind...
Represents a variable declaration or definition.
CompoundLiteralExpr - [C99 6.5.2.5].
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
const T * getAs() const
Member-template getAs<specific type>'.
uint64_t getProfileCount(const Stmt *S)
Get the profiler's count for the given statement.
static bool isSimpleZero(const Expr *E, CodeGenFunction &CGF)
isSimpleZero - If emitting this value will obviously just cause a store of zero to memory...
LangAS
Defines the address space values used by the address space qualifier of QualType. ...
IsZeroed_t isZeroed() const
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
llvm::Value * getPointer() const
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, llvm::Value **Result=nullptr)
EmitStoreThroughBitfieldLValue - Store Src into Dst with same constraints as EmitStoreThroughLValue.
The collection of all-type qualifiers we support.
bool hasFloatingRepresentation() const
Determine whether this type has a floating-point representation of some sort, e.g., it is a floating-point type or a vector thereof.
static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF)
GetNumNonZeroBytesInInit - Get an approximate count of the number of non-zero bytes that will be stor...
Represents a struct/union/class.
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
uint64_t getPointerWidth(unsigned AddrSpace) const
Return the width of pointers on this target, for the specified address space.
const TargetInfo & getTarget() const
An object to manage conditionally-evaluated expressions.
AggValueSlot::Overlap_t overlapForBaseInit(const CXXRecordDecl *RD, const CXXRecordDecl *BaseRD, bool IsVirtual)
Determine whether a base class initialization may overlap some other object.
IsDestructed_t isExternallyDestructed() const
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
Address getAddress() const
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
llvm::Value * EmitDynamicCast(Address V, const CXXDynamicCastExpr *DCE)
RValue EmitReferenceBindingToExpr(const Expr *E)
Emits a reference binding to the passed in expression.
field_range fields() const
Represents a member of a struct/union/class.
llvm::IntegerType * SizeTy
Represents a place-holder for an object not to be initialized by anything.
An RAII object to set (and then clear) a mapping for an OpaqueValueExpr.
bool isReferenceType() const
bool hasTrivialMoveAssignment() const
Determine whether this class has a trivial move assignment operator (C++11 [class.copy]p25)
Denotes a cleanup that should run when a scope is exited using exceptional control flow (a throw stat...
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
static AggValueSlot forAddr(Address addr, Qualifiers quals, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed, IsSanitizerChecked_t isChecked=IsNotSanitizerChecked)
forAddr - Make a slot for an aggregate value.
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
CharUnits getPreferredSize(ASTContext &Ctx, QualType Type) const
Get the preferred size to use when storing a value to this slot.
bool isPaddedAtomicType(QualType type)
static bool isTrivialFiller(Expr *E)
Determine if E is a trivial array filler, that is, one that is equivalent to zero-initialization.
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
bool hadArrayRangeDesignator() const
void EmitStoreOfScalar(llvm::Value *Value, Address Addr, bool Volatile, QualType Ty, AlignmentSource Source=AlignmentSource::Type, bool isInit=false, bool isNontemporal=false)
EmitStoreOfScalar - Store a scalar value to an address, taking care to appropriately convert from the...
void setNonGC(bool Value)
RValue EmitAnyExpr(const Expr *E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
EmitAnyExpr - Emit code to compute the specified expression which can have any type.
void pushFullExprCleanup(CleanupKind kind, As... A)
pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression.
void EmitInheritedCXXConstructorCall(const CXXConstructorDecl *D, bool ForVirtualBase, Address This, bool InheritedFromVBase, const CXXInheritedCtorInitExpr *E)
Emit a call to a constructor inherited from a base class, passing the current constructor's arguments...
Describes an C or C++ initializer list.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
void pushRegularPartialArrayCleanup(llvm::Value *arrayBegin, llvm::Value *arrayEnd, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)
pushRegularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the gi...
static bool hasScalarEvaluationKind(QualType T)
Address CreateElementBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Cast the element type of the given address to a different type, preserving information like the align...
CharUnits - This is an opaque type for sizes expressed in character units.
bool isPartial() const
True iff the comparison is not totally ordered.
bool isTriviallyCopyableType(const ASTContext &Context) const
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
CharUnits getAlignment() const
Return the alignment of this pointer.
A builtin binary operation expression such as "x + y" or "x <= y".
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
bool needsEHCleanup(QualType::DestructionKind kind)
Determines whether an EH cleanup is required to destroy a type with the given destruction kind...
bool constructsVBase() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
llvm::CallInst * CreateMemCpy(Address Dest, Address Src, llvm::Value *Size, bool IsVolatile=false)
Scope - A scope is a transient data structure that is used while parsing the program.
field_iterator field_begin() const
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
void EmitIgnoredExpr(const Expr *E)
EmitIgnoredExpr - Emit an expression in a context which ignores the result.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents binding an expression to a temporary.
RValue EmitAtomicExpr(AtomicExpr *E)
CXXTemporary * getTemporary()
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
CharUnits getPointerAlign() const
bool isEquality() const
True iff the comparison category is an equality comparison.
void incrementProfileCounter(const Stmt *S, llvm::Value *StepV=nullptr)
Increment the profiler's counter for the given statement by StepV.
llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr)
CreateTempAlloca - This creates an alloca and inserts it into the entry block if ArraySize is nullptr...
const ComparisonCategoryInfo & getInfoForType(QualType Ty) const
Return the comparison category information as specified by getCategoryForType(Ty).
void callCStructMoveConstructor(LValue Dst, LValue Src)
Address getAggregateAddress() const
getAggregateAddr() - Return the Value* of the address of the aggregate.
A default argument (C++ [dcl.fct.default]).
void begin(CodeGenFunction &CGF)
Checking the operand of a load. Must be suitably sized and aligned.
bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor)
isTypeConstant - Determine whether an object of this type can be emitted as a constant.
const Expr * getExpr() const
Get the initialization expression that will be used.
RValue EmitObjCMessageExpr(const ObjCMessageExpr *E, ReturnValueSlot Return=ReturnValueSlot())
bool isTriviallyCopyable() const
Determine whether this class is considered trivially copyable per (C++11 [class]p6).
void EmitCXXConstructExpr(const CXXConstructExpr *E, AggValueSlot Dest)
static CharUnits One()
One - Construct a CharUnits quantity of one.
ASTContext & getContext() const
CastKind
CastKind - The kind of operation required for a conversion.
RValue - This trivial value class is used to represent the result of an expression that is evaluated...
InitListExpr * getUpdater() const
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
ConstantExpr - An expression that occurs in a constant context.
Represents a call to the builtin function __builtin_va_arg.
bool isPointerZeroInitializable(QualType T)
Check if the pointer type can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer...
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
bool HasSideEffects(const ASTContext &Ctx, bool IncludePossibleEffects=true) const
HasSideEffects - This routine returns true for all those expressions which have any effect other than...
static TypeEvaluationKind getEvaluationKind(QualType T)
getEvaluationKind - Return the TypeEvaluationKind of QualType T.
CGObjCRuntime & getObjCRuntime()
Return a reference to the configured Objective-C runtime.
PrimitiveCopyKind isNonTrivialToPrimitiveDestructiveMove() const
Check if this is a non-trivial type that would cause a C struct transitively containing this type to ...
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
void callCStructMoveAssignmentOperator(LValue Dst, LValue Src)
This represents one expression.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Qualifiers getQualifiers() const
Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited...
std::pair< llvm::Value *, llvm::Value * > getComplexVal() const
getComplexVal - Return the real/imag components of this complex value.
const T * castAs() const
Member-template castAs<specific type>.
Address EmitCompoundStmt(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
EmitCompoundStmt - Emit a compound statement {..} node.
unsigned getNumInits() const
Expr * getSubExpr() const
Get the initializer to use for each array element.
AggValueSlot CreateAggTemp(QualType T, const Twine &Name="tmp")
CreateAggTemp - Create a temporary memory object for the given aggregate type.
field_iterator field_end() const
llvm::PointerType * getType() const
Return the type of the pointer value.
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
bool isAnyComplexType() const
const ValueInfo * getNonequalOrNonequiv() const
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
void EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Dest)
An RAII object to record that we're evaluating a statement expression.
TBAAAccessInfo getTBAAInfo() const
CharUnits alignmentOfArrayElement(CharUnits elementSize) const
Given that this is the alignment of the first element of an array, return the minimum alignment of an...
An expression that sends a message to the given Objective-C object or class.
llvm::CallInst * CreateMemSet(Address Dest, llvm::Value *Value, llvm::Value *Size, bool IsVolatile=false)
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
const AstTypeMatcher< AtomicType > atomicType
Matches atomic types.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
The scope of a CXXDefaultInitExpr.
bool hasTrivialCopyConstructor() const
Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class...
Expr * getTrueExpr() const
const Expr * getSubExpr() const
const Expr * getSubExpr() const
ASTContext & getContext() const
RValue EmitAtomicLoad(LValue LV, SourceLocation SL, AggValueSlot Slot=AggValueSlot::ignored())
void callCStructCopyAssignmentOperator(LValue Dst, LValue Src)
RecordDecl * getDecl() const
The scope of an ArrayInitLoopExpr.
const ValueInfo * getGreater() const
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
Address CreateBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Represents a call to an inherited base class constructor from an inheriting constructor.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
bool inheritedFromVBase() const
Determine whether the inherited constructor is inherited from a virtual base of the object we constru...
void pushDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)
pushDestroy - Push the standard destructor for the given type as at least a normal cleanup...
bool hasTrivialCopyAssignment() const
Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool LValueIsSuitableForInlineAtomic(LValue Src)
An LValue is a candidate for having its loads and stores be made atomic if we are operating under /vo...
LangAS getAddressSpace() const
Return the address space of this type.
A saved depth on the scope stack.
Expr * getSubExpr() const
LValue EmitCheckedLValue(const Expr *E, TypeCheckKind TCK)
Same as EmitLValue but additionally we generate checking code to guard against undefined behavior...
CastKind getCastKind() const
const ValueInfo * getLess() const
LValue EmitAggExprToLValue(const Expr *E)
EmitAggExprToLValue - Emit the computation of the specified expression of aggregate type into a tempo...
void DeactivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
DeactivateCleanupBlock - Deactivates the given cleanup block.
The type is a struct containing a field whose type is neither PCK_Trivial nor PCK_VolatileTrivial.
llvm::Value * EmitLifetimeStart(uint64_t Size, llvm::Value *Addr)
Emit a lifetime.begin marker if some criteria are satisfied.
A scoped helper to set the current debug location to the specified location or preferred location of ...
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
const ConstantArrayType * getAsConstantArrayType(QualType T) const
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
void EmitCXXTemporary(const CXXTemporary *Temporary, QualType TempType, Address Ptr)
Emits all the code to cause the given temporary to be cleaned up.
static void CheckAggExprForMemSetUse(AggValueSlot &Slot, const Expr *E, CodeGenFunction &CGF)
CheckAggExprForMemSetUse - If the initializer is large and has a lot of zeros in it, emit a memset and avoid storing the individual zeros.
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after...
LValue EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E)
PrimitiveCopyKind isNonTrivialToPrimitiveCopy() const
Check if this is a non-trivial type that would cause a C struct transitively containing this type to ...
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
RValue EmitCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue=ReturnValueSlot())
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
const Expr * getInitializer() const
void setExternallyDestructed(bool destructed=true)
Represents a C11 generic selection.
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type, returning the result.
virtual llvm::Value * EmitMemberPointerComparison(CodeGenFunction &CGF, llvm::Value *L, llvm::Value *R, const MemberPointerType *MPT, bool Inequality)
Emit a comparison between two member pointers. Returns an i1.
llvm::Value * getScalarVal() const
getScalarVal() - Return the Value* of this scalar value.
QualType withVolatile() const
void ErrorUnsupported(const Stmt *S, const char *Type)
Print out an error that codegen doesn't support the specified stmt yet.
This class organizes the cross-function state that is used while generating LLVM code.
void setVolatile(bool flag)
Dataflow Directional Tag Classes.
[C99 6.4.2.2] - A predefined identifier such as func.
static AggValueSlot ignored()
ignored - Returns an aggregate value slot indicating that the aggregate value is being ignored...
Address CreateStructGEP(Address Addr, unsigned Index, CharUnits Offset, const llvm::Twine &Name="")
A scope within which we are constructing the fields of an object which might use a CXXDefaultInitExpr...
LValue getOrCreateOpaqueLValueMapping(const OpaqueValueExpr *e)
Given an opaque value expression, return its LValue mapping if it exists, otherwise create one...
llvm::LoadInst * CreateAlignedLoad(llvm::Value *Addr, CharUnits Align, const llvm::Twine &Name="")
LValue EmitPseudoObjectLValue(const PseudoObjectExpr *e)
bool hasUserDeclaredConstructor() const
Determine whether this class has any user-declared constructors.
Represents a 'co_yield' expression.
const Expr * getExpr() const
U cast(CodeGen::Address addr)
llvm::Constant * EmitNullConstant(QualType T)
Return the result of value-initializing the given type, i.e.
Checking the destination of a store. Must be suitably sized and aligned.
CXXRecordDecl * Record
The declaration for the comparison category type from the standard library.
A pointer to member type per C++ 8.3.3 - Pointers to members.
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
static AggValueSlot forLValue(const LValue &LV, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed, IsSanitizerChecked_t isChecked=IsNotSanitizerChecked)
llvm::Module & getModule() const
QualType getCallReturnType(const ASTContext &Ctx) const
getCallReturnType - Get the return type of the call expr.
LValue MakeAddrLValue(Address Addr, QualType T, AlignmentSource Source=AlignmentSource::Type)
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
void EmitAggExpr(const Expr *E, AggValueSlot AS)
EmitAggExpr - Emit the computation of the specified expression of aggregate type. ...
void EmitExplicitCastExprType(const ExplicitCastExpr *E, CodeGenFunction *CGF=nullptr)
Emit type info if type of an expression is a variably modified type.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Complex values, per C99 6.2.5p11.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
CodeGenTypes & getTypes() const
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
llvm::Type * getElementType() const
Return the type of the values stored in this address.
const llvm::APInt & getSize() const
bool isAtomicType() const
Represents a 'co_await' expression.
llvm::PointerType * Int8PtrTy
llvm::Value * getAggregatePointer() const
Expr * getReplacement() const
void EmitScalarInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
A use of a default initializer in a constructor or in aggregate initialization.
llvm::IntegerType * PtrDiffTy
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
Overlap_t mayOverlap() const
void callCStructCopyConstructor(LValue Dst, LValue Src)
static llvm::Value * EmitCompare(CGBuilderTy &Builder, CodeGenFunction &CGF, const BinaryOperator *E, llvm::Value *LHS, llvm::Value *RHS, CompareKind Kind, const char *NameSuffix="")
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
void ErrorUnsupported(const Stmt *S, const char *Type)
ErrorUnsupported - Print out an error that codegen doesn't support the specified stmt yet...
bool hasSignedIntegerRepresentation() const
Determine whether this type has an signed integer representation of some sort, e.g., it is an signed integer type or a vector.
Represents a C++ struct/union/class.
Represents a loop initializing the elements of an array.
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
llvm::Type * ConvertType(QualType T)
LValue EmitLValue(const Expr *E)
EmitLValue - Emit code to compute a designator that specifies the location of the expression...
const ValueInfo * getEqualOrEquiv() const
CharUnits getNonVirtualSize() const
getNonVirtualSize - Get the non-virtual size (in chars) of an object, which is the size of the object...
unsigned kind
All of the diagnostics that can be emitted by the frontend.
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
void finalize(llvm::GlobalVariable *global)
RetTy Visit(PTR(Stmt) S, ParamTys... P)
CGCXXABI & getCXXABI() const
bool hasVolatileMember(QualType T)
hasVolatileMember - returns true if aggregate type has a volatile member.
void EmitAggregateCopy(LValue Dest, LValue Src, QualType EltTy, AggValueSlot::Overlap_t MayOverlap, bool isVolatile=false)
EmitAggregateCopy - Emit an aggregate copy.
A reference to a declared variable, function, enum, etc.
static RValue get(llvm::Value *V)
bool isPointerType() const
bool hasObjectMember() const
void EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr)
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
static RValue getAggregate(Address addr, bool isVolatile=false)
LValue - This represents an lvalue references.
const LangOptions & getLangOpts() const
unsigned getTargetAddressSpace(QualType T) const
const ValueInfo * getUnordered() const
llvm::APInt getArraySize() const
llvm::Value * getPointer() const
Represents the canonical version of C arrays with a specified constant size.
bool isZeroInitializable(QualType T)
IsZeroInitializable - Return whether a type can be zero-initialized (in the C++ sense) with an LLVM z...
Represents an implicitly-generated value initialization of an object of a given type.
void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint=true)
void pushIrregularPartialArrayCleanup(llvm::Value *arrayBegin, Address arrayEndPointer, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)
pushIrregularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the ...
void EmitNullInitialization(Address DestPtr, QualType Ty)
EmitNullInitialization - Generate code to set a value of the given type to null, If the type contains...
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
ComparisonCategories CompCategories
Types and expressions required to build C++2a three-way comparisons using operator<=>, including the values return by builtin <=> operators.