14 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
15 #define LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
33 #include "llvm/ADT/ArrayRef.h"
34 #include "llvm/ADT/DenseMap.h"
35 #include "llvm/ADT/SmallVector.h"
36 #include "llvm/IR/ValueHandle.h"
37 #include "llvm/Support/Debug.h"
53 class CXXDestructorDecl;
54 class CXXForRangeStmt;
58 class EnumConstantDecl;
60 class FunctionProtoType;
62 class ObjCContainerDecl;
63 class ObjCInterfaceDecl;
66 class ObjCImplementationDecl;
67 class ObjCPropertyImplDecl;
69 class TargetCodeGenInfo;
71 class ObjCForCollectionStmt;
73 class ObjCAtThrowStmt;
74 class ObjCAtSynchronizedStmt;
75 class ObjCAutoreleasePoolStmt;
84 class BlockFieldFlags;
108 JumpDest() : Block(nullptr), ScopeDepth(), Index(0) {}
112 : Block(Block), ScopeDepth(Depth), Index(Index) {}
114 bool isValid()
const {
return Block !=
nullptr; }
115 llvm::BasicBlock *
getBlock()
const {
return Block; }
125 llvm::BasicBlock *Block;
139 void InsertHelper(llvm::Instruction *I,
const llvm::Twine &Name,
140 llvm::BasicBlock *BB,
141 llvm::BasicBlock::iterator InsertPt)
const;
174 :
Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) {}
177 :
Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) {
183 I != E; ++I, ++Field) {
184 if (I->capturesThis())
185 CXXThisFieldDecl = *Field;
186 else if (I->capturesVariable())
187 CaptureFields[I->getCapturedVar()] = *Field;
201 return CaptureFields.lookup(VD);
225 llvm::SmallDenseMap<const VarDecl *, FieldDecl *> CaptureFields;
291 llvm::DenseMap<const VarDecl *, llvm::Value *>
NRVOFlags;
356 llvm::Constant *BeginCatchFn;
360 llvm::AllocaInst *ForEHVar;
364 llvm::AllocaInst *SavedExnVar;
368 llvm::Constant *beginCatchFn, llvm::Constant *endCatchFn,
369 llvm::Constant *rethrowFn);
379 template <
class T,
class... As>
387 typedef std::tuple<typename DominatingValue<As>::saved_type...> SavedTuple;
397 template <
class T,
class... As>
407 static_assert(
sizeof(Header) % llvm::AlignOf<T>::Alignment == 0,
408 "Cleanup will be allocated on misaligned address");
411 new (Buffer +
sizeof(Header)) T(A...);
443 llvm::Instruction *DominatingIP);
453 llvm::Instruction *DominatingIP);
459 size_t LifetimeExtendedCleanupStackSize;
460 bool OldDidCallStackSave;
477 LifetimeExtendedCleanupStackSize =
479 OldDidCallStackSave = CGF.DidCallStackSave;
480 CGF.DidCallStackSave =
false;
487 CGF.DidCallStackSave = OldDidCallStackSave;
489 LifetimeExtendedCleanupStackSize);
502 CGF.DidCallStackSave = OldDidCallStackSave;
504 LifetimeExtendedCleanupStackSize);
521 CGF.CurLexicalScope =
this;
528 Labels.push_back(label);
548 CGF.CurLexicalScope = ParentScope;
562 typedef llvm::DenseMap<const VarDecl *, llvm::Value *> VarDeclMapTy;
563 VarDeclMapTy SavedLocals;
564 VarDeclMapTy SavedPrivates;
581 const std::function<
llvm::Value *()> &PrivateGen) {
583 if (SavedLocals.count(LocalVD) > 0)
return false;
584 SavedLocals[LocalVD] =
CGF.LocalDeclMap.lookup(LocalVD);
585 CGF.LocalDeclMap.erase(LocalVD);
586 SavedPrivates[LocalVD] = PrivateGen();
587 CGF.LocalDeclMap[LocalVD] = SavedLocals[LocalVD];
600 for (
auto VDPair : SavedPrivates) {
601 CGF.LocalDeclMap[VDPair.first] = VDPair.second;
603 SavedPrivates.clear();
604 return !SavedLocals.empty();
610 for (
auto I : SavedLocals) {
611 CGF.LocalDeclMap[I.first] = I.second;
631 size_t OldLifetimeExtendedStackSize);
671 llvm::BasicBlock *StartBB;
675 : StartBB(CGF.
Builder.GetInsertBlock()) {}
678 assert(CGF.OutermostConditional !=
this);
679 if (!CGF.OutermostConditional)
680 CGF.OutermostConditional =
this;
684 assert(CGF.OutermostConditional !=
nullptr);
685 if (CGF.OutermostConditional ==
this)
686 CGF.OutermostConditional =
nullptr;
703 new llvm::StoreInst(value, addr, &block->back());
718 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
719 CGF.OutermostConditional =
nullptr;
723 CGF.OutermostConditional = SavedOutermostConditional;
732 llvm::Instruction *Inst;
752 : OpaqueValue(ov), BoundLValue(boundLValue) {}
779 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
787 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
799 bool isValid()
const {
return OpaqueValue !=
nullptr; }
800 void clear() { OpaqueValue =
nullptr; }
803 assert(OpaqueValue &&
"no data to unbind!");
806 CGF.OpaqueLValues.erase(OpaqueValue);
808 CGF.OpaqueRValues.erase(OpaqueValue);
831 if (isa<ConditionalOperator>(op))
864 std::pair<llvm::Type *, unsigned>
873 bool DisableDebugInfo;
877 bool DidCallStackSave;
883 llvm::IndirectBrInst *IndirectBranch;
887 typedef llvm::DenseMap<const Decl*, llvm::Value*> DeclMapTy;
888 DeclMapTy LocalDeclMap;
892 llvm::DenseMap<llvm::AllocaInst *, int> EscapedLocals;
895 llvm::DenseMap<const LabelDecl*, JumpDest> LabelMap;
899 struct BreakContinue {
900 BreakContinue(JumpDest Break, JumpDest Continue)
901 : BreakBlock(Break), ContinueBlock(Continue) {}
904 JumpDest ContinueBlock;
906 SmallVector<BreakContinue, 8> BreakContinueStack;
911 llvm::MDNode *createProfileWeights(uint64_t TrueCount, uint64_t FalseCount);
912 llvm::MDNode *createProfileWeights(ArrayRef<uint64_t> Weights);
913 llvm::MDNode *createProfileWeightsForLoop(
const Stmt *Cond,
920 PGO.emitCounterIncrement(
Builder, S);
921 PGO.setCurrentStmt(S);
927 if (!Count.hasValue())
934 PGO.setCurrentRegionCount(Count);
940 return PGO.getCurrentRegionCount();
947 llvm::SwitchInst *SwitchInsn;
953 llvm::BasicBlock *CaseRangeBlock;
957 llvm::DenseMap<const OpaqueValueExpr *, LValue> OpaqueLValues;
958 llvm::DenseMap<const OpaqueValueExpr *, RValue> OpaqueRValues;
966 llvm::DenseMap<const Expr*, llvm::Value*> VLASizeMap;
970 llvm::BasicBlock *UnreachableBlock;
973 unsigned NumReturnExprs;
976 unsigned NumSimpleReturnExprs;
988 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
989 CGF.CXXDefaultInitExprThis = This;
992 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1006 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis;
1047 llvm::DenseMap<
const ValueDecl *, std::pair<llvm::Type *,
1048 unsigned> > ByRefValueInfo;
1050 llvm::BasicBlock *TerminateLandingPad;
1051 llvm::BasicBlock *TerminateHandler;
1052 llvm::BasicBlock *TrapBB;
1065 llvm::Function *Fn);
1074 if (DisableDebugInfo)
1100 if (!UnreachableBlock) {
1104 return UnreachableBlock;
1113 const auto *FD = dyn_cast_or_null<FunctionDecl>(
CurCodeDecl);
1114 return FD && FD->usesSEHTry();
1140 Destroyer *destroyer,
bool useEHCleanupForArray);
1143 bool useEHCleanupForArray);
1149 bool useEHCleanupForArray);
1152 bool useEHCleanupForArray,
1156 bool checkZeroLength,
bool useEHCleanup);
1173 llvm_unreachable(
"bad destruction kind");
1194 llvm::Constant *AtomicHelperFn);
1205 llvm::Constant *AtomicHelperFn);
1219 llvm::Constant *BlockVarLayout);
1223 const DeclMapTy &ldm,
1224 bool IsLambdaConversionToBlock);
1236 class AutoVarEmission;
1323 bool BaseIsNonVirtualPrimaryBase,
1325 VisitedVirtualBasesSetTy& VBases);
1433 llvm::Function *parent =
nullptr,
1434 llvm::BasicBlock *before =
nullptr) {
1459 void EmitBlock(llvm::BasicBlock *BB,
bool IsFinished=
false);
1478 return Builder.GetInsertBlock() !=
nullptr;
1510 const Twine &Name =
"tmp");
1559 bool ignoreResult =
false);
1579 bool capturedByInit);
1585 const RecordDecl *RD = cast<RecordDecl>(RT->getDecl());
1606 std::min(DestTypeAlign, SrcTypeAlign),
1617 QualType EltTy,
bool isVolatile=
false,
1619 bool isAssignment =
false);
1628 assert(Res &&
"Invalid argument to GetAddrOfLocalVar(), no decl!");
1637 llvm::DenseMap<const OpaqueValueExpr*,LValue>::iterator
1638 it = OpaqueLValues.find(e);
1639 assert(it != OpaqueLValues.end() &&
"no mapping for opaque value!");
1648 llvm::DenseMap<const OpaqueValueExpr*,RValue>::iterator
1649 it = OpaqueRValues.find(e);
1650 assert(it != OpaqueRValues.end() &&
"no mapping for opaque value!");
1694 assert(CXXThisValue &&
"no 'this' value for this function");
1695 return CXXThisValue;
1703 assert(CXXStructorImplicitParamValue &&
"no VTT value for this function");
1704 return CXXStructorImplicitParamValue;
1710 assert(CXXStructorImplicitParamValue &&
1711 "no implicit argument value for this function");
1712 return CXXStructorImplicitParamValue;
1721 bool BaseIsVirtual);
1735 bool NullCheckValue);
1755 bool ForVirtualBase,
bool Delegating,
1766 bool ZeroInitialization =
false);
1772 bool ZeroInitialization =
false);
1777 bool ForVirtualBase,
bool Delegating,
1798 const Expr *Arg,
bool IsDelete);
1845 bool SkipNullCheck =
false);
1851 QualType IndexType,
bool Accessed);
1854 bool isInc,
bool isPre);
1856 bool isInc,
bool isPre);
1879 bool capturedByInit);
1913 bool IsConstantAggregate;
1921 AutoVarEmission(
const VarDecl &variable)
1922 : Variable(&variable), Address(nullptr), NRVOFlag(nullptr),
1924 SizeForLifetimeMarkers(nullptr) {}
1926 bool wasEmittedAsGlobal()
const {
return Address ==
nullptr; }
1932 return SizeForLifetimeMarkers !=
nullptr;
1936 return SizeForLifetimeMarkers;
1949 if (!IsByRef)
return Address;
1952 return CGF.
Builder.CreateStructGEP(F.first, Address, F.second,
1963 llvm::GlobalValue::LinkageTypes
Linkage);
2007 bool GetLast =
false,
2054 const Stmt *OutlinedStmt);
2138 OMPPrivateScope &PrivateScope);
2140 OMPPrivateScope &PrivateScope);
2165 OMPPrivateScope &PrivateScope);
2183 OMPPrivateScope &PrivateScope);
2232 const Stmt &S,
bool RequiresCleanup,
const Expr *LoopCond,
2233 const Expr *IncExpr,
2251 OMPPrivateScope &LoopScope,
bool Ordered,
2312 llvm::AtomicOrdering AO,
bool IsVolatile =
false,
2318 bool IsVolatile,
bool isInit);
2322 llvm::AtomicOrdering Success = llvm::SequentiallyConsistent,
2323 llvm::AtomicOrdering Failure = llvm::SequentiallyConsistent,
2344 llvm::MDNode *TBAAInfo =
nullptr,
2346 uint64_t TBAAOffset = 0);
2358 bool Volatile,
unsigned Alignment,
QualType Ty,
2359 llvm::MDNode *TBAAInfo =
nullptr,
bool isInit =
false,
2361 uint64_t TBAAOffset = 0);
2414 bool Accessed =
false);
2430 llvm::PointerIntPair<llvm::Constant*, 1, bool> ValueAndIsReference;
2432 : ValueAndIsReference(C, isReference) {}
2443 return ValueAndIsReference.getOpaqueValue() !=
nullptr;
2455 return ValueAndIsReference.getPointer();
2478 unsigned CVRQualifiers);
2507 const Decl *TargetDecl =
nullptr,
2508 llvm::Instruction **callOrInvoke =
nullptr);
2512 const Decl *TargetDecl =
nullptr,
2518 const Twine &name =
"");
2521 const Twine &name =
"");
2523 const Twine &name =
"");
2526 const Twine &name =
"");
2530 const Twine &Name =
"");
2532 const Twine &Name =
"");
2535 const Twine &name =
"");
2537 const Twine &name =
"");
2580 unsigned BuiltinID,
const CallExpr *E,
2590 const llvm::CmpInst::Predicate Fp,
2591 const llvm::CmpInst::Predicate Ip,
2592 const llvm::Twine &Name =
"");
2596 unsigned LLVMIntrinsic,
2597 unsigned AltLLVMIntrinsic,
2598 const char *NameHint,
2604 unsigned Modifier, llvm::Type *ArgTy,
2609 unsigned shift = 0,
bool rightshift =
false);
2612 bool negateForRightShift);
2614 llvm::Type *Ty,
bool usgn,
const char *name);
2657 bool resultIgnored);
2659 bool resultIgnored);
2670 std::pair<LValue,llvm::Value*>
2672 std::pair<LValue,llvm::Value*>
2743 bool IgnoreReal =
false,
2744 bool IgnoreImag =
false);
2760 llvm::GlobalVariable *
2762 llvm::GlobalVariable *GV);
2771 llvm::Constant *Addr);
2776 llvm::Constant *addr);
2790 llvm::GlobalVariable *Guard =
nullptr);
2795 const std::vector<std::pair<llvm::WeakVH,
2796 llvm::Constant*> > &DtorsAndObjects);
2800 llvm::GlobalVariable *Addr,
2827 StringRef AnnotationStr,
2867 llvm::BasicBlock *FalseBlock, uint64_t TrueCount);
2915 llvm::MDNode *getRangeForLoadFromType(
QualType Ty);
2918 void deferPlaceholderReplacement(llvm::Instruction *Old,
llvm::Value *New);
2921 DeferredReplacements;
2933 void ExpandTypeToArgs(
QualType Ty,
RValue RV, llvm::FunctionType *IRFuncTy,
2935 unsigned &IRCallArgPos);
2938 const Expr *InputExpr, std::string &ConstraintStr);
2942 std::string &ConstraintStr,
2952 return classDecl->getTypeParamListAsWritten();
2956 return catDecl->getTypeParamList();
2962 template<
typename T>
2967 template <
typename T>
2972 unsigned ParamsToSkip = 0) {
2976 assert((ParamsToSkip == 0 || CallArgTypeInfo) &&
2977 "Can't skip parameters if type info is not provided");
2978 if (CallArgTypeInfo) {
2984 for (
auto I = CallArgTypeInfo->param_type_begin() + ParamsToSkip,
2985 E = CallArgTypeInfo->param_type_end();
2986 I != E; ++I, ++Arg) {
2987 assert(Arg != ArgEnd &&
"Running over edge of argument list!");
2988 assert((isGenericMethod ||
2989 ((*I)->isVariablyModifiedType() ||
2990 (*I).getNonReferenceType()->isObjCRetainableType() ||
2997 "type mismatch in call argument!");
2998 ArgTypes.push_back(*I);
3005 (Arg == ArgEnd || !CallArgTypeInfo || CallArgTypeInfo->isVariadic()) &&
3006 "Extra arguments in non-variadic function!");
3009 for (; Arg != ArgEnd; ++Arg)
3010 ArgTypes.push_back(getVarArgType(*Arg));
3012 EmitCallArgs(Args, ArgTypes, ArgBeg, ArgEnd, CalleeDecl, ParamsToSkip);
3019 unsigned ParamsToSkip = 0);
3028 void EmitDeclMetadata();
3030 CodeGenModule::ByrefHelpers *
3031 buildByrefHelpers(llvm::StructType &byrefType,
3032 const AutoVarEmission &emission);
3034 void AddObjCARCExceptionMetadata(llvm::Instruction *Inst);
3038 std::pair<llvm::Value*, unsigned> EmitPointerWithAlignment(
const Expr *Addr);
3040 llvm::Value *GetValueForARMHint(
unsigned BuiltinID);
3051 if (!isa<llvm::Instruction>(value))
return false;
3054 llvm::BasicBlock *block = cast<llvm::Instruction>(value)->getParent();
3055 return (block != &block->getParent()->getEntryBlock());
3060 if (!needsSaving(value))
return saved_type(value,
false);
3065 CGF.
Builder.CreateStore(value, alloca);
3071 if (!value.getInt())
return value.getPointer();
3072 return CGF.
Builder.CreateLoad(value.getPointer());
3089 enum Kind { ScalarLiteral, ScalarAddress, AggregateLiteral,
3090 AggregateAddress, ComplexAddress };
3097 static bool needsSaving(
RValue value);
3105 return saved_type::needsSaving(value);
3108 return saved_type::save(CGF, value);
3111 return value.restore(CGF);
void enterNonTrivialFullExpression(const ExprWithCleanups *E)
A call to an overloaded operator written using operator syntax.
void EmitInitializerForField(FieldDecl *Field, LValue LHS, Expr *Init, ArrayRef< VarDecl * > ArrayIndexes)
void EnterDtorCleanups(const CXXDestructorDecl *Dtor, CXXDtorType Type)
Emit all code that comes at the end of class's destructor. This is to call destructors on members and...
void EmitIndirectGotoStmt(const IndirectGotoStmt &S)
This represents '#pragma omp master' directive.
SourceLocation getEnd() const
llvm::Value * GetAddrOfBlockDecl(const VarDecl *var, bool ByRef)
virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S)
Emit the captured statement body.
This represents '#pragma omp task' directive.
llvm::Constant * GenerateCopyHelperFunction(const CGBlockInfo &blockInfo)
llvm::Value * BlockPointer
llvm::Value * EmitARCStoreStrong(LValue lvalue, llvm::Value *value, bool resultIgnored)
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
void ActivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
Activate a cleanup that was created in an inactivated state.
void end(CodeGenFunction &CGF)
void EmitOMPTaskwaitDirective(const OMPTaskwaitDirective &S)
llvm::Value * EmitAArch64CompareBuiltinExpr(llvm::Value *Op, llvm::Type *Ty, const llvm::CmpInst::Predicate Fp, const llvm::CmpInst::Predicate Ip, const llvm::Twine &Name="")
void EmitGCMemmoveCollectable(llvm::Value *DestPtr, llvm::Value *SrcPtr, QualType Ty)
CXXDefaultInitExprScope(CodeGenFunction &CGF)
void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor, CXXCtorType CtorType, const FunctionArgList &Args, SourceLocation Loc)
LValue EmitComplexCompoundAssignmentLValue(const CompoundAssignOperator *E)
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
llvm::Value * EmitARCRetainAutoreleaseScalarExpr(const Expr *expr)
void EmitARCMoveWeak(llvm::Value *dst, llvm::Value *src)
llvm::Value * getExceptionSlot()
Destroyer * getDestroyer(QualType::DestructionKind destructionKind)
void EmitVTablePtrCheckForCall(const CXXMethodDecl *MD, llvm::Value *VTable, CFITypeCheckKind TCK, SourceLocation Loc)
void EmitSEHLeaveStmt(const SEHLeaveStmt &S)
void GenerateCapturedStmtFunctionProlog(const CapturedStmt &S)
void EmitExtendGCLifetime(llvm::Value *object)
void EmitCtorPrologue(const CXXConstructorDecl *CD, CXXCtorType Type, FunctionArgList &Args)
CodeGenTypes & getTypes()
void EmitOMPReductionClauseFinal(const OMPExecutableDirective &D)
Emit final update of reduction values to original variables at the end of the directive.
llvm::Type * ConvertTypeForMem(QualType T)
void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount)
void EmitAnyExprToExn(const Expr *E, llvm::Value *Addr)
void EmitVarDecl(const VarDecl &D)
llvm::Value * EmitARCExtendBlockObject(const Expr *expr)
void EmitGotoStmt(const GotoStmt &S)
LValue EmitStmtExprLValue(const StmtExpr *E)
void EmitAttributedStmt(const AttributedStmt &S)
llvm::Constant * EmitCheckTypeDescriptor(QualType T)
Emit a description of a type in a format suitable for passing to a runtime sanitizer handler...
void InitializeVTablePointers(BaseSubobject Base, const CXXRecordDecl *NearestVBase, CharUnits OffsetFromNearestVBase, bool BaseIsNonVirtualPrimaryBase, const CXXRecordDecl *VTableClass, VisitedVirtualBasesSetTy &VBases)
llvm::Value * EmitNVPTXBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::LLVMContext & getLLVMContext()
void EmitFunctionInstrumentation(const char *Fn)
LValue EmitObjCIsaExpr(const ObjCIsaExpr *E)
LValue EmitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *E)
void EmitCXXTryStmt(const CXXTryStmt &S)
bool isInConditionalBranch() const
const TargetInfo & getTarget() const
void EmitStoreThroughGlobalRegLValue(RValue Src, LValue Dst)
Store of global named registers are always calls to intrinsics.
llvm::Value * EmitARCLoadWeak(llvm::Value *addr)
void EmitNonNullArgCheck(RValue RV, QualType ArgType, SourceLocation ArgLoc, const FunctionDecl *FD, unsigned ParmNum)
Create a check for a function parameter that may potentially be declared as non-null.
llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp")
OpaqueValueMapping(CodeGenFunction &CGF, const AbstractConditionalOperator *op)
This represents '#pragma omp for simd' directive.
Checking the 'this' pointer for a constructor call.
void emitAutoVarTypeCleanup(const AutoVarEmission &emission, QualType::DestructionKind dtorKind)
Enter a destroy cleanup for the given local variable.
RValue EmitPseudoObjectRValue(const PseudoObjectExpr *e, AggValueSlot slot=AggValueSlot::ignored())
void EmitOMPCopy(CodeGenFunction &CGF, QualType OriginalType, llvm::Value *DestAddr, llvm::Value *SrcAddr, const VarDecl *DestVD, const VarDecl *SrcVD, const Expr *Copy)
Emit proper copying of data from one variable to another.
llvm::Value * LoadCXXStructorImplicitParam()
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
static saved_type save(CodeGenFunction &CGF, llvm::Value *value)
Try to save the given value.
static bool classof(const CGCapturedStmtInfo *)
Represents an attribute applied to a statement.
llvm::Value * EmitCompoundStmt(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
void EmitAutoVarDecl(const VarDecl &D)
const llvm::DataLayout & getDataLayout() const
void EmitOMPOrderedDirective(const OMPOrderedDirective &S)
static Destroyer destroyARCStrongPrecise
llvm::Value * LoadCXXThis()
LValue EmitBinaryOperatorLValue(const BinaryOperator *E)
Represents Objective-C's @throw statement.
void EmitStoreThroughLValue(RValue Src, LValue Dst, bool isInit=false)
void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit)
bool typeIsSuitableForInlineAtomic(QualType Ty, bool IsVolatile) const
bool ShouldInstrumentFunction()
CGCapturedStmtInfo(const CapturedStmt &S, CapturedRegionKind K=CR_Default)
LValue EmitOpaqueValueLValue(const OpaqueValueExpr *e)
void GenerateObjCSetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
Generate an Objective-C property setter function.
void EmitSEHExceptionCodeSave(CodeGenFunction &ParentCGF, llvm::Value *ParentFP, llvm::Value *EntryEBP)
void GenerateCode(GlobalDecl GD, llvm::Function *Fn, const CGFunctionInfo &FnInfo)
void SpecialInitFn(CodeGenFunction &Init, const VarDecl &D, llvm::Value *Address)
bool sanitizePerformTypeCheck() const
Whether any type-checking sanitizers are enabled. If false, calls to EmitTypeCheck can be skipped...
Represents a call to a C++ constructor.
RValue EmitCXXMemberCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue)
bool addPrivate(const VarDecl *LocalVD, const std::function< llvm::Value *()> &PrivateGen)
Registers LocalVD variable as a private and apply PrivateGen function for it to generate correspondin...
DominatingValue< T >::saved_type saveValueInCond(T value)
CGCapturedStmtInfo(CapturedRegionKind K=CR_Default)
llvm::Value * EmitObjCMRRAutoreleasePoolPush()
llvm::Function * GenerateVarArgsThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk)
llvm::Constant * GenerateObjCAtomicSetterCopyHelperFunction(const ObjCPropertyImplDecl *PID)
This represents '#pragma omp parallel for' directive.
const LangOptions & getLangOpts() const
LValue EmitLValueForFieldInitialization(LValue Base, const FieldDecl *Field)
llvm::Value * EmitARCRetainNonBlock(llvm::Value *value)
void EmitCXXDestructorCall(const CXXDestructorDecl *D, CXXDtorType Type, bool ForVirtualBase, bool Delegating, llvm::Value *This)
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
static bool needsSaving(llvm::Value *value)
Answer whether the given value needs extra work to be saved.
static type restore(CodeGenFunction &CGF, saved_type value)
void EmitAtomicStore(RValue rvalue, LValue lvalue, bool isInit)
void EmitOMPAggregateAssign(llvm::Value *DestAddr, llvm::Value *SrcAddr, QualType OriginalType, const llvm::function_ref< void(llvm::Value *, llvm::Value *)> &CopyGen)
Perform element by element copying of arrays with type OriginalType from SrcAddr to DestAddr using co...
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const RValue &rv)
llvm::Value * EmitCommonNeonBuiltinExpr(unsigned BuiltinID, unsigned LLVMIntrinsic, unsigned AltLLVMIntrinsic, const char *NameHint, unsigned Modifier, const CallExpr *E, SmallVectorImpl< llvm::Value * > &Ops, llvm::Value *Align=nullptr)
static Destroyer destroyARCWeak
LValue EmitCXXUuidofLValue(const CXXUuidofExpr *E)
const CXXBaseSpecifier *const * path_const_iterator
void EmitOMPParallelForSimdDirective(const OMPParallelForSimdDirective &S)
void pushIrregularPartialArrayCleanup(llvm::Value *arrayBegin, llvm::Value *arrayEndPointer, QualType elementType, Destroyer *destroyer)
static saved_type save(CodeGenFunction &CGF, type value)
void EmitOMPCriticalDirective(const OMPCriticalDirective &S)
LValue EmitObjCEncodeExprLValue(const ObjCEncodeExpr *E)
RAII object to set/unset CodeGenFunction::IsSanitizerScope.
LValue EmitObjCSelectorLValue(const ObjCSelectorExpr *E)
uint64_t getProfileCount(const Stmt *S)
Get the profiler's count for the given statement.
llvm::Value * EmitObjCAutoreleasePoolPush()
field_iterator field_begin() const
llvm::Value * GetVTTParameter(GlobalDecl GD, bool ForVirtualBase, bool Delegating)
llvm::Value * EmitBlockCopyAndAutorelease(llvm::Value *Block, QualType Ty)
void EmitLabel(const LabelDecl *D)
llvm::CallInst * EmitTrapCall(llvm::Intrinsic::ID IntrID)
Emit a call to trap or debugtrap and attach function attribute "trap-func-name" if specified...
void EmitVariablyModifiedType(QualType Ty)
LValue EmitComplexAssignmentLValue(const BinaryOperator *E)
Emit an l-value for an assignment (simple or compound) of complex type.
void setCurrentProfileCount(uint64_t Count)
Set the profiler's current count.
void pushFullExprCleanup(CleanupKind kind, As...A)
bool shouldUseFusedARCCalls()
static ConstantEmission forValue(llvm::Constant *C)
bool IsSanitizerScope
True if CodeGen currently emits code implementing sanitizer checks.
llvm::BasicBlock * EmitLandingPad()
Emits a landing pad for the current EH stack.
llvm::Value * ReturnValue
void pushCleanupTuple(CleanupKind Kind, std::tuple< As...> A)
Push a lazily-created cleanup on the stack. Tuple version.
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
RValue EmitCUDAKernelCallExpr(const CUDAKernelCallExpr *E, ReturnValueSlot ReturnValue)
A C++ throw-expression (C++ [except.throw]).
llvm::Value * EmitARMBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void EmitAggregateCopyCtor(llvm::Value *DestPtr, llvm::Value *SrcPtr, QualType DestTy, QualType SrcTy)
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
Defines the clang::Expr interface and subclasses for C++ expressions.
static void destroyBlockInfos(CGBlockInfo *info)
Destroy a chain of block layouts.
void SimplifyForwardingBlocks(llvm::BasicBlock *BB)
void emitImplicitAssignmentOperatorBody(FunctionArgList &Args)
llvm::Value * EmitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E)
void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, llvm::Value **Result=nullptr)
EHScopeStack::stable_iterator PrologueCleanupDepth
llvm::Value * getNormalCleanupDestSlot()
llvm::Value * EmitObjCThrowOperand(const Expr *expr)
~CXXDefaultInitExprScope()
JumpDest getJumpDestForLabel(const LabelDecl *S)
void EmitBoundsCheck(const Expr *E, const Expr *Base, llvm::Value *Index, QualType IndexType, bool Accessed)
Emit a check that Base points into an array object, which we can access at index Index. Accessed should be false if we this expression is used as an lvalue, for instance in "&Arr[Idx]".
llvm::DenseMap< const VarDecl *, FieldDecl * > LambdaCaptureFields
An object to manage conditionally-evaluated expressions.
PeepholeProtection protectFromPeepholes(RValue rvalue)
llvm::BasicBlock * getTerminateHandler()
void EmitCXXForRangeStmt(const CXXForRangeStmt &S, ArrayRef< const Attr * > Attrs=None)
void EmitOMPSimdDirective(const OMPSimdDirective &S)
llvm::Value * EmitCXXNewExpr(const CXXNewExpr *E)
llvm::Value * EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
void emitByrefStructureInit(const AutoVarEmission &emission)
void unbind(CodeGenFunction &CGF)
CGBlockInfo * FirstBlockInfo
FirstBlockInfo - The head of a singly-linked-list of block layouts.
LValue EmitScalarCompoundAssignWithComplex(const CompoundAssignOperator *E, llvm::Value *&Result)
void EmitCallArgs(CallArgList &Args, const T *CallArgTypeInfo, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd, const FunctionDecl *CalleeDecl=nullptr, unsigned ParamsToSkip=0)
EmitCallArgs - Emit call arguments for a function.
void setScopeDepth(EHScopeStack::stable_iterator depth)
void EmitFunctionEpilog(const CGFunctionInfo &FI, bool EmitRetDbgLoc, SourceLocation EndLoc)
This represents '#pragma omp parallel' directive.
CGDebugInfo * getDebugInfo()
LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
LValue EmitLValueForLambdaField(const FieldDecl *Field)
void EmitExprAsInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
std::pair< LValue, llvm::Value * > EmitARCStoreAutoreleasing(const BinaryOperator *e)
void addLabel(const LabelDecl *label)
llvm::Value * EmitObjCExtendObjectLifetime(QualType T, llvm::Value *Ptr)
RValue EmitReferenceBindingToExpr(const Expr *E)
Emits a reference binding to the passed in expression.
llvm::SmallPtrSet< const CXXRecordDecl *, 4 > VisitedVirtualBasesSetTy
The scope used to remap some variables as private in the OpenMP loop body (or other captured region e...
LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E)
llvm::Value * EmitARCRetainAutoreleaseReturnValue(llvm::Value *value)
An RAII object to set (and then clear) a mapping for an OpaqueValueExpr.
void EmitNewArrayInitializer(const CXXNewExpr *E, QualType elementType, llvm::Type *ElementTy, llvm::Value *NewPtr, llvm::Value *NumElements, llvm::Value *AllocSizeWithoutCookie)
llvm::CallInst * EmitRuntimeCall(llvm::Value *callee, const Twine &name="")
llvm::Value * EmitObjCProduceObject(QualType T, llvm::Value *Ptr)
void EmitARCInitWeak(llvm::Value *value, llvm::Value *addr)
void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock *BB, llvm::BasicBlock::iterator InsertPt) const
CGBuilder insert helper. This function is called after an instruction is created using Builder...
void EmitAtomicUpdate(LValue LVal, llvm::AtomicOrdering AO, const llvm::function_ref< RValue(RValue)> &UpdateOp, bool IsVolatile)
void EmitVTablePtrCheck(const CXXRecordDecl *RD, llvm::Value *VTable, CFITypeCheckKind TCK, SourceLocation Loc)
void GenerateCXXGlobalDtorsFunc(llvm::Function *Fn, const std::vector< std::pair< llvm::WeakVH, llvm::Constant * > > &DtorsAndObjects)
llvm::Value * EmitARCAutoreleaseReturnValue(llvm::Value *value)
virtual void setContextValue(llvm::Value *V)
llvm::Value * SEHInfo
Value returned by __exception_info intrinsic.
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
llvm::CallSite EmitCallOrInvoke(llvm::Value *Callee, ArrayRef< llvm::Value * > Args, const Twine &Name="")
void GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, ObjCMethodDecl *MD, bool ctor)
virtual const FieldDecl * lookup(const VarDecl *VD) const
Lookup the captured field decl for a variable.
Defines some OpenMP-specific enums and functions.
This represents '#pragma omp barrier' directive.
CleanupKind getCleanupKind(QualType::DestructionKind kind)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
The this pointer adjustment as well as an optional return adjustment for a thunk. ...
llvm::Value * EmitObjCBoxedExpr(const ObjCBoxedExpr *E)
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
RValue EmitLoadOfExtVectorElementLValue(LValue V)
void EmitAggregateAssign(llvm::Value *DestPtr, llvm::Value *SrcPtr, QualType EltTy)
This represents '#pragma omp critical' directive.
LValue EmitLambdaLValue(const LambdaExpr *E)
void GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn, const VarDecl *D, llvm::GlobalVariable *Addr, bool PerformInit)
Emit the code necessary to initialize the given global variable.
llvm::Value * EmitScalarConversion(llvm::Value *Src, QualType SrcTy, QualType DstTy)
void EmitLambdaDelegatingInvokeBody(const CXXMethodDecl *MD)
RValue EmitAnyExprToTemp(const Expr *E)
ComplexPairTy EmitLoadOfComplex(LValue src, SourceLocation loc)
EmitLoadOfComplex - Load a complex number from the specified l-value.
void EmitARCDestroyStrong(llvm::Value *addr, ARCPreciseLifetime_t precise)
bool EmitOMPLastprivateClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
Emit initial code for lastprivate variables. If some variable is not also firstprivate, then the default initialization is used. Otherwise initialization of this variable is performed by EmitOMPFirstprivateClause method.
RValue EmitAnyExpr(const Expr *E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
void EmitNoreturnRuntimeCallOrInvoke(llvm::Value *callee, ArrayRef< llvm::Value * > args)
Emits a call or invoke to the given noreturn runtime function.
const RValue & getOpaqueRValueMapping(const OpaqueValueExpr *e)
LValue MakeAddrLValue(llvm::Value *V, QualType T, CharUnits Alignment=CharUnits())
void EmitSynthesizedCXXCopyCtor(llvm::Value *Dest, llvm::Value *Src, const Expr *Exp)
llvm::BasicBlock * getStartingBlock() const
Describes an C or C++ initializer list.
A class controlling the emission of a finally block.
llvm::Value * BuildVector(ArrayRef< llvm::Value * > Ops)
llvm::Value * EmitObjCStringLiteral(const ObjCStringLiteral *E)
Emits an instance of NSConstantString representing the object.
static bool hasScalarEvaluationKind(QualType T)
void Destroyer(CodeGenFunction &CGF, llvm::Value *addr, QualType ty)
RValue EmitCall(const CGFunctionInfo &FnInfo, llvm::Value *Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, const Decl *TargetDecl=nullptr, llvm::Instruction **callOrInvoke=nullptr)
llvm::Value * GetVTablePtr(llvm::Value *This, llvm::Type *Ty)
bool IvarTypeWithAggrGCObjects(QualType Ty)
void EmitDoStmt(const DoStmt &S, ArrayRef< const Attr * > Attrs=None)
void ExitSEHTryStmt(const SEHTryStmt &S)
void pushRegularPartialArrayCleanup(llvm::Value *arrayBegin, llvm::Value *arrayEnd, QualType elementType, Destroyer *destroyer)
CGCapturedStmtRAII(CodeGenFunction &CGF, CGCapturedStmtInfo *NewCapturedStmtInfo)
void EmitOMPCancellationPointDirective(const OMPCancellationPointDirective &S)
LexicalScope(CodeGenFunction &CGF, SourceRange Range)
Enter a new cleanup scope.
llvm::Constant * BuildDescriptorBlockDecl(const BlockExpr *, const CGBlockInfo &Info, llvm::StructType *, llvm::Constant *BlockVarLayout)
RAII for correct setting/restoring of CapturedStmtInfo.
llvm::Value * EmitBlockLiteral(const BlockExpr *)
Emit a block literal expression in the current function.
void EmitOMPLastprivateClauseFinal(const OMPExecutableDirective &D, llvm::Value *IsLastIterCond=nullptr)
Emit final copying of lastprivate values to original variables at the end of the worksharing or simd ...
void EmitContinueStmt(const ContinueStmt &S)
void EmitOMPTargetDirective(const OMPTargetDirective &S)
A builtin binary operation expression such as "x + y" or "x <= y".
bool needsEHCleanup(QualType::DestructionKind kind)
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const LValue &lv)
void registerGlobalDtorWithAtExit(const VarDecl &D, llvm::Constant *fn, llvm::Constant *addr)
Register a global destructor using the C atexit runtime function.
llvm::Value * GetAddressOfBaseClass(llvm::Value *Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue, SourceLocation Loc)
void pushDestroy(QualType::DestructionKind dtorKind, llvm::Value *addr, QualType type)
llvm::Value * getObjectAddress(CodeGenFunction &CGF) const
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep)
Creates clause with a list of variables VL and a linear step Step.
void EmitSwitchStmt(const SwitchStmt &S)
std::string getNameAsString() const
This represents '#pragma omp cancellation point' directive.
bool isObviouslyBranchWithoutCleanups(JumpDest Dest) const
llvm::Value * EmitDynamicCast(llvm::Value *V, const CXXDynamicCastExpr *DCE)
llvm::BasicBlock * getInvokeDestImpl()
void incrementProfileCounter(const Stmt *S)
Increment the profiler's counter for the given statement.
LValue EmitCXXConstructLValue(const CXXConstructExpr *E)
void initFullExprCleanup()
llvm::Function * GenerateSEHFinallyFunction(CodeGenFunction &ParentCGF, const SEHFinallyStmt &Finally)
LValue EmitUnaryOpLValue(const UnaryOperator *E)
void EmitStmt(const Stmt *S)
void EmitOMPParallelDirective(const OMPParallelDirective &S)
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
llvm::Value * EmitARCRetainScalarExpr(const Expr *expr)
This represents '#pragma omp teams' directive.
void EmitIgnoredExpr(const Expr *E)
EmitIgnoredExpr - Emit an expression in a context which ignores the result.
void EmitAtomicInit(Expr *E, LValue lvalue)
llvm::Function * EmitCapturedStmt(const CapturedStmt &S, CapturedRegionKind K)
void EmitDeleteCall(const FunctionDecl *DeleteFD, llvm::Value *Ptr, QualType DeleteTy)
Enums/classes describing ABI related information about constructors, destructors and thunks...
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E)
bool requiresCleanups() const
Determine whether this scope requires any cleanups.
Represents binding an expression to a temporary.
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
GlobalDecl CurGD
CurGD - The GlobalDecl for the current function being compiled.
virtual FieldDecl * getThisFieldDecl() const
void EmitDefaultStmt(const DefaultStmt &S)
RValue EmitBuiltinExpr(const FunctionDecl *FD, unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)
static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts=false)
llvm::Value * EmitExtVectorElementLValue(LValue V)
Generates lvalue for partial ext_vector access.
llvm::DebugLoc EmitReturnBlock()
Emit the unified return block, trying to avoid its emission when possible.
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
llvm::Function * generateDestroyHelper(llvm::Constant *addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray, const VarDecl *VD)
void EmitCaseStmtRange(const CaseStmt &S)
uint64_t getCurrentProfileCount()
llvm::Type * BuildByRefType(const VarDecl *var)
Represents an ObjC class declaration.
JumpDest getJumpDestInCurrentScope(StringRef Name=StringRef())
llvm::AllocaInst * EHSelectorSlot
llvm::Value * EmitARCRetainAutoreleasedReturnValue(llvm::Value *value)
llvm::Value * EmitCheckValue(llvm::Value *V)
Convert a value into a format suitable for passing to a runtime sanitizer handler.
void EmitCallArg(CallArgList &args, const Expr *E, QualType ArgType)
EmitCallArg - Emit a single call argument.
Checking the operand of a load. Must be suitably sized and aligned.
void begin(CodeGenFunction &CGF)
llvm::Value * EmitARCRetainAutoreleaseNonBlock(llvm::Value *value)
llvm::Value * EmitSEHExceptionCode()
~LexicalScope()
Exit this cleanup scope, emitting any accumulated cleanups.
Represents the this expression in C++.
LValue EmitLValueForField(LValue Base, const FieldDecl *Field)
void EmitDeclRefExprDbgValue(const DeclRefExpr *E, llvm::Constant *Init)
llvm::CallSite EmitRuntimeCallOrInvoke(llvm::Value *callee, ArrayRef< llvm::Value * > args, const Twine &name="")
Emits a call or invoke instruction to the given runtime function.
LValue EmitExtVectorElementExpr(const ExtVectorElementExpr *E)
RValue EmitObjCMessageExpr(const ObjCMessageExpr *E, ReturnValueSlot Return=ReturnValueSlot())
void GenerateCXXGlobalInitFunc(llvm::Function *Fn, ArrayRef< llvm::Function * > CXXThreadLocals, llvm::GlobalVariable *Guard=nullptr)
void EmitCXXConstructExpr(const CXXConstructExpr *E, AggValueSlot Dest)
void EmitCheck(ArrayRef< std::pair< llvm::Value *, SanitizerMask >> Checked, StringRef CheckName, ArrayRef< llvm::Constant * > StaticArgs, ArrayRef< llvm::Value * > DynamicArgs)
Create a basic block that will call a handler function in a sanitizer runtime with the provided argum...
AutoVarEmission EmitAutoVarAlloca(const VarDecl &var)
std::pair< llvm::Value *, llvm::Value * > ComplexPairTy
llvm::CallInst * EmitNounwindRuntimeCall(llvm::Value *callee, const Twine &name="")
void EmitOMPParallelSectionsDirective(const OMPParallelSectionsDirective &S)
Describes the capture of either a variable, or 'this', or variable-length array type.
llvm::Value * EmitCXXUuidofExpr(const CXXUuidofExpr *E)
RValue EmitAtomicExpr(AtomicExpr *E, llvm::Value *Dest=nullptr)
void emitDestroy(llvm::Value *addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
const CodeGen::CGBlockInfo * BlockInfo
llvm::Function * GenerateBlockFunction(GlobalDecl GD, const CGBlockInfo &Info, const DeclMapTy &ldm, bool IsLambdaConversionToBlock)
This represents '#pragma omp taskgroup' directive.
const TargetCodeGenInfo & getTargetCodeGenInfo()
void PushDestructorCleanup(QualType T, llvm::Value *Addr)
CGBlockInfo - Information to generate a block literal.
unsigned getNumObjects() const
CleanupKind getARCCleanupKind()
llvm::Value * getSizeForLifetimeMarkers() const
static AutoVarEmission invalid()
void EmitDelegateCallArg(CallArgList &args, const VarDecl *param, SourceLocation loc)
VAArgExpr, used for the builtin function __builtin_va_arg.
ID
Defines the set of possible language-specific address spaces.
llvm::Value * ExceptionSlot
unsigned char BoundsChecking
Exposes information about the current target.
virtual StringRef getHelperName() const
Get the name of the capture helper.
void EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)
LValue EmitInitListLValue(const InitListExpr *E)
static TypeEvaluationKind getEvaluationKind(QualType T)
void EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst)
CXXDtorType
C++ destructor types.
llvm::BasicBlock * EHResumeBlock
EHResumeBlock - Unified block containing a call to llvm.eh.resume.
llvm::Value * EmitARCStoreWeak(llvm::Value *value, llvm::Value *addr, bool ignored)
void InitTempAlloca(llvm::AllocaInst *Alloca, llvm::Value *Value)
InitTempAlloca - Provide an initial value for the given alloca.
llvm::Value * EmitARCLoadWeakRetained(llvm::Value *addr)
i8* @objc_loadWeakRetained(i8** addr)
void EmitCapturedLocals(CodeGenFunction &ParentCGF, const Stmt *OutlinedStmt, bool IsFilter)
void enter(CodeGenFunction &CGF, const Stmt *Finally, llvm::Constant *beginCatchFn, llvm::Constant *endCatchFn, llvm::Constant *rethrowFn)
llvm::Value * GenerateCapturedStmtArgument(const CapturedStmt &S)
void EmitAutoVarInit(const AutoVarEmission &emission)
bool CanDevirtualizeMemberFunctionCall(const Expr *Base, const CXXMethodDecl *MD)
Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited...
LValue EmitCXXTypeidLValue(const CXXTypeidExpr *E)
void EmitCaseStmt(const CaseStmt &S)
llvm::Function * GenerateSEHFilterFunction(CodeGenFunction &ParentCGF, const SEHExceptStmt &Except)
RValue EmitCXXMemberOrOperatorCall(const CXXMethodDecl *MD, llvm::Value *Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E)
llvm::Value * GetAddrOfLocalVar(const VarDecl *VD)
GetAddrOfLocalVar - Return the address of a local variable.
void pushCallObjectDeleteCleanup(const FunctionDecl *OperatorDelete, llvm::Value *CompletePtr, QualType ElementType)
void GenerateObjCMethod(const ObjCMethodDecl *OMD)
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, RValue rvalue)
void EmitOMPTeamsDirective(const OMPTeamsDirective &S)
void ForceCleanup()
Force the emission of cleanups now, instead of waiting until this object is destroyed.
static bool isObjCMethodWithTypeParams(const ObjCMethodDecl *method)
Represents a C++ destructor within a class.
llvm::Value * EmitSEHExceptionInfo()
llvm::Constant * GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo)
llvm::Value * emitArrayLength(const ArrayType *arrayType, QualType &baseType, llvm::Value *&addr)
void SetFPAccuracy(llvm::Value *Val, float Accuracy)
AggValueSlot CreateAggTemp(QualType T, const Twine &Name="tmp")
llvm::AllocaInst * NormalCleanupDest
i32s containing the indexes of the cleanup destinations.
void EmitLambdaBlockInvokeBody()
DeclContext * getDeclContext()
void EmitSEHTryStmt(const SEHTryStmt &S)
ASTContext & getContext() const
llvm::Value * EmitToMemory(llvm::Value *Value, QualType Ty)
llvm::Value * getSelectorFromSlot()
static bool needsSaving(type value)
llvm::BasicBlock * getBlock() const
Represents Objective-C's @synchronized statement.
ObjCSelectorExpr used for @selector in Objective-C.
EHScopeStack::stable_iterator getScopeDepth() const
llvm::Value * EmitCompoundStmtWithoutScope(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
void EmitOMPLinearClauseInit(const OMPLoopDirective &D)
Emit initial code for linear variables. Creates private copies and initializes them with the values a...
void generateObjCSetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, llvm::Constant *AtomicHelperFn)
~OMPPrivateScope()
Exit scope - all the mapped variables are restored.
llvm::Value * getExceptionFromSlot()
void EmitAsanPrologueOrEpilogue(bool Prologue)
llvm::Value * EmitARCAutorelease(llvm::Value *value)
stable_iterator stable_begin() const
std::pair< llvm::Type *, unsigned > getByRefValueLLVMField(const ValueDecl *VD) const
llvm::LLVMContext & getLLVMContext()
llvm::BasicBlock * GetIndirectGotoBlock()
llvm::Value * OldCXXThisValue
bool currentFunctionUsesSEHTry() const
void EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Dest)
RValue EmitCXXMemberOrOperatorMemberCallExpr(const CallExpr *CE, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue, bool HasQualifier, NestedNameSpecifier *Qualifier, bool IsArrow, const Expr *Base)
void AllocateBlockDecl(const DeclRefExpr *E)
std::pair< bool, RValue > EmitOMPAtomicSimpleUpdateExpr(LValue X, RValue E, BinaryOperatorKind BO, bool IsXLHSInRHSPart, llvm::AtomicOrdering AO, SourceLocation Loc, const llvm::function_ref< RValue(RValue)> &CommonGen)
Emit atomic update code for constructs: X = X BO E or X = E BO E.
This represents '#pragma omp for' directive.
void EmitConstructorBody(FunctionArgList &Args)
EmitConstructorBody - Emits the body of the current constructor.
void EmitOMPMasterDirective(const OMPMasterDirective &S)
llvm::Function * GenerateCapturedStmtFunction(const CapturedStmt &S)
Creates the outlined function for a CapturedStmt.
LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T)
An expression that sends a message to the given Objective-C object or class.
ComplexPairTy EmitComplexPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
JumpDest(llvm::BasicBlock *Block, EHScopeStack::stable_iterator Depth, unsigned Index)
void ResolveBranchFixups(llvm::BasicBlock *Target)
void EmitForwardingCallToLambda(const CXXMethodDecl *LambdaCallOperator, CallArgList &CallArgs)
void EmitMCountInstrumentation()
EmitMCountInstrumentation - Emit call to .mcount.
void EmitOMPBarrierDirective(const OMPBarrierDirective &S)
void EmitLambdaToBlockPointerBody(FunctionArgList &Args)
llvm::Value * EmitCastToVoidPtr(llvm::Value *value)
Emit a cast to void* in the appropriate address space.
virtual llvm::Value * getContextValue() const
unsigned getDestIndex() const
SmallVector< llvm::Value *, 1 > SEHCodeSlotStack
ConstantEmission tryEmitAsConstant(DeclRefExpr *refExpr)
This represents '#pragma omp cancel' directive.
RunCleanupsScope(CodeGenFunction &CGF)
Enter a new cleanup scope.
RValue EmitLoadOfGlobalRegLValue(LValue LV)
Load of global gamed gegisters are always calls to intrinsics.
void EmitCXXGlobalVarDeclInit(const VarDecl &D, llvm::Constant *DeclPtr, bool PerformInit)
void setBeforeOutermostConditional(llvm::Value *value, llvm::Value *addr)
RValue EmitAtomicLoad(LValue LV, SourceLocation SL, AggValueSlot Slot=AggValueSlot::ignored())
llvm::IRBuilder< PreserveNames, llvm::ConstantFolder, CGBuilderInserterTy > CGBuilderTy
static bool shouldBindAsLValue(const Expr *expr)
void generateThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk)
Generate a thunk for the given method.
llvm::Value * EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E)
bool isCXXThisExprCaptured() const
This represents '#pragma omp flush' directive.
void EmitParmDecl(const VarDecl &D, llvm::Value *Arg, bool ArgIsPointer, unsigned ArgNo)
EmitParmDecl - Emit a ParmVarDecl or an ImplicitParamDecl.
SanitizerScope(CodeGenFunction *CGF)
This represents '#pragma omp parallel for simd' directive.
void EmitDeclStmt(const DeclStmt &S)
llvm::Value * EmitAMDGPUBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void EmitAnyExprToMem(const Expr *E, llvm::Value *Location, Qualifiers Quals, bool IsInitializer)
llvm::BasicBlock * getEHDispatchBlock(EHScopeStack::stable_iterator scope)
llvm::Value * EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void EmitAlignmentAssumption(llvm::Value *PtrValue, unsigned Alignment, llvm::Value *OffsetValue=nullptr)
void enterByrefCleanup(const AutoVarEmission &emission)
void EmitOMPFlushDirective(const OMPFlushDirective &S)
OMPPrivateScope(CodeGenFunction &CGF)
Enter a new OpenMP private scope.
bool HaveInsertPoint() const
llvm::Value * LoadBlockStruct()
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
llvm::GlobalVariable * AddInitializerToStaticVarDecl(const VarDecl &D, llvm::GlobalVariable *GV)
This captures a statement into a function. For example, the following pragma annotated compound state...
LValue EmitVAArgExprLValue(const VAArgExpr *E)
void EmitCXXConstructorCall(const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, llvm::Value *This, const CXXConstructExpr *E)
llvm::Value * EmitCXXTypeidExpr(const CXXTypeidExpr *E)
llvm::AllocaInst * CreateIRTemp(QualType T, const Twine &Name="tmp")
~FieldConstructionScope()
ASTContext & getContext() const
This represents '#pragma omp single' directive.
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
bool LValueIsSuitableForInlineAtomic(LValue Src)
llvm::Value * EmitObjCArrayLiteral(const ObjCArrayLiteral *E)
void EmitARCIntrinsicUse(ArrayRef< llvm::Value * > values)
void EmitOMPForDirective(const OMPForDirective &S)
void EmitARCRelease(llvm::Value *value, ARCPreciseLifetime_t precise)
LValue EmitDeclRefLValue(const DeclRefExpr *E)
void EmitAggregateCopy(llvm::Value *DestPtr, llvm::Value *SrcPtr, QualType EltTy, bool isVolatile=false, CharUnits Alignment=CharUnits::Zero(), bool isAssignment=false)
std::pair< RValue, llvm::Value * > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, llvm::AtomicOrdering Success=llvm::SequentiallyConsistent, llvm::AtomicOrdering Failure=llvm::SequentiallyConsistent, bool IsWeak=false, AggValueSlot Slot=AggValueSlot::ignored())
Represents a C++ temporary.
llvm::Value * EvaluateExprAsBool(const Expr *E)
LValue EmitCheckedLValue(const Expr *E, TypeCheckKind TCK)
Same as EmitLValue but additionally we generate checking code to guard against undefined behavior...
~RunCleanupsScope()
Exit this cleanup scope, emitting any accumulated cleanups.
llvm::Value * EmitFromMemory(llvm::Value *Value, QualType Ty)
llvm::BasicBlock * getUnreachableBlock()
This is a basic class for representing single OpenMP executable directive.
bool IndirectObjCSetterArg(const CGFunctionInfo &FI)
SmallVector< llvm::Value *, 8 > ObjCEHValueStack
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
void EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S)
bool ConstantFoldsToSimpleInteger(const Expr *Cond, bool &Result)
LValue EmitAggExprToLValue(const Expr *E)
void DeactivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
Deactive a cleanup that was created in an active state.
void EmitCallAndReturnForThunk(llvm::Value *Callee, const ThunkInfo *Thunk)
OpenMPDirectiveKind
OpenMP directives.
llvm::Constant * createAtExitStub(const VarDecl &VD, llvm::Constant *Dtor, llvm::Constant *Addr)
llvm::Value * EmitLifetimeStart(uint64_t Size, llvm::Value *Addr)
LValue EmitUnsupportedLValue(const Expr *E, const char *Name)
llvm::Value * EmitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E)
Represents a static or instance method of a struct/union/class.
void EmitARCCopyWeak(llvm::Value *dst, llvm::Value *src)
static type restore(CodeGenFunction &CGF, saved_type value)
llvm::Value * EmitVAListRef(const Expr *E)
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void EmitNullInitialization(llvm::Value *DestPtr, QualType Ty)
This represents '#pragma omp taskwait' directive.
void EmitOMPTaskgroupDirective(const OMPTaskgroupDirective &S)
SanitizerSet SanOpts
Sanitizers enabled for this function.
void pushEHDestroy(QualType::DestructionKind dtorKind, llvm::Value *addr, QualType type)
bool isTrivialInitializer(const Expr *Init)
Determine whether the given initializer is trivial in the sense that it requires no code to be genera...
llvm::Value * EmitNeonCall(llvm::Function *F, SmallVectorImpl< llvm::Value * > &O, const char *name, unsigned shift=0, bool rightshift=false)
const CodeGenOptions & getCodeGenOpts() const
LValue getReferenceLValue(CodeGenFunction &CGF, Expr *refExpr) const
bool hasVolatileMember() const
TypeCheckKind
Situations in which we might emit a check for the suitability of a pointer or glvalue.
void pushCleanupAfterFullExpr(CleanupKind Kind, As...A)
Queue a cleanup to be pushed after finishing the current full-expression.
void EmitOMPSingleDirective(const OMPSingleDirective &S)
static LValue MakeAddr(llvm::Value *address, QualType type, CharUnits alignment, ASTContext &Context, llvm::MDNode *TBAAInfo=nullptr)
void StartFunction(GlobalDecl GD, QualType RetTy, llvm::Function *Fn, const CGFunctionInfo &FnInfo, const FunctionArgList &Args, SourceLocation Loc=SourceLocation(), SourceLocation StartLoc=SourceLocation())
Emit code for the start of a function.
const LangOptions & getLangOpts() const
llvm::BasicBlock * getEHResumeBlock(bool isCleanup)
llvm::AllocaInst * CreateMemTemp(QualType T, const Twine &Name="tmp")
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
This represents '#pragma omp target' directive.
SourceLocation getBegin() const
void EmitOMPForSimdDirective(const OMPForSimdDirective &S)
LValue EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E)
void EmitOMPAtomicDirective(const OMPAtomicDirective &S)
JumpDest getJumpDestInCurrentScope(llvm::BasicBlock *Target)
void exit(CodeGenFunction &CGF)
void EmitOMPSectionDirective(const OMPSectionDirective &S)
void EmitOMPSectionsDirective(const OMPSectionsDirective &S)
RValue EmitCXXMemberPointerCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue)
llvm::Function * GenerateCapturedStmtFunctionEpilog(const CapturedStmt &S)
This represents '#pragma omp ordered' directive.
static llvm::Value * restore(CodeGenFunction &CGF, saved_type value)
void EmitForStmt(const ForStmt &S, ArrayRef< const Attr * > Attrs=None)
RValue EmitCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue=ReturnValueSlot())
LValue EmitReadRegister(const VarDecl *VD)
llvm::Value * vectorWrapScalar8(llvm::Value *Op)
RValue EmitBuiltinNewDeleteCall(const FunctionProtoType *Type, const Expr *Arg, bool IsDelete)
llvm::Value * EmitARCRetain(QualType type, llvm::Value *value)
const CGFunctionInfo * CurFnInfo
void EmitStartEHSpec(const Decl *D)
EmitStartEHSpec - Emit the start of the exception spec.
CapturedRegionKind getKind() const
static ConstantEmission forReference(llvm::Constant *C)
void enterFullExpression(const ExprWithCleanups *E)
void EmitDecl(const Decl &D)
llvm::Value * getEHSelectorSlot()
llvm::Value * recoverAddrOfEscapedLocal(CodeGenFunction &ParentCGF, llvm::Value *ParentVar, llvm::Value *ParentFP)
static Destroyer destroyARCStrongImprecise
void FinishFunction(SourceLocation EndLoc=SourceLocation())
CXXCtorType
C++ constructor types.
void EmitARCDestroyWeak(llvm::Value *addr)
void EmitObjCMRRAutoreleasePoolPop(llvm::Value *Ptr)
RValue convertTempToRValue(llvm::Value *addr, QualType type, SourceLocation Loc)
JumpDest getOMPCancelDestination(OpenMPDirectiveKind Kind)
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
llvm::Value * EmitFieldAnnotations(const FieldDecl *D, llvm::Value *V)
void EmitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt &S)
llvm::Value * EmitNeonRShiftImm(llvm::Value *Vec, llvm::Value *Amt, llvm::Type *Ty, bool usgn, const char *name)
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition. The opaque value will...
void EmitOMPTaskyieldDirective(const OMPTaskyieldDirective &S)
void EmitVTablePtrCheckForCast(QualType T, llvm::Value *Derived, bool MayBeNull, CFITypeCheckKind TCK, SourceLocation Loc)
Derived is the presumed address of an object of type T after a cast. If T is a polymorphic class type...
LValue InitCapturedStruct(const CapturedStmt &S)
[C99 6.4.2.2] - A predefined identifier such as func.
RValue EmitUnsupportedRValue(const Expr *E, const char *Name)
static bool shouldBindAsLValue(const Expr *expr)
Represents a delete expression for memory deallocation and destructor calls, e.g. "delete[] pArray"...
void GenerateObjCGetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
GenerateObjCGetter - Synthesize an Objective-C property getter function.
llvm::Value * GetAddressOfDirectBaseInCompleteClass(llvm::Value *Value, const CXXRecordDecl *Derived, const CXXRecordDecl *Base, bool BaseIsVirtual)
void EmitObjCAutoreleasePoolPop(llvm::Value *Ptr)
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
virtual ~CGCapturedStmtInfo()
static AggValueSlot ignored()
CodeGenFunction::ComplexPairTy ComplexPairTy
void EmitOMPParallelForDirective(const OMPParallelForDirective &S)
This represents '#pragma omp section' directive.
llvm::Value * EmitAnnotationCall(llvm::Value *AnnotationFn, llvm::Value *AnnotatedVal, StringRef AnnotationStr, SourceLocation Location)
Emit an annotation call (intrinsic or builtin).
void EmitOMPPrivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
LValue EmitCallExprLValue(const CallExpr *E)
LValue EmitPseudoObjectLValue(const PseudoObjectExpr *e)
This represents '#pragma omp simd' directive.
void EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor, const FunctionArgList &Args)
void emitArrayDestroy(llvm::Value *begin, llvm::Value *end, QualType type, Destroyer *destroyer, bool checkZeroLength, bool useEHCleanup)
StmtExprEvaluation(CodeGenFunction &CGF)
QualType TypeOfSelfObject()
TypeOfSelfObject - Return type of object that this self represents.
Checking the destination of a store. Must be suitably sized and aligned.
bool EmitOMPFirstprivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
void EmitOMPCancelDirective(const OMPCancelDirective &S)
llvm::SmallVector< char, 256 > LifetimeExtendedCleanupStack
llvm::Constant * GenerateObjCAtomicGetterCopyHelperFunction(const ObjCPropertyImplDecl *PID)
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
bool isSEHTryScope() const
Returns true inside SEH __try blocks.
This represents '#pragma omp atomic' directive.
void EmitObjCAtThrowStmt(const ObjCAtThrowStmt &S)
void EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr, bool Volatile, unsigned Alignment, QualType Ty, llvm::MDNode *TBAAInfo=nullptr, bool isInit=false, QualType TBAABaseTy=QualType(), uint64_t TBAAOffset=0)
void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, llvm::Value *V, QualType Type, CharUnits Alignment=CharUnits::Zero(), bool SkipNullCheck=false)
Emit a check that V is the address of storage of the appropriate size and alignment for an object of ...
void EmitAggExpr(const Expr *E, AggValueSlot AS)
JumpDest ReturnBlock
ReturnBlock - Unified return block.
static bool hasAggregateEvaluationKind(QualType T)
llvm::Value * EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx)
llvm::Value * getAllocatedAddress() const
void EmitAutoVarCleanups(const AutoVarEmission &emission)
llvm::Value * EmitComplexToScalarConversion(ComplexPairTy Src, QualType SrcTy, QualType DstTy)
API for captured statement code generation.
static saved_type save(CodeGenFunction &CGF, type value)
void EmitSynthesizedCXXCopyCtorCall(const CXXConstructorDecl *D, llvm::Value *This, llvm::Value *Src, const CXXConstructExpr *E)
static bool isObjCMethodWithTypeParams(const T *)
llvm::Type * ConvertType(const TypeDecl *T)
const LValue & getOpaqueLValueMapping(const OpaqueValueExpr *e)
FieldConstructionScope(CodeGenFunction &CGF, llvm::Value *This)
void EmitBlockWithFallThrough(llvm::BasicBlock *BB, const Stmt *S)
llvm::Value * vectorWrapScalar16(llvm::Value *Op)
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Represents Objective-C's collection statement.
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit)
EmitStoreOfComplex - Store a complex number into the specified l-value.
RValue GetUndefRValue(QualType Ty)
GetUndefRValue - Get an appropriate 'undef' rvalue for the given type.
Implements C++ ABI-specific code generation functions.
LValue EmitArraySubscriptExpr(const ArraySubscriptExpr *E, bool Accessed=false)
llvm::Value * BuildBlockByrefAddress(llvm::Value *BaseAddr, const VarDecl *V)
A stack of loop information corresponding to loop nesting levels. This stack can be used to prepare a...
void EmitAsmStmt(const AsmStmt &S)
llvm::Value * EmitNeonShiftVector(llvm::Value *V, llvm::Type *Ty, bool negateForRightShift)
Represents a call to a CUDA kernel function.
RValue EmitRValueForField(LValue LV, const FieldDecl *FD, SourceLocation Loc)
const TargetInfo & Target
void EmitLambdaStaticInvokeFunction(const CXXMethodDecl *MD)
llvm::AssertingVH< llvm::Instruction > AllocaInsertPt
bool isFunctionType() const
LValue EmitLValueForIvar(QualType ObjectTy, llvm::Value *Base, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers)
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
void EmitScalarInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
llvm::Value * EmitIvarOffset(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)
llvm::Value * EmitARCRetainAutorelease(QualType type, llvm::Value *value)
LValue EmitCastLValue(const CastExpr *E)
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
FieldDecl * LambdaThisCaptureField
void EmitCXXTemporary(const CXXTemporary *Temporary, QualType TempType, llvm::Value *Ptr)
Emits all the code to cause the given temporary to be cleaned up.
llvm::Value * LoadCXXVTT()
ARCPreciseLifetime_t
Does an ARC strong l-value have precise lifetime?
ComplexPairTy EmitComplexExpr(const Expr *E, bool IgnoreReal=false, bool IgnoreImag=false)
RValue EmitCXXStructorCall(const CXXMethodDecl *MD, llvm::Value *Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E, StructorType Type)
ObjCIvarRefExpr - A reference to an ObjC instance variable.
void EmitFunctionBody(FunctionArgList &Args, const Stmt *Body)
void StartThunk(llvm::Function *Fn, GlobalDecl GD, const CGFunctionInfo &FnInfo)
LValue EmitConditionalOperatorLValue(const AbstractConditionalOperator *E)
void EmitStopPoint(const Stmt *S)
EmitStopPoint - Emit a debug stoppoint if we are emitting debug info.
void InitializeVTablePointer(BaseSubobject Base, const CXXRecordDecl *NearestVBase, CharUnits OffsetFromNearestVBase, const CXXRecordDecl *VTableClass)
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const Expr *e)
unsigned NextCleanupDestIndex
llvm::DenseMap< const VarDecl *, llvm::Value * > NRVOFlags
A mapping from NRVO variables to the flags used to indicate when the NRVO has been applied to this va...
void EmitCXXAggrConstructorCall(const CXXConstructorDecl *D, const ConstantArrayType *ArrayTy, llvm::Value *ArrayPtr, const CXXConstructExpr *E, bool ZeroInitialization=false)
void unprotectFromPeepholes(PeepholeProtection protection)
void EmitOMPReductionClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
Emit initial code for reduction variables. Creates reduction copies and initializes them with the val...
llvm::Value * BuildAppleKextVirtualCall(const CXXMethodDecl *MD, NestedNameSpecifier *Qual, llvm::Type *Ty)
void ErrorUnsupported(const Stmt *S, const char *Type)
Represents a C++ struct/union/class.
void EmitIfStmt(const IfStmt &S)
llvm::Value * EmitObjCCollectionLiteral(const Expr *E, const ObjCMethodDecl *MethodWithObjects)
void EmitBranch(llvm::BasicBlock *Block)
llvm::PointerIntPair< llvm::Value *, 1, bool > saved_type
llvm::BasicBlock * getInvokeDest()
void EmitReturnStmt(const ReturnStmt &S)
llvm::Function * LookupNeonLLVMIntrinsic(unsigned IntrinsicID, unsigned Modifier, llvm::Type *ArgTy, const CallExpr *E)
llvm::BasicBlock * getTerminateLandingPad()
getTerminateLandingPad - Return a landing pad that just calls terminate.
llvm::Type * ConvertType(QualType T)
void EmitFunctionProlog(const CGFunctionInfo &FI, llvm::Function *Fn, const FunctionArgList &Args)
static Destroyer destroyCXXObject
void PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize)
Takes the old cleanup stack size and emits the cleanup blocks that have been added.
void EmitCXXDeleteExpr(const CXXDeleteExpr *E)
LValue EmitLValue(const Expr *E)
void EmitTrapCheck(llvm::Value *Checked)
Create a basic block that will call the trap intrinsic, and emit a conditional branch to it...
void EmitLabelStmt(const LabelStmt &S)
unsigned kind
All of the diagnostics that can be emitted by the frontend.
Represents Objective-C's @try ... @catch ... @finally statement.
llvm::Value * EmitSEHAbnormalTermination()
LValue EmitCompoundLiteralLValue(const CompoundLiteralExpr *E)
bool AutoreleaseResult
In ARC, whether we should autorelease the return value.
RValue EmitLoadOfLValue(LValue V, SourceLocation Loc)
llvm::Value * EmitARCRetainBlock(llvm::Value *value, bool mandatory)
LValue EmitPredefinedLValue(const PredefinedExpr *E)
llvm::Value * EmitARCStoreStrongCall(llvm::Value *addr, llvm::Value *value, bool resultIgnored)
std::pair< llvm::Value *, QualType > getVLASize(const VariableArrayType *vla)
void generateObjCGetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, const ObjCMethodDecl *GetterMothodDecl, llvm::Constant *AtomicHelperFn)
Defines the clang::TargetInfo interface.
void ForceCleanup()
Force the emission of cleanups now, instead of waiting until this object is destroyed.
bool EmitOMPCopyinClause(const OMPExecutableDirective &D)
Emit code for copyin clause in D directive. The next code is generated at the start of outlined funct...
void StartObjCMethod(const ObjCMethodDecl *MD, const ObjCContainerDecl *CD)
llvm::MDNode * getTBAAInfo(QualType QTy)
void StartBlock(const char *N)
LValue EmitCompoundAssignmentLValue(const CompoundAssignOperator *E)
void EnterSEHTryStmt(const SEHTryStmt &S)
void startOutlinedSEHHelper(CodeGenFunction &ParentCGF, bool IsFilter, const Stmt *OutlinedStmt)
CGCapturedStmtInfo * CapturedStmtInfo
bool useLifetimeMarkers() const
RValue EmitLoadOfBitfieldLValue(LValue LV)
void pushStackRestore(CleanupKind kind, llvm::Value *SPMem)
void EmitObjCAutoreleasePoolCleanup(llvm::Value *Ptr)
This represents '#pragma omp sections' directive.
LValue EmitMemberExpr(const MemberExpr *E)
bool hasVolatileMember(QualType T)
stable_iterator getInnermostNormalCleanup() const
llvm::Value * EmitVAArg(llvm::Value *VAListAddr, QualType Ty)
void EmitOMPInnerLoop(const Stmt &S, bool RequiresCleanup, const Expr *LoopCond, const Expr *IncExpr, const llvm::function_ref< void(CodeGenFunction &)> &BodyGen, const llvm::function_ref< void(CodeGenFunction &)> &PostIncGen)
Emit inner loop of the worksharing/simd construct.
A reference to a declared variable, function, enum, etc. [C99 6.5.1p2].
ConditionalEvaluation(CodeGenFunction &CGF)
RValue EmitBlockCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue)
void EmitDestructorBody(FunctionArgList &Args)
EmitDestructorBody - Emits the body of the current destructor.
bool EmitSimpleStmt(const Stmt *S)
void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
llvm::Value * EmitLoadOfScalar(llvm::Value *Addr, bool Volatile, unsigned Alignment, QualType Ty, SourceLocation Loc, llvm::MDNode *TBAAInfo=nullptr, QualType TBAABaseTy=QualType(), uint64_t TBAAOffset=0)
void EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr)
CapturedRegionKind
The different kinds of captured statement.
void EmitBranchThroughCleanup(JumpDest Dest)
void EmitEndEHSpec(const Decl *D)
EmitEndEHSpec - Emit the end of the exception spec.
static AggValueSlot forAddr(llvm::Value *addr, CharUnits align, Qualifiers quals, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, IsZeroed_t isZeroed=IsNotZeroed)
llvm::Constant * EmitCheckSourceLocation(SourceLocation Loc)
Emit a description of a source location in a format suitable for passing to a runtime sanitizer handl...
llvm::Value * GetAddressOfDerivedClass(llvm::Value *Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue)
void AllocateBlockCXXThisPointer(const CXXThisExpr *E)
llvm::Value * LoadObjCSelf()
CodeGenTypes & getTypes() const
void pushLifetimeExtendedDestroy(CleanupKind kind, llvm::Value *addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
A trivial tuple used to represent a source range.
AggValueSlot CreateInAllocaTmp(QualType T, const Twine &Name="inalloca")
void EmitObjCAtTryStmt(const ObjCAtTryStmt &S)
llvm::BlockAddress * GetAddrOfLabel(const LabelDecl *L)
void EmitWhileStmt(const WhileStmt &S, ArrayRef< const Attr * > Attrs=None)
This represents '#pragma omp taskyield' directive.
void EmitVarAnnotations(const VarDecl *D, llvm::Value *V)
Emit local annotations for the local variable V, declared by D.
llvm::Value * EmitObjCConsumeObject(QualType T, llvm::Value *Ptr)
This represents '#pragma omp parallel sections' directive.
void EmitBlockAfterUses(llvm::BasicBlock *BB)
void EmitBreakStmt(const BreakStmt &S)
RValue EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue)
void EmitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt &S)
static bool containsBreak(const Stmt *S)
bool requiresLandingPad() const
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, LValue lvalue)
void PopCleanupBlock(bool FallThroughIsBranchThrough=false)
Represents Objective-C's @autoreleasepool Statement.
LValue EmitStringLiteralLValue(const StringLiteral *E)
void EmitOMPTaskDirective(const OMPTaskDirective &S)
void EmitCondBrHints(llvm::LLVMContext &Context, llvm::BranchInst *CondBr, ArrayRef< const Attr * > Attrs)
void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint=true)
llvm::Value * EmitTargetBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void BuildBlockRelease(llvm::Value *DeclPtr, BlockFieldFlags flags)
llvm::SmallVector< const JumpDest *, 2 > SEHTryEpilogueStack
llvm::Value * EmitSystemZBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
bool Privatize()
Privatizes local variables previously registered as private. Registration is separate from the actual...
void EmitMustTailThunk(const CXXMethodDecl *MD, llvm::Value *AdjustedThisPtr, llvm::Value *Callee)
Emit a musttail call for a thunk with a potentially adjusted this pointer.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
llvm::Value * EmitObjCSelectorExpr(const ObjCSelectorExpr *E)
Emit a selector.
llvm::Value * BuildAppleKextVirtualDestructorCall(const CXXDestructorDecl *DD, CXXDtorType Type, const CXXRecordDecl *RD)
llvm::Value * EmitObjCProtocolExpr(const ObjCProtocolExpr *E)
llvm::Constant * getValue() const
static unsigned getAccessedFieldNo(unsigned Idx, const llvm::Constant *Elts)