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) {
129 void VisitDeclRefExpr(
DeclRefExpr *E) { EmitAggLoadOfLValue(E); }
130 void VisitMemberExpr(
MemberExpr *ME) { EmitAggLoadOfLValue(ME); }
131 void VisitUnaryDeref(
UnaryOperator *E) { EmitAggLoadOfLValue(E); }
132 void VisitStringLiteral(
StringLiteral *E) { EmitAggLoadOfLValue(E); }
135 EmitAggLoadOfLValue(E);
138 EmitAggLoadOfLValue(E);
143 void VisitCallExpr(
const CallExpr *E);
144 void VisitStmtExpr(
const StmtExpr *E);
146 void VisitPointerToDataMemberBinaryOperator(
const BinaryOperator *BO);
153 EmitAggLoadOfLValue(E);
178 void VisitCXXTypeidExpr(
CXXTypeidExpr *E) { EmitAggLoadOfLValue(E); }
185 return EmitFinalDestCopy(E->
getType(), LV);
199 EmitFinalDestCopy(E->
getType(), Res);
211 void AggExprEmitter::EmitAggLoadOfLValue(
const Expr *E) {
220 EmitFinalDestCopy(E->
getType(), LV);
224 bool AggExprEmitter::TypeRequiresGCollection(
QualType T) {
227 if (!RecordTy)
return false;
231 if (isa<CXXRecordDecl>(Record) &&
232 (cast<CXXRecordDecl>(Record)->hasNonTrivialCopyConstructor() ||
233 !cast<CXXRecordDecl>(Record)->hasTrivialDestructor()))
240 void AggExprEmitter::withReturnValueSlot(
243 bool RequiresDestruction =
260 llvm::IntrinsicInst *LifetimeStartInst =
nullptr;
268 if (LifetimeSizePtr) {
270 cast<llvm::IntrinsicInst>(std::prev(Builder.GetInsertPoint()));
271 assert(LifetimeStartInst->getIntrinsicID() ==
272 llvm::Intrinsic::lifetime_start &&
273 "Last insertion wasn't a lifetime.start?");
284 if (RequiresDestruction)
291 EmitFinalDestCopy(E->
getType(), Src);
293 if (!RequiresDestruction && LifetimeStartInst) {
304 assert(src.
isAggregate() &&
"value must be aggregate value!");
306 EmitFinalDestCopy(type, srcLV, EVK_RValue);
310 void AggExprEmitter::EmitFinalDestCopy(
QualType type,
const LValue &src,
323 if (SrcValueKind == EVK_RValue) {
345 EmitCopy(type, Dest, srcAgg);
381 assert(Array.
isSimple() &&
"initializer_list array not a simple lvalue");
386 assert(ArrayType &&
"std::initializer_list constructed from non-array");
397 if (!Field->getType()->isPointerType() ||
398 !Ctx.
hasSameType(Field->getType()->getPointeeType(),
410 Builder.CreateInBoundsGEP(ArrayPtr.getPointer(), IdxStart,
"arraystart");
421 if (Field->getType()->isPointerType() &&
422 Ctx.
hasSameType(Field->getType()->getPointeeType(),
427 Builder.CreateInBoundsGEP(ArrayPtr.getPointer(), IdxEnd,
"arrayend");
444 if (isa<ImplicitValueInitExpr>(E))
447 if (
auto *ILE = dyn_cast<InitListExpr>(E)) {
448 if (ILE->getNumInits())
453 if (
auto *Cons = dyn_cast_or_null<CXXConstructExpr>(E))
454 return Cons->getConstructor()->isDefaultConstructor() &&
455 Cons->getConstructor()->isTrivial();
462 void AggExprEmitter::EmitArrayInit(
Address DestPtr, llvm::ArrayType *AType,
466 uint64_t NumArrayElements = AType->getNumElements();
467 assert(NumInitElements <= NumArrayElements);
477 Builder.CreateInBoundsGEP(DestPtr.
getPointer(), indices,
"arrayinit.begin");
486 if (NumInitElements * elementSize.
getQuantity() > 16 &&
492 auto GV =
new llvm::GlobalVariable(
495 llvm::GlobalValue::PrivateLinkage, C,
"constinit",
496 nullptr, llvm::GlobalVariable::NotThreadLocal,
501 EmitFinalDestCopy(ArrayQTy, CGF.
MakeAddrLValue(GV, ArrayQTy, Align));
512 llvm::Instruction *cleanupDominator =
nullptr;
519 "arrayinit.endOfInit");
520 cleanupDominator = Builder.
CreateStore(begin, endOfInit);
541 for (uint64_t i = 0; i != NumInitElements; ++i) {
544 element = Builder.CreateInBoundsGEP(element, one,
"arrayinit.element");
554 EmitInitializationToLValue(E->
getInit(i), elementLV);
564 if (NumInitElements != NumArrayElements &&
565 !(Dest.
isZeroed() && hasTrivialFiller &&
572 if (NumInitElements) {
573 element = Builder.CreateInBoundsGEP(element, one,
"arrayinit.start");
578 llvm::Value *end = Builder.CreateInBoundsGEP(begin,
579 llvm::ConstantInt::get(CGF.
SizeTy, NumArrayElements),
582 llvm::BasicBlock *entryBB = Builder.GetInsertBlock();
587 llvm::PHINode *currentElement =
588 Builder.CreatePHI(element->getType(), 2,
"arrayinit.cur");
589 currentElement->addIncoming(element, entryBB);
602 EmitInitializationToLValue(filler, elementLV);
604 EmitNullInitializationToLValue(elementLV);
609 Builder.CreateInBoundsGEP(currentElement, one,
"arrayinit.next");
615 llvm::Value *done = Builder.CreateICmpEQ(nextElement, end,
618 Builder.CreateCondBr(done, endBB, bodyBB);
619 currentElement->addIncoming(nextElement, Builder.GetInsertBlock());
650 EmitAggLoadOfLValue(E);
663 if (
CastExpr *castE = dyn_cast<CastExpr>(op)) {
664 if (castE->getCastKind() ==
kind)
665 return castE->getSubExpr();
666 if (castE->getCastKind() == CK_NoOp)
673 void AggExprEmitter::VisitCastExpr(
CastExpr *E) {
674 if (
const auto *ECE = dyn_cast<ExplicitCastExpr>(E))
679 assert(isa<CXXDynamicCastExpr>(E) &&
"CK_Dynamic without a dynamic_cast?");
710 case CK_DerivedToBase:
711 case CK_BaseToDerived:
712 case CK_UncheckedDerivedToBase: {
713 llvm_unreachable(
"cannot perform hierarchy conversion in EmitAggExpr: " 714 "should have been unpacked before we got here");
717 case CK_NonAtomicToAtomic:
718 case CK_AtomicToNonAtomic: {
719 bool isToAtomic = (E->
getCastKind() == CK_NonAtomicToAtomic);
724 if (isToAtomic) std::swap(atomicType, valueType);
737 (isToAtomic ? CK_AtomicToNonAtomic : CK_NonAtomicToAtomic);
743 "peephole significantly changed types?");
783 return EmitFinalDestCopy(valueType, rvalue);
786 case CK_LValueToRValue:
797 case CK_UserDefinedConversion:
798 case CK_ConstructorConversion:
801 "Implicit cast types must be compatible");
805 case CK_LValueBitCast:
806 llvm_unreachable(
"should not be emitting lvalue bitcast as rvalue");
810 case CK_ArrayToPointerDecay:
811 case CK_FunctionToPointerDecay:
812 case CK_NullToPointer:
813 case CK_NullToMemberPointer:
814 case CK_BaseToDerivedMemberPointer:
815 case CK_DerivedToBaseMemberPointer:
816 case CK_MemberPointerToBoolean:
817 case CK_ReinterpretMemberPointer:
818 case CK_IntegralToPointer:
819 case CK_PointerToIntegral:
820 case CK_PointerToBoolean:
823 case CK_IntegralCast:
824 case CK_BooleanToSignedIntegral:
825 case CK_IntegralToBoolean:
826 case CK_IntegralToFloating:
827 case CK_FloatingToIntegral:
828 case CK_FloatingToBoolean:
829 case CK_FloatingCast:
830 case CK_CPointerToObjCPointerCast:
831 case CK_BlockPointerToObjCPointerCast:
832 case CK_AnyPointerToBlockPointerCast:
833 case CK_ObjCObjectLValueCast:
834 case CK_FloatingRealToComplex:
835 case CK_FloatingComplexToReal:
836 case CK_FloatingComplexToBoolean:
837 case CK_FloatingComplexCast:
838 case CK_FloatingComplexToIntegralComplex:
839 case CK_IntegralRealToComplex:
840 case CK_IntegralComplexToReal:
841 case CK_IntegralComplexToBoolean:
842 case CK_IntegralComplexCast:
843 case CK_IntegralComplexToFloatingComplex:
844 case CK_ARCProduceObject:
845 case CK_ARCConsumeObject:
846 case CK_ARCReclaimReturnedObject:
847 case CK_ARCExtendBlockObject:
848 case CK_CopyAndAutoreleaseBlockObject:
849 case CK_BuiltinFnToFnPtr:
850 case CK_ZeroToOCLEvent:
851 case CK_ZeroToOCLQueue:
852 case CK_AddressSpaceConversion:
853 case CK_IntToOCLSampler:
854 llvm_unreachable(
"cast kind invalid for aggregate types");
858 void AggExprEmitter::VisitCallExpr(
const CallExpr *E) {
860 EmitAggLoadOfLValue(E);
880 void AggExprEmitter::VisitStmtExpr(
const StmtExpr *E) {
894 const char *NameSuffix =
"") {
897 ArgTy = CT->getElementType();
901 "member pointers may only be compared for equality");
903 CGF, LHS, RHS, MPT,
false);
909 llvm::CmpInst::Predicate FCmp;
910 llvm::CmpInst::Predicate SCmp;
911 llvm::CmpInst::Predicate UCmp;
913 CmpInstInfo InstInfo = [&]() -> CmpInstInfo {
914 using FI = llvm::FCmpInst;
915 using II = llvm::ICmpInst;
918 return {
"cmp.lt", FI::FCMP_OLT, II::ICMP_SLT, II::ICMP_ULT};
920 return {
"cmp.gt", FI::FCMP_OGT, II::ICMP_SGT, II::ICMP_UGT};
922 return {
"cmp.eq", FI::FCMP_OEQ, II::ICMP_EQ, II::ICMP_EQ};
924 llvm_unreachable(
"Unrecognised CompareKind enum");
928 return Builder.CreateFCmp(InstInfo.FCmp, LHS, RHS,
929 llvm::Twine(InstInfo.Name) + NameSuffix);
933 return Builder.CreateICmp(Inst, LHS, RHS,
934 llvm::Twine(InstInfo.Name) + NameSuffix);
937 llvm_unreachable(
"unsupported aggregate binary expression should have " 938 "already been handled");
942 using llvm::BasicBlock;
950 "cannot copy non-trivially copyable aggregate");
955 if (ArgTy->isVectorType())
957 E,
"aggregate three-way comparison with vector arguments");
958 if (!ArgTy->isIntegralOrEnumerationType() && !ArgTy->isRealFloatingType() &&
959 !ArgTy->isNullPtrType() && !ArgTy->isPointerType() &&
960 !ArgTy->isMemberPointerType() && !ArgTy->isAnyComplexType()) {
963 bool IsComplex = ArgTy->isAnyComplexType();
966 auto EmitOperand = [&](
Expr *E) -> std::pair<Value *, Value *> {
975 auto LHSValues = EmitOperand(E->
getLHS()),
976 RHSValues = EmitOperand(E->
getRHS());
980 K, IsComplex ?
".r" :
"");
985 RHSValues.second, K,
".i");
986 return Builder.CreateAnd(Cmp, CmpImag,
"and.eq");
989 return Builder.getInt(VInfo->getIntValue());
993 if (ArgTy->isNullPtrType()) {
996 Select = Builder.CreateSelect(
1001 Builder.CreateSelect(EmitCmp(
CK_Less), EmitCmpRes(CmpInfo.
getLess()),
1003 Select = Builder.CreateSelect(EmitCmp(
CK_Equal),
1005 SelectOne,
"sel.eq");
1007 Value *SelectEq = Builder.CreateSelect(
1012 SelectEq,
"sel.gt");
1013 Select = Builder.CreateSelect(
1014 EmitCmp(
CK_Less), EmitCmpRes(CmpInfo.
getLess()), SelectGT,
"sel.lt");
1029 void AggExprEmitter::VisitBinaryOperator(
const BinaryOperator *E) {
1031 VisitPointerToDataMemberBinaryOperator(E);
1036 void AggExprEmitter::VisitPointerToDataMemberBinaryOperator(
1039 EmitFinalDestCopy(E->
getType(), LV);
1049 if (
const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) {
1051 return (var && var->
hasAttr<BlocksAttr>());
1060 if (op->isAssignmentOp() || op->isPtrMemOp())
1064 if (op->getOpcode() == BO_Comma)
1072 = dyn_cast<AbstractConditionalOperator>(E)) {
1078 = dyn_cast<OpaqueValueExpr>(E)) {
1079 if (
const Expr *src = op->getSourceExpr())
1086 }
else if (
const CastExpr *
cast = dyn_cast<CastExpr>(E)) {
1087 if (
cast->getCastKind() == CK_LValueToRValue)
1093 }
else if (
const UnaryOperator *uop = dyn_cast<UnaryOperator>(E)) {
1097 }
else if (
const MemberExpr *mem = dyn_cast<MemberExpr>(E)) {
1113 &&
"Invalid assignment");
1129 if (LHS.getType()->isAtomicType() ||
1170 EmitFinalDestCopy(E->
getType(), LHS);
1173 void AggExprEmitter::
1195 assert(CGF.
HaveInsertPoint() &&
"expression evaluation ended with no IP!");
1196 CGF.
Builder.CreateBr(ContBlock);
1212 void AggExprEmitter::VisitChooseExpr(
const ChooseExpr *CE) {
1216 void AggExprEmitter::VisitVAArgExpr(
VAArgExpr *VE) {
1241 if (!wasExternallyDestructed)
1251 void AggExprEmitter::VisitCXXInheritedCtorInitExpr(
1260 AggExprEmitter::VisitLambdaExpr(
LambdaExpr *E) {
1291 return IL->getValue() == 0;
1294 return FL->getValue().isPosZero();
1296 if ((isa<ImplicitValueInitExpr>(E) || isa<CXXScalarValueInitExpr>(E)) &&
1300 if (
const CastExpr *ICE = dyn_cast<CastExpr>(E))
1301 return ICE->getCastKind() == CK_NullToPointer &&
1305 return CL->getValue() == 0;
1313 AggExprEmitter::EmitInitializationToLValue(
Expr *E,
LValue LV) {
1320 }
else if (isa<ImplicitValueInitExpr>(E) || isa<CXXScalarValueInitExpr>(E)) {
1321 return EmitNullInitializationToLValue(LV);
1322 }
else if (isa<NoInitExpr>(E)) {
1350 llvm_unreachable(
"bad evaluation kind");
1353 void AggExprEmitter::EmitNullInitializationToLValue(
LValue lv) {
1380 void AggExprEmitter::VisitInitListExpr(
InitListExpr *E) {
1387 if (llvm::Constant* C = CGF.
CGM.EmitConstantExpr(E, E->
getType(), &CGF)) {
1388 llvm::GlobalVariable* GV =
1389 new llvm::GlobalVariable(CGF.
CGM.
getModule(), C->getType(),
true,
1424 llvm::Instruction *cleanupDominator =
nullptr;
1426 unsigned curInitIndex = 0;
1429 if (
auto *CXXRD = dyn_cast<CXXRecordDecl>(record)) {
1430 assert(E->
getNumInits() >= CXXRD->getNumBases() &&
1431 "missing initializer for base class");
1432 for (
auto &
Base : CXXRD->bases()) {
1433 assert(!
Base.isVirtual() &&
"should not see vbases here");
1434 auto *BaseRD =
Base.getType()->getAsCXXRecordDecl();
1447 Base.getType().isDestructedType()) {
1466 for (
const auto *Field : record->
fields())
1467 assert(Field->isUnnamedBitfield() &&
"Only unnamed bitfields allowed");
1476 if (NumInitElements) {
1478 EmitInitializationToLValue(E->
getInit(0), FieldLoc);
1481 EmitNullInitializationToLValue(FieldLoc);
1489 for (
const auto *field : record->
fields()) {
1491 if (field->getType()->isIncompleteArrayType())
1495 if (field->isUnnamedBitfield())
1501 if (curInitIndex == NumInitElements && Dest.
isZeroed() &&
1510 if (curInitIndex < NumInitElements) {
1512 EmitInitializationToLValue(E->
getInit(curInitIndex++), LV);
1515 EmitNullInitializationToLValue(LV);
1521 bool pushedCleanup =
false;
1523 = field->getType().isDestructedType()) {
1526 if (!cleanupDominator)
1529 llvm::Constant::getNullValue(CGF.
Int8PtrTy),
1535 pushedCleanup =
true;
1541 if (!pushedCleanup && LV.
isSimple())
1542 if (llvm::GetElementPtrInst *GEP =
1543 dyn_cast<llvm::GetElementPtrInst>(LV.
getPointer()))
1544 if (GEP->use_empty())
1545 GEP->eraseFromParent();
1550 for (
unsigned i = cleanups.size(); i != 0; --i)
1554 if (cleanupDominator)
1555 cleanupDominator->eraseFromParent();
1564 uint64_t numElements = E->
getArraySize().getZExtValue();
1572 llvm::Value *begin = Builder.CreateInBoundsGEP(destPtr.getPointer(), indices,
1587 llvm::BasicBlock *entryBB = Builder.GetInsertBlock();
1592 llvm::PHINode *index =
1593 Builder.CreatePHI(zero->getType(), 2,
"arrayinit.index");
1594 index->addIncoming(zero, entryBB);
1595 llvm::Value *element = Builder.CreateInBoundsGEP(begin, index);
1601 if (outerBegin->getType() != element->getType())
1602 outerBegin = Builder.
CreateBitCast(outerBegin, element->getType());
1627 AggExprEmitter(CGF, elementSlot,
false)
1628 .VisitArrayInitLoopExpr(InnerLoop, outerBegin);
1630 EmitInitializationToLValue(E->
getSubExpr(), elementLV);
1635 index, llvm::ConstantInt::get(CGF.
SizeTy, 1),
"arrayinit.next");
1636 index->addIncoming(nextIndex, Builder.GetInsertBlock());
1640 nextIndex, llvm::ConstantInt::get(CGF.
SizeTy, numElements),
1643 Builder.CreateCondBr(done, endBB, bodyBB);
1656 EmitInitializationToLValue(E->
getBase(), DestLV);
1677 ILE = dyn_cast<InitListExpr>(ILE->
getInit(0));
1685 if (!RT->isUnionType()) {
1689 unsigned ILEElement = 0;
1690 if (
auto *CXXRD = dyn_cast<CXXRecordDecl>(SD))
1691 while (ILEElement != CXXRD->getNumBases())
1694 for (
const auto *Field : SD->
fields()) {
1697 if (Field->getType()->isIncompleteArrayType() ||
1700 if (Field->isUnnamedBitfield())
1706 if (Field->getType()->isReferenceType())
1713 return NumNonZeroBytes;
1719 for (
unsigned i = 0, e = ILE->
getNumInits(); i != e; ++i)
1721 return NumNonZeroBytes;
1738 const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1751 if (NumNonZeroBytes*4 > Size)
1773 assert(E && hasAggregateEvaluationKind(E->
getType()) &&
1774 "Invalid aggregate expression to emit");
1776 "slot has bits but no address");
1781 AggExprEmitter(*
this, Slot, Slot.
isIgnored()).Visit(const_cast<Expr*>(E));
1785 assert(hasAggregateEvaluationKind(E->
getType()) &&
"Invalid argument!");
1810 getContext().getASTRecordLayout(BaseRD).getSize() <=
1834 "Trying to aggregate-copy a type without a trivial copy/move " 1835 "constructor or assignment operator");
1856 std::pair<CharUnits, CharUnits>
TypeInfo;
1858 TypeInfo = getContext().getTypeInfoDataSizeInChars(Ty);
1860 TypeInfo = getContext().getTypeInfoInChars(Ty);
1863 if (TypeInfo.first.isZero()) {
1865 if (
auto *VAT = dyn_cast_or_null<VariableArrayType>(
1866 getContext().getAsArrayType(Ty))) {
1868 SizeVal = emitArrayLength(VAT, BaseEltTy, DestPtr);
1869 TypeInfo = getContext().getTypeInfoInChars(BaseEltTy);
1870 assert(!TypeInfo.first.isZero());
1871 SizeVal = Builder.CreateNUWMul(
1873 llvm::ConstantInt::get(SizeTy, TypeInfo.first.getQuantity()));
1877 SizeVal = llvm::ConstantInt::get(SizeTy, TypeInfo.first.getQuantity());
1902 CGM.getObjCRuntime().EmitGCMemmoveCollectable(*
this, DestPtr, SrcPtr,
1907 QualType BaseType = getContext().getBaseElementType(Ty);
1910 CGM.getObjCRuntime().EmitGCMemmoveCollectable(*
this, DestPtr, SrcPtr,
1917 auto Inst = Builder.
CreateMemCpy(DestPtr, SrcPtr, SizeVal, isVolatile);
1922 if (llvm::MDNode *TBAAStructTag = CGM.getTBAAStructInfo(Ty))
1923 Inst->setMetadata(llvm::LLVMContext::MD_tbaa_struct, TBAAStructTag);
1925 if (CGM.getCodeGenOpts().NewStructPathTBAA) {
1928 CGM.DecorateInstructionWithTBAA(Inst, TBAAInfo);
const llvm::DataLayout & getDataLayout() 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...
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.
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)
Expr - 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...
void enterFullExpression(const ExprWithCleanups *E)
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.