14 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
15 #define LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
35 #include "llvm/ADT/ArrayRef.h"
36 #include "llvm/ADT/DenseMap.h"
37 #include "llvm/ADT/SmallVector.h"
38 #include "llvm/IR/ValueHandle.h"
39 #include "llvm/Support/Debug.h"
40 #include "llvm/Transforms/Utils/SanitizerStats.h"
56 class CXXDestructorDecl;
57 class CXXForRangeStmt;
61 class EnumConstantDecl;
63 class FunctionProtoType;
65 class ObjCContainerDecl;
66 class ObjCInterfaceDecl;
69 class ObjCImplementationDecl;
70 class ObjCPropertyImplDecl;
73 class ObjCForCollectionStmt;
75 class ObjCAtThrowStmt;
76 class ObjCAtSynchronizedStmt;
77 class ObjCAutoreleasePoolStmt;
86 class BlockByrefHelpers;
89 class BlockFieldFlags;
90 class RegionCodeGenTy;
91 class TargetCodeGenInfo;
106 #define LIST_SANITIZER_CHECKS \
107 SANITIZER_CHECK(AddOverflow, add_overflow, 0) \
108 SANITIZER_CHECK(BuiltinUnreachable, builtin_unreachable, 0) \
109 SANITIZER_CHECK(CFICheckFail, cfi_check_fail, 0) \
110 SANITIZER_CHECK(DivremOverflow, divrem_overflow, 0) \
111 SANITIZER_CHECK(DynamicTypeCacheMiss, dynamic_type_cache_miss, 0) \
112 SANITIZER_CHECK(FloatCastOverflow, float_cast_overflow, 0) \
113 SANITIZER_CHECK(FunctionTypeMismatch, function_type_mismatch, 0) \
114 SANITIZER_CHECK(LoadInvalidValue, load_invalid_value, 0) \
115 SANITIZER_CHECK(MissingReturn, missing_return, 0) \
116 SANITIZER_CHECK(MulOverflow, mul_overflow, 0) \
117 SANITIZER_CHECK(NegateOverflow, negate_overflow, 0) \
118 SANITIZER_CHECK(NullabilityArg, nullability_arg, 0) \
119 SANITIZER_CHECK(NullabilityReturn, nullability_return, 1) \
120 SANITIZER_CHECK(NonnullArg, nonnull_arg, 0) \
121 SANITIZER_CHECK(NonnullReturn, nonnull_return, 1) \
122 SANITIZER_CHECK(OutOfBounds, out_of_bounds, 0) \
123 SANITIZER_CHECK(PointerOverflow, pointer_overflow, 0) \
124 SANITIZER_CHECK(ShiftOutOfBounds, shift_out_of_bounds, 0) \
125 SANITIZER_CHECK(SubOverflow, sub_overflow, 0) \
126 SANITIZER_CHECK(TypeMismatch, type_mismatch, 1) \
127 SANITIZER_CHECK(VLABoundNotPositive, vla_bound_not_positive, 0)
130 #define SANITIZER_CHECK(Enum, Name, Version) Enum,
132 #undef SANITIZER_CHECK
146 JumpDest() : Block(nullptr), ScopeDepth(), Index(0) {}
150 : Block(Block), ScopeDepth(Depth), Index(Index) {}
152 bool isValid()
const {
return Block !=
nullptr; }
153 llvm::BasicBlock *
getBlock()
const {
return Block; }
163 llvm::BasicBlock *Block;
184 const unsigned,
const bool)>
188 typedef llvm::function_ref<std::pair<LValue, LValue>(
193 typedef llvm::function_ref<std::pair<llvm::Value *, llvm::Value *>(
201 llvm::BasicBlock *BB,
202 llvm::BasicBlock::iterator InsertPt)
const;
217 std::unique_ptr<CGCoroData>
Data;
241 return !LabelMap.empty();
252 :
Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) {}
255 :
Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) {
261 I !=
E; ++
I, ++Field) {
262 if (
I->capturesThis())
263 CXXThisFieldDecl = *Field;
264 else if (
I->capturesVariable())
265 CaptureFields[
I->getCapturedVar()] = *Field;
266 else if (
I->capturesVariableByCopy())
267 CaptureFields[
I->getCapturedVar()] = *Field;
281 return CaptureFields.lookup(VD);
305 llvm::SmallDenseMap<const VarDecl *, FieldDecl *> CaptureFields;
333 const Decl *CalleeDecl;
340 return dyn_cast_or_null<FunctionDecl>(CalleeDecl);
344 if (
const auto *FD = dyn_cast<FunctionDecl>(CalleeDecl))
345 return FD->getNumParams();
346 return cast<ObjCMethodDecl>(CalleeDecl)->param_size();
349 if (
const auto *FD = dyn_cast<FunctionDecl>(CalleeDecl))
350 return FD->getParamDecl(I);
351 return *(cast<ObjCMethodDecl>(CalleeDecl)->param_begin() +
I);
394 llvm::DenseMap<const VarDecl *, llvm::Value *>
NRVOFlags;
408 : Addr(addr.getPointer()), Size(size) {}
474 llvm::Constant *BeginCatchFn;
478 llvm::AllocaInst *ForEHVar;
482 llvm::AllocaInst *SavedExnVar;
486 llvm::Constant *beginCatchFn, llvm::Constant *endCatchFn,
487 llvm::Constant *rethrowFn);
502 template <
class T,
class... As>
510 typedef std::tuple<typename DominatingValue<As>::saved_type...> SavedTuple;
520 template <
class T,
class... As>
530 static_assert(
sizeof(Header) %
alignof(T) == 0,
531 "Cleanup will be allocated on misaligned address");
534 new (Buffer +
sizeof(Header)) T(A...);
565 llvm::Instruction *DominatingIP);
575 llvm::Instruction *DominatingIP);
581 size_t LifetimeExtendedCleanupStackSize;
582 bool OldDidCallStackSave;
599 LifetimeExtendedCleanupStackSize =
601 OldDidCallStackSave = CGF.DidCallStackSave;
602 CGF.DidCallStackSave =
false;
622 void ForceCleanup(std::initializer_list<llvm::Value**> ValuesToReload = {}) {
624 CGF.DidCallStackSave = OldDidCallStackSave;
643 CGF.CurLexicalScope =
this;
650 Labels.push_back(label);
670 CGF.CurLexicalScope = ParentScope;
678 return !Labels.empty();
684 typedef llvm::DenseMap<const Decl *, Address>
DeclMapTy;
690 DeclMapTy SavedLocals;
691 DeclMapTy SavedPrivates;
708 llvm::function_ref<
Address()> PrivateGen) {
712 if (SavedLocals.count(LocalVD))
return false;
715 auto it =
CGF.LocalDeclMap.find(LocalVD);
716 if (it !=
CGF.LocalDeclMap.end()) {
717 SavedLocals.insert({LocalVD, it->second});
730 SavedPrivates.insert({LocalVD, Addr});
744 copyInto(SavedPrivates,
CGF.LocalDeclMap);
745 SavedPrivates.clear();
746 return !SavedLocals.empty();
751 copyInto(SavedLocals,
CGF.LocalDeclMap);
769 static void copyInto(
const DeclMapTy &src, DeclMapTy &dest) {
770 for (
auto &pair : src) {
771 if (!pair.second.isValid()) {
772 dest.erase(pair.first);
776 auto it = dest.find(pair.first);
777 if (it != dest.end()) {
778 it->second = pair.second;
790 std::initializer_list<llvm::Value **> ValuesToReload = {});
797 size_t OldLifetimeExtendedStackSize,
798 std::initializer_list<llvm::Value **> ValuesToReload = {});
839 llvm::BasicBlock *StartBB;
843 : StartBB(CGF.
Builder.GetInsertBlock()) {}
846 assert(CGF.OutermostConditional !=
this);
847 if (!CGF.OutermostConditional)
848 CGF.OutermostConditional =
this;
852 assert(CGF.OutermostConditional !=
nullptr);
853 if (CGF.OutermostConditional ==
this)
854 CGF.OutermostConditional =
nullptr;
871 auto store =
new llvm::StoreInst(value, addr.
getPointer(), &block->back());
887 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
888 CGF.OutermostConditional =
nullptr;
892 CGF.OutermostConditional = SavedOutermostConditional;
901 llvm::Instruction *Inst;
921 : OpaqueValue(ov), BoundLValue(boundLValue) {}
948 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
956 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
968 bool isValid()
const {
return OpaqueValue !=
nullptr; }
969 void clear() { OpaqueValue =
nullptr; }
972 assert(OpaqueValue &&
"no data to unbind!");
975 CGF.OpaqueLValues.erase(OpaqueValue);
977 CGF.OpaqueRValues.erase(OpaqueValue);
1000 if (isa<ConditionalOperator>(op))
1014 assert(OV->
getSourceExpr() &&
"wrong form of OpaqueValueMapping used "
1015 "for OVE with no source expression");
1044 bool DisableDebugInfo;
1048 bool DidCallStackSave;
1054 llvm::IndirectBrInst *IndirectBranch;
1058 DeclMapTy LocalDeclMap;
1063 llvm::SmallDenseMap<const ParmVarDecl *, const ImplicitParamDecl *, 2>
1068 llvm::DenseMap<llvm::AllocaInst *, int> EscapedLocals;
1071 llvm::DenseMap<const LabelDecl*, JumpDest> LabelMap;
1075 struct BreakContinue {
1076 BreakContinue(JumpDest Break, JumpDest Continue)
1077 : BreakBlock(Break), ContinueBlock(Continue) {}
1079 JumpDest BreakBlock;
1080 JumpDest ContinueBlock;
1082 SmallVector<BreakContinue, 8> BreakContinueStack;
1085 class OpenMPCancelExitStack {
1089 CancelExit() =
default;
1092 : Kind(Kind), ExitBlock(ExitBlock), ContBlock(ContBlock) {}
1096 bool HasBeenEmitted =
false;
1101 SmallVector<CancelExit, 8>
Stack;
1104 OpenMPCancelExitStack() :
Stack(1) {}
1105 ~OpenMPCancelExitStack() =
default;
1107 JumpDest getExitBlock()
const {
return Stack.back().ExitBlock; }
1111 const llvm::function_ref<
void(CodeGenFunction &)> &CodeGen) {
1112 if (
Stack.back().Kind == Kind && getExitBlock().isValid()) {
1113 assert(CGF.getOMPCancelDestination(Kind).isValid());
1114 assert(CGF.HaveInsertPoint());
1115 assert(!
Stack.back().HasBeenEmitted);
1116 auto IP = CGF.Builder.saveAndClearIP();
1117 CGF.EmitBlock(
Stack.back().ExitBlock.getBlock());
1119 CGF.EmitBranchThroughCleanup(
Stack.back().ContBlock);
1120 CGF.Builder.restoreIP(IP);
1121 Stack.back().HasBeenEmitted =
true;
1131 HasCancel ? CGF.getJumpDestInCurrentScope(
"cancel.exit")
1133 HasCancel ? CGF.getJumpDestInCurrentScope(
"cancel.cont")
1138 void exit(CodeGenFunction &CGF) {
1139 if (getExitBlock().isValid()) {
1140 assert(CGF.getOMPCancelDestination(
Stack.back().Kind).isValid());
1141 bool HaveIP = CGF.HaveInsertPoint();
1142 if (!
Stack.back().HasBeenEmitted) {
1144 CGF.EmitBranchThroughCleanup(
Stack.back().ContBlock);
1145 CGF.EmitBlock(
Stack.back().ExitBlock.getBlock());
1146 CGF.EmitBranchThroughCleanup(
Stack.back().ContBlock);
1148 CGF.EmitBlock(
Stack.back().ContBlock.getBlock());
1150 CGF.Builder.CreateUnreachable();
1151 CGF.Builder.ClearInsertionPoint();
1157 OpenMPCancelExitStack OMPCancelStack;
1160 class OMPCancelStackRAII {
1161 CodeGenFunction &CGF;
1167 CGF.OMPCancelStack.enter(CGF, Kind, HasCancel);
1169 ~OMPCancelStackRAII() { CGF.OMPCancelStack.exit(CGF); }
1175 llvm::MDNode *createProfileWeights(uint64_t TrueCount, uint64_t FalseCount);
1176 llvm::MDNode *createProfileWeights(ArrayRef<uint64_t> Weights);
1177 llvm::MDNode *createProfileWeightsForLoop(
const Stmt *Cond,
1178 uint64_t LoopCount);
1185 PGO.emitCounterIncrement(
Builder, S, StepV);
1186 PGO.setCurrentStmt(S);
1192 if (!Count.hasValue())
1199 PGO.setCurrentRegionCount(Count);
1205 return PGO.getCurrentRegionCount();
1212 llvm::SwitchInst *SwitchInsn;
1218 llvm::BasicBlock *CaseRangeBlock;
1222 llvm::DenseMap<const OpaqueValueExpr *, LValue> OpaqueLValues;
1223 llvm::DenseMap<const OpaqueValueExpr *, RValue> OpaqueRValues;
1231 llvm::DenseMap<const Expr*, llvm::Value*> VLASizeMap;
1235 llvm::BasicBlock *UnreachableBlock;
1238 unsigned NumReturnExprs;
1241 unsigned NumSimpleReturnExprs;
1253 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1254 CGF.CXXDefaultInitExprThis = This;
1257 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1262 Address OldCXXDefaultInitExprThis;
1272 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.
getPointer();
1273 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.
getAlignment();
1291 : CGF(CGF), OldArrayInitIndex(CGF.ArrayInitIndex) {
1292 CGF.ArrayInitIndex = Index;
1295 CGF.ArrayInitIndex = OldArrayInitIndex;
1308 OldCXXABIThisDecl(CGF.CXXABIThisDecl),
1309 OldCXXABIThisValue(CGF.CXXABIThisValue),
1310 OldCXXThisValue(CGF.CXXThisValue),
1311 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),
1312 OldCXXThisAlignment(CGF.CXXThisAlignment),
1314 OldCXXInheritedCtorInitExprArgs(
1315 std::move(CGF.CXXInheritedCtorInitExprArgs)) {
1318 cast<CXXConstructorDecl>(GD.
getDecl());
1319 CGF.CXXABIThisDecl =
nullptr;
1320 CGF.CXXABIThisValue =
nullptr;
1321 CGF.CXXThisValue =
nullptr;
1326 CGF.CXXInheritedCtorInitExprArgs.clear();
1329 CGF.CurGD = OldCurGD;
1330 CGF.CurFuncDecl = OldCurFuncDecl;
1331 CGF.CurCodeDecl = OldCurCodeDecl;
1332 CGF.CXXABIThisDecl = OldCXXABIThisDecl;
1333 CGF.CXXABIThisValue = OldCXXABIThisValue;
1334 CGF.CXXThisValue = OldCXXThisValue;
1335 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;
1336 CGF.CXXThisAlignment = OldCXXThisAlignment;
1337 CGF.ReturnValue = OldReturnValue;
1338 CGF.FnRetTy = OldFnRetTy;
1339 CGF.CXXInheritedCtorInitExprArgs =
1340 std::move(OldCXXInheritedCtorInitExprArgs);
1346 const Decl *OldCurFuncDecl;
1347 const Decl *OldCurCodeDecl;
1387 ConditionalEvaluation *OutermostConditional;
1390 LexicalScope *CurLexicalScope;
1398 llvm::DenseMap<const ValueDecl *, BlockByrefInfo> BlockByrefInfos;
1402 llvm::Value *RetValNullabilityPrecondition =
nullptr;
1406 bool requiresReturnValueNullabilityCheck()
const {
1407 return RetValNullabilityPrecondition;
1415 bool requiresReturnValueCheck()
const {
1416 return requiresReturnValueNullabilityCheck() ||
1417 (
SanOpts.
has(SanitizerKind::ReturnsNonnullAttribute) &&
1421 llvm::BasicBlock *TerminateLandingPad;
1422 llvm::BasicBlock *TerminateHandler;
1423 llvm::BasicBlock *TrapBB;
1426 const bool ShouldEmitLifetimeMarkers;
1430 void EmitOpenCLKernelMetadata(
const FunctionDecl *FD,
1431 llvm::Function *Fn);
1434 CodeGenFunction(CodeGenModule &cgm,
bool suppressNewContext=
false);
1440 if (DisableDebugInfo)
1466 if (!UnreachableBlock) {
1470 return UnreachableBlock;
1508 Destroyer *destroyer,
bool useEHCleanupForArray);
1511 bool useEHCleanupForArray);
1517 bool useEHCleanupForArray);
1520 bool useEHCleanupForArray,
1525 bool checkZeroLength,
bool useEHCleanup);
1542 llvm_unreachable(
"bad destruction kind");
1563 llvm::Constant *AtomicHelperFn);
1574 llvm::Constant *AtomicHelperFn);
1585 const DeclMapTy &ldm,
1586 bool IsLambdaConversionToBlock);
1598 class AutoVarEmission;
1612 bool followForward =
true);
1616 const llvm::Twine &name);
1704 bool BaseIsNonVirtualPrimaryBase,
1706 VisitedVirtualBasesSetTy &VBases, VPtrsVector &vptrs);
1753 uint64_t VTableByteOffset);
1833 llvm::Function *parent =
nullptr,
1834 llvm::BasicBlock *before =
nullptr) {
1859 void EmitBlock(llvm::BasicBlock *BB,
bool IsFinished=
false);
1878 return Builder.GetInsertBlock() !=
nullptr;
1916 bool forPointeeType =
false);
1955 const Twine &
Name =
"tmp",
1957 bool CastToDefaultAddrSpace =
true);
1970 const Twine &
Name =
"tmp");
1995 bool CastToDefaultAddrSpace =
true);
1997 bool CastToDefaultAddrSpace =
true);
2027 bool ignoreResult =
false);
2052 bool capturedByInit);
2058 const RecordDecl *RD = cast<RecordDecl>(RT->getDecl());
2086 QualType EltTy,
bool isVolatile=
false,
2087 bool isAssignment =
false);
2091 auto it = LocalDeclMap.find(VD);
2092 assert(it != LocalDeclMap.end() &&
2093 "Invalid argument to GetAddrOfLocalVar(), no decl!");
2102 llvm::DenseMap<const OpaqueValueExpr*,LValue>::iterator
2103 it = OpaqueLValues.find(e);
2104 assert(it != OpaqueLValues.end() &&
"no mapping for opaque value!");
2113 llvm::DenseMap<const OpaqueValueExpr*,RValue>::iterator
2114 it = OpaqueRValues.find(e);
2115 assert(it != OpaqueRValues.end() &&
"no mapping for opaque value!");
2177 assert(CXXThisValue &&
"no 'this' value for this function");
2178 return CXXThisValue;
2187 assert(CXXStructorImplicitParamValue &&
"no VTT value for this function");
2188 return CXXStructorImplicitParamValue;
2197 bool BaseIsVirtual);
2213 bool NullCheckValue);
2239 bool ForVirtualBase,
2247 bool ForVirtualBase,
Address This,
2248 bool InheritedFromVBase,
2252 bool ForVirtualBase,
bool Delegating,
2256 bool ForVirtualBase,
bool Delegating,
2274 bool ZeroInitialization =
false);
2280 bool ZeroInitialization =
false);
2285 bool ForVirtualBase,
bool Delegating,
2307 const Expr *Arg,
bool IsDelete);
2362 QualType IndexType,
bool Accessed);
2365 bool isInc,
bool isPre);
2367 bool isInc,
bool isPre);
2394 bool capturedByInit);
2424 bool IsConstantAggregate;
2432 AutoVarEmission(
const VarDecl &variable)
2433 : Variable(&variable), Addr(
Address::
invalid()), NRVOFlag(nullptr),
2435 SizeForLifetimeMarkers(nullptr) {}
2437 bool wasEmittedAsGlobal()
const {
return !Addr.
isValid(); }
2443 return SizeForLifetimeMarkers !=
nullptr;
2447 return SizeForLifetimeMarkers;
2460 if (!IsByRef)
return Addr;
2472 llvm::GlobalValue::LinkageTypes
Linkage);
2548 bool GetLast =
false,
2587 bool ignoreResult =
false);
2591 bool ignoreResult =
false);
2605 const Stmt *OutlinedStmt);
2694 OMPPrivateScope &PrivateScope);
2696 OMPPrivateScope &PrivateScope);
2698 const OMPClause &C, OMPPrivateScope &PrivateScope,
2699 const llvm::DenseMap<const ValueDecl *, Address> &CaptureDeviceAddrMap);
2724 OMPPrivateScope &PrivateScope);
2752 OMPPrivateScope &PrivateScope);
2837 StringRef ParentName,
2856 const Stmt &S,
bool RequiresCleanup,
const Expr *LoopCond,
2857 const Expr *IncExpr,
2882 void EmitOMPSimdFinal(
2890 struct OMPLoopArguments {
2902 Expr *EUB =
nullptr;
2904 Expr *IncExpr =
nullptr;
2906 Expr *Init =
nullptr;
2908 Expr *Cond =
nullptr;
2910 Expr *NextLB =
nullptr;
2912 Expr *NextUB =
nullptr;
2913 OMPLoopArguments() =
default;
2916 Expr *IncExpr =
nullptr,
Expr *Init =
nullptr,
2917 Expr *Cond =
nullptr,
Expr *NextLB =
nullptr,
2918 Expr *NextUB =
nullptr)
2919 : LB(LB), UB(UB), ST(ST), IL(IL), Chunk(Chunk), EUB(EUB),
2920 IncExpr(IncExpr), Init(Init), Cond(Cond), NextLB(NextLB),
2923 void EmitOMPOuterLoop(
bool DynamicOrOrdered,
bool IsMonotonic,
2925 const OMPLoopArguments &LoopArgs,
2930 OMPPrivateScope &LoopScope,
bool Ordered,
2931 const OMPLoopArguments &LoopArgs,
2935 OMPPrivateScope &LoopScope,
2936 const OMPLoopArguments &LoopArgs,
2995 llvm::AtomicOrdering AO,
bool IsVolatile =
false,
3000 void EmitAtomicStore(RValue rvalue, LValue lvalue, llvm::AtomicOrdering AO,
3001 bool IsVolatile,
bool isInit);
3005 llvm::AtomicOrdering Success =
3006 llvm::AtomicOrdering::SequentiallyConsistent,
3007 llvm::AtomicOrdering Failure =
3008 llvm::AtomicOrdering::SequentiallyConsistent,
3012 const llvm::function_ref<RValue(RValue)> &UpdateOp,
3035 LValueBaseInfo BaseInfo =
3037 llvm::MDNode *TBAAInfo =
nullptr,
3039 uint64_t TBAAOffset = 0,
3040 bool isNontemporal =
false);
3053 LValueBaseInfo BaseInfo =
3055 llvm::MDNode *TBAAInfo =
nullptr,
bool isInit =
false,
3057 uint64_t TBAAOffset = 0,
bool isNontemporal =
false);
3109 bool Accessed =
false);
3111 bool IsLowerBound =
true);
3127 LValueBaseInfo *BaseInfo =
nullptr);
3130 llvm::PointerIntPair<llvm::Constant*, 1, bool> ValueAndIsReference;
3132 : ValueAndIsReference(C, isReference) {}
3143 return ValueAndIsReference.getOpaqueValue() !=
nullptr;
3155 return ValueAndIsReference.getPointer();
3178 unsigned CVRQualifiers);
3202 llvm::Instruction **callOrInvoke =
nullptr);
3215 const Twine &name =
"");
3218 const Twine &name =
"");
3220 const Twine &name =
"");
3223 const Twine &name =
"");
3227 const Twine &
Name =
"");
3230 const Twine &name =
"");
3232 const Twine &name =
"");
3284 unsigned BuiltinID,
const CallExpr *E,
3294 const llvm::CmpInst::Predicate Fp,
3295 const llvm::CmpInst::Predicate Ip,
3296 const llvm::Twine &
Name =
"");
3300 unsigned LLVMIntrinsic,
3301 unsigned AltLLVMIntrinsic,
3302 const char *NameHint,
3313 unsigned shift = 0,
bool rightshift =
false);
3316 bool negateForRightShift);
3318 llvm::Type *Ty,
bool usgn,
const char *name);
3368 bool resultIgnored);
3370 bool resultIgnored);
3382 std::pair<LValue,llvm::Value*>
3384 std::pair<LValue,llvm::Value*>
3386 std::pair<LValue,llvm::Value*>
3395 bool allowUnsafeClaim);
3453 bool IgnoreReal =
false,
3454 bool IgnoreImag =
false);
3473 llvm::GlobalVariable *
3475 llvm::GlobalVariable *GV);
3484 llvm::Constant *Addr);
3489 llvm::Constant *addr);
3509 const std::vector<std::pair<llvm::WeakTrackingVH, llvm::Constant *>>
3514 llvm::GlobalVariable *Addr,
3540 StringRef AnnotationStr,
3572 bool AllowLabels =
false);
3578 bool AllowLabels =
false);
3586 llvm::BasicBlock *FalseBlock, uint64_t TrueCount);
3606 const Twine &
Name =
"");
3650 AbstractCallee AC,
unsigned ParmNum);
3666 llvm::MDNode *getRangeForLoadFromType(
QualType Ty);
3669 void deferPlaceholderReplacement(llvm::Instruction *Old,
llvm::Value *New);
3672 DeferredReplacements;
3676 assert(!LocalDeclMap.count(VD) &&
"Decl already exists in LocalDeclMap!");
3677 LocalDeclMap.insert({VD, Addr});
3684 void ExpandTypeFromArgs(QualType Ty, LValue Dst,
3685 SmallVectorImpl<llvm::Value *>::iterator &AI);
3690 void ExpandTypeToArgs(QualType Ty, RValue RV, llvm::FunctionType *IRFuncTy,
3691 SmallVectorImpl<llvm::Value *> &IRCallArgs,
3692 unsigned &IRCallArgPos);
3694 llvm::Value* EmitAsmInput(
const TargetInfo::ConstraintInfo &Info,
3695 const Expr *InputExpr, std::string &ConstraintStr);
3697 llvm::Value* EmitAsmInputLValue(
const TargetInfo::ConstraintInfo &Info,
3698 LValue InputValue, QualType InputType,
3699 std::string &ConstraintStr,
3700 SourceLocation Loc);
3707 llvm::Value *evaluateOrEmitBuiltinObjectSize(
const Expr *E,
unsigned Type,
3708 llvm::IntegerType *ResType,
3714 llvm::Value *emitBuiltinObjectSize(
const Expr *E,
unsigned Type,
3715 llvm::IntegerType *ResType,
3725 return classDecl->getTypeParamListAsWritten();
3729 return catDecl->getTypeParamList();
3735 template<
typename T>
3749 template <
typename T>
3751 llvm::iterator_range<CallExpr::const_arg_iterator> ArgRange,
3753 unsigned ParamsToSkip = 0,
3758 assert((ParamsToSkip == 0 || CallArgTypeInfo) &&
3759 "Can't skip parameters if type info is not provided");
3760 if (CallArgTypeInfo) {
3766 for (
auto I = CallArgTypeInfo->param_type_begin() + ParamsToSkip,
3767 E = CallArgTypeInfo->param_type_end();
3768 I !=
E; ++
I, ++Arg) {
3769 assert(Arg != ArgRange.end() &&
"Running over edge of argument list!");
3770 assert((isGenericMethod ||
3771 ((*I)->isVariablyModifiedType() ||
3772 (*I).getNonReferenceType()->isObjCRetainableType() ||
3779 "type mismatch in call argument!");
3780 ArgTypes.push_back(*
I);
3786 assert((Arg == ArgRange.end() || !CallArgTypeInfo ||
3787 CallArgTypeInfo->isVariadic()) &&
3788 "Extra arguments in non-variadic function!");
3791 for (
auto *A : llvm::make_range(Arg, ArgRange.end()))
3792 ArgTypes.push_back(CallArgTypeInfo ? getVarArgType(A) : A->getType());
3794 EmitCallArgs(Args, ArgTypes, ArgRange, AC, ParamsToSkip, Order);
3798 llvm::iterator_range<CallExpr::const_arg_iterator> ArgRange,
3799 AbstractCallee AC = AbstractCallee(),
3800 unsigned ParamsToSkip = 0,
3828 void EmitDeclMetadata();
3831 const AutoVarEmission &emission);
3833 void AddObjCARCExceptionMetadata(llvm::Instruction *Inst);
3835 llvm::Value *GetValueForARMHint(
unsigned BuiltinID);
3846 if (!isa<llvm::Instruction>(value))
return false;
3849 llvm::BasicBlock *block = cast<llvm::Instruction>(value)->getParent();
3850 return (block != &block->getParent()->getEntryBlock());
3855 if (!needsSaving(value))
return saved_type(value,
false);
3869 if (!value.getInt())
return value.getPointer();
3872 auto alloca = cast<llvm::AllocaInst>(value.getPointer());
3912 enum Kind { ScalarLiteral, ScalarAddress, AggregateLiteral,
3913 AggregateAddress, ComplexAddress };
3917 unsigned Align : 29;
3919 :
Value(v), K(k), Align(a) {}
3922 static bool needsSaving(
RValue value);
3930 return saved_type::needsSaving(value);
3933 return saved_type::save(CGF, value);
3936 return value.restore(CGF);
void enterNonTrivialFullExpression(const ExprWithCleanups *E)
Enter a full-expression with a non-trivial number of objects to clean up.
A call to an overloaded operator written using operator syntax.
ReturnValueSlot - Contains the address where the return value of a function can be stored...
llvm::Value * getArrayInitIndex()
Get the index of the current ArrayInitLoopExpr, if any.
void EnterDtorCleanups(const CXXDestructorDecl *Dtor, CXXDtorType Type)
EnterDtorCleanups - Enter the cleanups necessary to complete the given phase of destruction for a des...
bool EmitScalarRangeCheck(llvm::Value *Value, QualType Ty, SourceLocation Loc)
Check if the scalar Value is within the valid range for the given type Ty.
std::pair< RValue, llvm::Value * > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, llvm::AtomicOrdering Success=llvm::AtomicOrdering::SequentiallyConsistent, llvm::AtomicOrdering Failure=llvm::AtomicOrdering::SequentiallyConsistent, bool IsWeak=false, AggValueSlot Slot=AggValueSlot::ignored())
Emit a compare-and-exchange op for atomic type.
This represents '#pragma omp distribute simd' composite directive.
Information about the layout of a __block variable.
void EmitIndirectGotoStmt(const IndirectGotoStmt &S)
This represents '#pragma omp master' directive.
SourceLocation getEnd() const
void EmitCoroutineBody(const CoroutineBodyStmt &S)
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)
Generate the copy-helper function for a block closure object: static void block_copy_helper(block_t *...
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
llvm::Value * BlockPointer
llvm::Value * EmitARCStoreStrong(LValue lvalue, llvm::Value *value, bool resultIgnored)
Store into a strong object.
void GenerateCXXGlobalInitFunc(llvm::Function *Fn, ArrayRef< llvm::Function * > CXXThreadLocals, Address Guard=Address::invalid())
GenerateCXXGlobalInitFunc - Generates code for initializing global variables.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
LValue MakeNaturalAlignPointeeAddrLValue(llvm::Value *V, QualType T)
Given a value of type T* that may not be to a complete object, construct an l-value with the natural ...
void ActivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
ActivateCleanupBlock - Activates an initially-inactive cleanup.
void end(CodeGenFunction &CGF)
llvm::Value * EmitARCReclaimReturnedObject(const Expr *e, bool allowUnsafeClaim)
~InlinedInheritingConstructorScope()
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="")
CXXDefaultInitExprScope(CodeGenFunction &CGF)
void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor, CXXCtorType CtorType, const FunctionArgList &Args, SourceLocation Loc)
void EmitReturnValueCheck(llvm::Value *RV)
Emit a test that checks if the return value RV is nonnull.
CGCallee BuildAppleKextVirtualCall(const CXXMethodDecl *MD, NestedNameSpecifier *Qual, llvm::Type *Ty)
BuildAppleKextVirtualCall - This routine is to support gcc's kext ABI making indirect call to virtual...
LValue EmitComplexCompoundAssignmentLValue(const CompoundAssignOperator *E)
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
llvm::Value * EmitARCRetainAutoreleaseScalarExpr(const Expr *expr)
PointerType - C99 6.7.5.1 - Pointer Declarators.
Scheduling data for loop-based OpenMP directives.
Destroyer * getDestroyer(QualType::DestructionKind destructionKind)
A (possibly-)qualified type.
void EmitSEHLeaveStmt(const SEHLeaveStmt &S)
void EmitExtendGCLifetime(llvm::Value *object)
EmitExtendGCLifetime - Given a pointer to an Objective-C object, make sure it survives garbage collec...
void EmitCtorPrologue(const CXXConstructorDecl *CD, CXXCtorType Type, FunctionArgList &Args)
EmitCtorPrologue - This routine generates necessary code to initialize base classes and non-static da...
CodeGenTypes & getTypes()
llvm::Type * ConvertTypeForMem(QualType T)
const TargetCodeGenInfo & getTargetHooks() const
void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount)
EmitBranchOnBoolExpr - Emit a branch on a boolean condition (e.g.
void EmitVarDecl(const VarDecl &D)
EmitVarDecl - Emit a local variable declaration.
llvm::Value * EmitARCExtendBlockObject(const Expr *expr)
void EmitGotoStmt(const GotoStmt &S)
LValue EmitStmtExprLValue(const StmtExpr *E)
Address getAllocatedAddress() const
Returns the raw, allocated address, which is not necessarily the address of the object itself...
RValue EmitCoyieldExpr(const CoyieldExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
void EmitAttributedStmt(const AttributedStmt &S)
The class detects jumps which bypass local variables declaration: goto L; int a; L: ...
llvm::Constant * EmitCheckTypeDescriptor(QualType T)
Emit a description of a type in a format suitable for passing to a runtime sanitizer handler...
void EmitOMPDistributeDirective(const OMPDistributeDirective &S)
llvm::Value * EmitNVPTXBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::LLVMContext & getLLVMContext()
void EmitFunctionInstrumentation(const char *Fn)
EmitFunctionInstrumentation - Emit LLVM code to call the specified instrumentation function with the ...
LValue EmitObjCIsaExpr(const ObjCIsaExpr *E)
void EmitARCDestroyWeak(Address addr)
void @objc_destroyWeak(i8** addr) Essentially objc_storeWeak(addr, nil).
LValue EmitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *E)
void EmitOMPAggregateAssign(Address DestAddr, Address SrcAddr, QualType OriginalType, const llvm::function_ref< void(Address, Address)> &CopyGen)
Perform element by element copying of arrays with type OriginalType from SrcAddr to DestAddr using co...
void EmitCXXTryStmt(const CXXTryStmt &S)
FieldConstructionScope(CodeGenFunction &CGF, Address This)
Represents a 'co_return' statement in the C++ Coroutines TS.
Stmt - This represents one statement.
bool isInConditionalBranch() const
isInConditionalBranch - Return true if we're currently emitting one branch or the other of a conditio...
void EmitNewArrayInitializer(const CXXNewExpr *E, QualType elementType, llvm::Type *ElementTy, Address NewPtr, llvm::Value *NumElements, llvm::Value *AllocSizeWithoutCookie)
const TargetInfo & getTarget() const
IfStmt - This represents an if/then/else.
void EmitStoreThroughGlobalRegLValue(RValue Src, LValue Dst)
Store of global named registers are always calls to intrinsics.
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...
void EmitOMPTargetSimdDirective(const OMPTargetSimdDirective &S)
C Language Family Type Representation.
Address GetAddressOfDerivedClass(Address Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue)
OpaqueValueMapping(CodeGenFunction &CGF, const AbstractConditionalOperator *op)
Build the opaque value mapping for the given conditional operator if it's the GNU ...
This represents '#pragma omp for simd' directive.
Checking the 'this' pointer for a constructor call.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Address EmitVAArg(VAArgExpr *VE, Address &VAListAddr)
Generate code to get an argument from the passed in pointer and update it accordingly.
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())
Decl - This represents one declaration (or definition), e.g.
This represents '#pragma omp teams distribute parallel for' composite directive.
void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, llvm::Value *V, QualType Type, CharUnits Alignment=CharUnits::Zero(), SanitizerSet SkippedChecks=SanitizerSet())
Emit a check that V is the address of storage of the appropriate size and alignment for an object of ...
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
llvm::Value * getTypeSize(QualType Ty)
Returns calculated size of the specified type.
Address getEHSelectorSlot()
RValue EmitCoawaitExpr(const CoawaitExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
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 * EmitMSVCBuiltinExpr(MSVCIntrin BuiltinID, const CallExpr *E)
void EmitAutoVarDecl(const VarDecl &D)
EmitAutoVarDecl - Emit an auto variable declaration.
const llvm::DataLayout & getDataLayout() const
void EmitOMPOrderedDirective(const OMPOrderedDirective &S)
static Destroyer destroyARCStrongPrecise
llvm::Value * LoadCXXThis()
LoadCXXThis - Load the value of 'this'.
bool isGlobalVarCaptured(const VarDecl *VD) const
Checks if the global variable is captured in current function.
The base class of the type hierarchy.
This represents '#pragma omp target teams distribute' combined directive.
void pushLifetimeExtendedDestroy(CleanupKind kind, Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
LValue EmitBinaryOperatorLValue(const BinaryOperator *E)
Represents Objective-C's @throw statement.
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...
bool ShouldInstrumentFunction()
ShouldInstrumentFunction - Return true if the current function should be instrumented with __cyg_prof...
CGCapturedStmtInfo(const CapturedStmt &S, CapturedRegionKind K=CR_Default)
LValue EmitOpaqueValueLValue(const OpaqueValueExpr *e)
void GenerateObjCSetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
GenerateObjCSetter - Synthesize an Objective-C property setter function for the given property...
Address GenerateCapturedStmtArgument(const CapturedStmt &S)
std::unique_ptr< llvm::MemoryBuffer > Buffer
void EmitSEHExceptionCodeSave(CodeGenFunction &ParentCGF, llvm::Value *ParentFP, llvm::Value *EntryEBP)
void GenerateCode(GlobalDecl GD, llvm::Function *Fn, const CGFunctionInfo &FnInfo)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
void SpecialInitFn(CodeGenFunction &Init, const VarDecl &D, llvm::Value *Address)
bool sanitizePerformTypeCheck() const
Whether any type-checking sanitizers are enabled.
Represents a call to a C++ constructor.
RValue EmitCXXMemberCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue)
DominatingValue< T >::saved_type saveValueInCond(T value)
CGCapturedStmtInfo(CapturedRegionKind K=CR_Default)
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
void EmitARCCopyWeak(Address dst, Address src)
void @objc_copyWeak(i8** dest, i8** src) Disregards the current value in dest.
void EmitCfiCheckFail()
Emit a cross-DSO CFI failure handling function.
void ForceCleanup(std::initializer_list< llvm::Value ** > ValuesToReload={})
Force the emission of cleanups now, instead of waiting until this object is destroyed.
llvm::Value * EmitObjCMRRAutoreleasePoolPush()
Produce the code to do an MRR version objc_autoreleasepool_push.
llvm::Function * GenerateVarArgsThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk)
CharUnits getNaturalTypeAlignment(QualType T, LValueBaseInfo *BaseInfo=nullptr, bool forPointeeType=false)
llvm::Constant * GenerateObjCAtomicSetterCopyHelperFunction(const ObjCPropertyImplDecl *PID)
GenerateObjCAtomicSetterCopyHelperFunction - Given a c++ object type with non-trivial copy assignment...
This represents '#pragma omp parallel for' directive.
const LangOptions & getLangOpts() const
LValue EmitLValueForFieldInitialization(LValue Base, const FieldDecl *Field)
EmitLValueForFieldInitialization - Like EmitLValueForField, except that if the Field is a reference...
llvm::Value * EmitARCRetainNonBlock(llvm::Value *value)
Retain the given object, with normal retain semantics.
This represents '#pragma omp target teams distribute parallel for' combined directive.
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)
bool ConstantFoldsToSimpleInteger(const Expr *Cond, bool &Result, bool AllowLabels=false)
ConstantFoldsToSimpleInteger - If the specified expression does not fold to a constant, or if it does but contains a label, return false.
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const RValue &rv)
void EmitOMPCopy(QualType OriginalType, Address DestAddr, Address SrcAddr, const VarDecl *DestVD, const VarDecl *SrcVD, const Expr *Copy)
Emit proper copying of data from one variable to another.
static Destroyer destroyARCWeak
! Language semantics require left-to-right evaluation.
LValue EmitCXXUuidofLValue(const CXXUuidofExpr *E)
const CXXBaseSpecifier *const * path_const_iterator
void EmitOMPParallelForSimdDirective(const OMPParallelForSimdDirective &S)
This represents '#pragma omp target exit data' directive.
void GenerateCXXGlobalDtorsFunc(llvm::Function *Fn, const std::vector< std::pair< llvm::WeakTrackingVH, llvm::Constant * >> &DtorsAndObjects)
GenerateCXXGlobalDtorsFunc - Generates code for destroying global variables.
Address GetAddrOfLocalVar(const VarDecl *VD)
GetAddrOfLocalVar - Return the address of a local variable.
TypeEvaluationKind
The kind of evaluation to perform on values of a particular type.
llvm::Function * GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S)
VarDecl - An instance of this class is created to represent a variable declaration or definition...
static saved_type save(CodeGenFunction &CGF, type value)
void EmitOMPCriticalDirective(const OMPCriticalDirective &S)
LValue EmitObjCEncodeExprLValue(const ObjCEncodeExpr *E)
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
CompoundLiteralExpr - [C99 6.5.2.5].
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()
Produce the code to do a objc_autoreleasepool_push.
Address EmitArrayToPointerDecay(const Expr *Array, LValueBaseInfo *BaseInfo=nullptr)
field_iterator field_begin() const
llvm::Value * GetVTTParameter(GlobalDecl GD, bool ForVirtualBase, bool Delegating)
GetVTTParameter - Return the VTT parameter that should be passed to a base constructor/destructor wit...
This class gathers all debug information during compilation and is responsible for emitting to llvm g...
ObjCMethodDecl - Represents an instance or class method declaration.
static bool mightAddDeclToScope(const Stmt *S)
Determine if the given statement might introduce a declaration into the current scope, by being a (possibly-labelled) DeclStmt.
void EmitNonNullArgCheck(RValue RV, QualType ArgType, SourceLocation ArgLoc, AbstractCallee AC, unsigned ParmNum)
Create a check for a function parameter that may potentially be declared as non-null.
llvm::Value * EmitBlockCopyAndAutorelease(llvm::Value *Block, QualType Ty)
void EmitLabel(const LabelDecl *D)
EmitLabel - Emit the block for the given label.
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)
EmitVLASize - Capture all the sizes for the VLA expressions in the given variably-modified type and s...
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)
pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression.
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.
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)
void EmitOMPLastprivateClauseFinal(const OMPExecutableDirective &D, bool NoFinals, llvm::Value *IsLastIterCond=nullptr)
Emit final copying of lastprivate values to original variables at the end of the worksharing or simd ...
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
llvm::Value * EmitARMBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
ParmVarDecl - Represents a parameter to a function.
void EmitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective &S)
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)
SimplifyForwardingBlocks - If the given basic block is only a branch to another basic block...
void emitImplicitAssignmentOperatorBody(FunctionArgList &Args)
RValue EmitCXXMemberOrOperatorCall(const CXXMethodDecl *Method, const CGCallee &Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E, CallArgList *RtlArgs)
AbstractCallee(const ObjCMethodDecl *OMD)
llvm::Value * EmitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E)
void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, llvm::Value **Result=nullptr)
EmitStoreThroughBitfieldLValue - Store Src into Dst with same constraints as EmitStoreThroughLValue.
static void EmitOMPTargetParallelDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelDirective &S)
Address emitAddrOfImagComponent(Address complex, QualType complexType)
The collection of all-type qualifiers we support.
EHScopeStack::stable_iterator PrologueCleanupDepth
PrologueCleanupDepth - The cleanup depth enclosing all the cleanups associated with the parameters...
A jump destination is an abstract label, branching to which may require a jump out through normal cle...
bool EmitOMPWorksharingLoop(const OMPLoopDirective &S, Expr *EUB, const CodeGenLoopBoundsTy &CodeGenLoopBounds, const CodeGenDispatchBoundsTy &CGDispatchBounds)
Emit code for the worksharing loop-based directive.
llvm::Value * EmitObjCThrowOperand(const Expr *expr)
void EmitOMPTargetTeamsDistributeParallelForSimdDirective(const OMPTargetTeamsDistributeParallelForSimdDirective &S)
~CXXDefaultInitExprScope()
LabelStmt - Represents a label, which has a substatement.
void EmitOMPTaskLoopSimdDirective(const OMPTaskLoopSimdDirective &S)
JumpDest getJumpDestForLabel(const LabelDecl *S)
getBasicBlockForLabel - Return the LLVM basicblock that the specified label maps to.
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.
RecordDecl - Represents a struct/union/class.
void popCatchScope()
popCatchScope - Pops the catch scope at the top of the EHScope stack, emitting any required code (oth...
llvm::Value * EmitCommonNeonBuiltinExpr(unsigned BuiltinID, unsigned LLVMIntrinsic, unsigned AltLLVMIntrinsic, const char *NameHint, unsigned Modifier, const CallExpr *E, SmallVectorImpl< llvm::Value * > &Ops, Address PtrOp0, Address PtrOp1)
llvm::DenseMap< const VarDecl *, FieldDecl * > LambdaCaptureFields
An object to manage conditionally-evaluated expressions.
PeepholeProtection protectFromPeepholes(RValue rvalue)
protectFromPeepholes - Protect a value that we're intending to store to the side, but which will prob...
llvm::BasicBlock * getTerminateHandler()
getTerminateHandler - Return a handler (not a landing pad, just a catch handler) that just calls term...
void EmitCXXForRangeStmt(const CXXForRangeStmt &S, ArrayRef< const Attr * > Attrs=None)
bool requiresLandingPad() const
bool ShouldXRayInstrumentFunction() const
ShouldXRayInstrument - Return true if the current function should be instrumented with XRay nop sleds...
void EmitOMPSimdDirective(const OMPSimdDirective &S)
llvm::Value * EmitCXXNewExpr(const CXXNewExpr *E)
void emitDestroy(Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
emitDestroy - Immediately perform the destruction of the given object.
ConditionalCleanup stores the saved form of its parameters, then restores them and performs the clean...
llvm::Value * EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
void emitByrefStructureInit(const AutoVarEmission &emission)
Initialize the structural components of a __block variable, i.e.
ArrayInitLoopExprScope(CodeGenFunction &CGF, llvm::Value *Index)
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 EmitCheck(ArrayRef< std::pair< llvm::Value *, SanitizerMask >> Checked, SanitizerHandler Check, 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...
void setScopeDepth(EHScopeStack::stable_iterator depth)
void EmitFunctionEpilog(const CGFunctionInfo &FI, bool EmitRetDbgLoc, SourceLocation EndLoc)
EmitFunctionEpilog - Emit the target specific LLVM code to return the given temporary.
This represents '#pragma omp parallel' directive.
CGDebugInfo * getDebugInfo()
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
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)
Given that we are currently emitting a lambda, emit an l-value for one of its members.
void EmitExprAsInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
EmitExprAsInit - Emits the code necessary to initialize a location in memory with the given initializ...
const CXXRecordDecl * NearestVBase
std::pair< LValue, llvm::Value * > EmitARCStoreAutoreleasing(const BinaryOperator *e)
void addLabel(const LabelDecl *label)
AbstractCallee(const FunctionDecl *FD)
CGCallee BuildAppleKextVirtualDestructorCall(const CXXDestructorDecl *DD, CXXDtorType Type, const CXXRecordDecl *RD)
BuildVirtualCall - This routine makes indirect vtable call for call to virtual destructors.
llvm::Value * EmitDynamicCast(Address V, const CXXDynamicCastExpr *DCE)
llvm::Value * EmitObjCExtendObjectLifetime(QualType T, llvm::Value *Ptr)
void EmitOMPTaskLoopBasedDirective(const OMPLoopDirective &S)
RValue EmitReferenceBindingToExpr(const Expr *E)
Emits a reference binding to the passed in expression.
llvm::SmallPtrSet< const CXXRecordDecl *, 4 > VisitedVirtualBasesSetTy
void EmitSynthesizedCXXCopyCtorCall(const CXXConstructorDecl *D, Address This, Address Src, const CXXConstructExpr *E)
The scope used to remap some variables as private in the OpenMP loop body (or other captured region e...
SmallVector< Address, 1 > SEHCodeSlotStack
A stack of exception code slots.
LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E)
bool isReferenceType() const
llvm::Value * EmitARCRetainAutoreleaseReturnValue(llvm::Value *value)
Do a fused retain/autorelease of the given object.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool ShouldEmitVTableTypeCheckedLoad(const CXXRecordDecl *RD)
Returns whether we should perform a type checked load when loading a virtual function for virtual cal...
Address EmitLoadOfPointer(Address Ptr, const PointerType *PtrTy, LValueBaseInfo *BaseInfo=nullptr)
void rescopeLabels()
Change the cleanup scope of the labels in this lexical scope to match the scope of the enclosing cont...
An RAII object to set (and then clear) a mapping for an OpaqueValueExpr.
const FunctionDecl * CurSEHParent
LValue EmitCoyieldLValue(const CoyieldExpr *E)
LValue EmitOMPArraySectionExpr(const OMPArraySectionExpr *E, bool IsLowerBound=true)
llvm::CallInst * EmitRuntimeCall(llvm::Value *callee, const Twine &name="")
void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock *BB, llvm::BasicBlock::iterator InsertPt) const
CGBuilder insert helper.
void pushEHDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)
pushEHDestroy - Push the standard destructor for the given type as an EH-only cleanup.
Helper class with most of the code for saving a value for a conditional expression cleanup...
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)
EmitVTablePtrCheck - Emit a check that VTable is a valid virtual table for RD using llvm...
void EmitOMPPrivateLoopCounters(const OMPLoopDirective &S, OMPPrivateScope &LoopScope)
Emit initial code for loop counters of loop-based directives.
llvm::Value * EmitARCAutoreleaseReturnValue(llvm::Value *value)
Autorelease the given object.
This represents '#pragma omp target simd' directive.
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="")
Emits a call or invoke instruction to the given function, depending on the current state of the EH st...
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.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
A metaprogramming class for ensuring that a value will dominate an arbitrary position in a function...
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...
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp, [NSNumber numberWithInt:42]];.
The this pointer adjustment as well as an optional return adjustment for a thunk. ...
void InitTempAlloca(Address Alloca, llvm::Value *Value)
InitTempAlloca - Provide an initial value for the given alloca which will be observable at all locati...
Address getExceptionSlot()
Returns a pointer to the function's exception object and selector slot, which is assigned in every la...
llvm::Value * EmitObjCBoxedExpr(const ObjCBoxedExpr *E)
EmitObjCBoxedExpr - This routine generates code to call the appropriate expression boxing method...
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc...
RValue EmitLoadOfExtVectorElementLValue(LValue V)
const Decl * getDecl() const
This represents '#pragma omp critical' directive.
LValue EmitLambdaLValue(const LambdaExpr *E)
void EmitCXXConstructorCall(const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, Address This, const CXXConstructExpr *E)
void GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn, const VarDecl *D, llvm::GlobalVariable *Addr, bool PerformInit)
Emit the code necessary to initialize the given global variable.
void EmitLambdaDelegatingInvokeBody(const CXXMethodDecl *MD)
RValue EmitAnyExprToTemp(const Expr *E)
EmitAnyExprToTemp - Similarly to EmitAnyExpr(), however, the result will always be accessible even if...
ComplexPairTy EmitLoadOfComplex(LValue src, SourceLocation loc)
EmitLoadOfComplex - Load a complex number from the specified l-value.
void EmitOMPDistributeParallelForSimdDirective(const OMPDistributeParallelForSimdDirective &S)
void EmitInitializerForField(FieldDecl *Field, LValue LHS, Expr *Init)
bool EmitOMPLastprivateClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
Emit initial code for lastprivate variables.
Address CreateIRTemp(QualType T, const Twine &Name="tmp")
CreateIRTemp - Create a temporary IR object of the given type, with appropriate alignment.
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 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)
getOpaqueRValueMapping - Given an opaque value expression (which must be mapped to an r-value)...
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
llvm::BasicBlock * getStartingBlock() const
Returns a block which will be executed prior to each evaluation of the conditional code...
llvm::Value * EmitARCStoreStrongCall(Address addr, llvm::Value *value, bool resultIgnored)
Store into a strong object.
IndirectGotoStmt - This represents an indirect goto.
llvm::Value * EmitLoadOfScalar(Address Addr, bool Volatile, QualType Ty, SourceLocation Loc, LValueBaseInfo BaseInfo=LValueBaseInfo(AlignmentSource::Type), llvm::MDNode *TBAAInfo=nullptr, QualType TBAABaseTy=QualType(), uint64_t TBAAOffset=0, bool isNontemporal=false)
EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the...
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...
This represents '#pragma omp distribute parallel for' composite directive.
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...
A class controlling the emission of a finally block.
Address emitAddrOfRealComponent(Address complex, QualType complexType)
This represents '#pragma omp teams distribute parallel for simd' composite directive.
llvm::Value * BuildVector(ArrayRef< llvm::Value * > Ops)
CharUnits getNaturalPointeeTypeAlignment(QualType T, LValueBaseInfo *BaseInfo=nullptr)
llvm::Value * EmitObjCStringLiteral(const ObjCStringLiteral *E)
Emits an instance of NSConstantString representing the object.
static bool hasScalarEvaluationKind(QualType T)
Address GetAddrOfBlockDecl(const VarDecl *var, bool ByRef)
void EmitOMPTargetTeamsDistributeSimdDirective(const OMPTargetTeamsDistributeSimdDirective &S)
ForStmt - This represents a 'for (init;cond;inc)' stmt.
InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)
ObjCContainerDecl - Represents a container for method declarations.
void emitOMPSimpleStore(LValue LVal, RValue RVal, QualType RValTy, SourceLocation Loc)
void EmitDoStmt(const DoStmt &S, ArrayRef< const Attr * > Attrs=None)
CharUnits - This is an opaque type for sizes expressed in character units.
void EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, llvm::Value *VTable, SourceLocation Loc)
If whole-program virtual table optimization is enabled, emit an assumption that VTable is a member of...
void EmitARCDestroyStrong(Address addr, ARCPreciseLifetime_t precise)
Destroy a __strong variable.
bool isLocalVarDeclOrParm() const
Similar to isLocalVarDecl but also includes parameters.
llvm::function_ref< std::pair< LValue, LValue > CodeGenFunction &, const OMPExecutableDirective &S)> CodeGenLoopBoundsTy
void ExitSEHTryStmt(const SEHTryStmt &S)
CGCapturedStmtRAII(CodeGenFunction &CGF, CGCapturedStmtInfo *NewCapturedStmtInfo)
void EmitOMPCancellationPointDirective(const OMPCancellationPointDirective &S)
LexicalScope(CodeGenFunction &CGF, SourceRange Range)
Enter a new cleanup scope.
RAII for correct setting/restoring of CapturedStmtInfo.
llvm::Value * EmitBlockLiteral(const BlockExpr *)
Emit a block literal expression in the current function.
void EmitOMPTeamsDistributeParallelForSimdDirective(const OMPTeamsDistributeParallelForSimdDirective &S)
void EmitContinueStmt(const ContinueStmt &S)
void EmitOMPTargetDirective(const OMPTargetDirective &S)
TypeDecl - Represents a declaration of a type.
A builtin binary operation expression such as "x + y" or "x <= y".
bool needsEHCleanup(QualType::DestructionKind kind)
Determines whether an EH cleanup is required to destroy a type with the given destruction kind...
llvm::Value * EmitARCUnsafeUnretainedScalarExpr(const Expr *expr)
EmitARCUnsafeUnretainedScalarExpr - Semantically equivalent to immediately releasing the resut of Emi...
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const LValue &lv)
void registerGlobalDtorWithAtExit(const VarDecl &D, llvm::Constant *fn, llvm::Constant *addr)
Call atexit() with a function that passes the given argument to the given function.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
bool IsOutlinedSEHHelper
True if the current function is an outlined SEH helper.
Address EmitLoadOfReference(Address Ref, const ReferenceType *RefTy, LValueBaseInfo *BaseInfo=nullptr)
Address EmitCXXMemberDataPointerAddress(const Expr *E, Address base, llvm::Value *memberPtr, const MemberPointerType *memberPtrType, LValueBaseInfo *BaseInfo=nullptr)
Emit the address of a field using a member data pointer.
void EmitOMPTargetUpdateDirective(const OMPTargetUpdateDirective &S)
void EmitSwitchStmt(const SwitchStmt &S)
This represents '#pragma omp cancellation point' directive.
bool isObviouslyBranchWithoutCleanups(JumpDest Dest) const
isObviouslyBranchWithoutCleanups - Return true if a branch to the specified destination obviously has...
void EmitAggregateAssign(Address DestPtr, Address SrcPtr, QualType EltTy)
EmitAggregateCopy - Emit an aggregate assignment.
llvm::Value * EmitARCLoadWeak(Address addr)
i8* @objc_loadWeak(i8** addr) Essentially objc_autorelease(objc_loadWeakRetained(addr)).
ObjCStringLiteral, used for Objective-C string literals i.e.
llvm::BasicBlock * getInvokeDestImpl()
LValue EmitCXXConstructLValue(const CXXConstructExpr *E)
void initFullExprCleanup()
Set up the last cleaup that was pushed as a conditional full-expression cleanup.
RValue EmitSimpleCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue)
Emit a CallExpr without considering whether it might be a subclass.
llvm::Function * GenerateSEHFinallyFunction(CodeGenFunction &ParentCGF, const SEHFinallyStmt &Finally)
void EmitDeleteCall(const FunctionDecl *DeleteFD, llvm::Value *Ptr, QualType DeleteTy, llvm::Value *NumElements=nullptr, CharUnits CookieSize=CharUnits())
LValue EmitUnaryOpLValue(const UnaryOperator *E)
A stack of scopes which respond to exceptions, including cleanups and catch blocks.
void EmitStmt(const Stmt *S)
EmitStmt - Emit the code for the statement.
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)
EmitARCRetainScalarExpr - Semantically equivalent to EmitARCRetainObject(e->getType(), EmitScalarExpr(e)), but making a best-effort attempt to peephole expressions that naturally produce retained objects.
This represents '#pragma omp teams' directive.
void EmitIgnoredExpr(const Expr *E)
EmitIgnoredExpr - Emit an expression in a context which ignores the result.
Denotes a cleanup that should run when a scope is exited using normal control flow (falling off the e...
void EmitAtomicInit(Expr *E, LValue lvalue)
llvm::Function * EmitCapturedStmt(const CapturedStmt &S, CapturedRegionKind K)
Generate an outlined function for the body of a CapturedStmt, store any captured variables into the c...
Enums/classes describing ABI related information about constructors, destructors and thunks...
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E)
bool requiresCleanups() const
Determine whether this scope requires any cleanups.
This represents '#pragma omp teams distribute simd' combined directive.
Represents binding an expression to a temporary.
RValue EmitAtomicExpr(AtomicExpr *E)
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)
ContainsLabel - Return true if the statement contains a label in it.
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.
void EmitCaseStmtRange(const CaseStmt &S)
EmitCaseStmtRange - If case statement range is not too big then add multiple cases to switch instruct...
void incrementProfileCounter(const Stmt *S, llvm::Value *StepV=nullptr)
Increment the profiler's counter for the given statement by StepV.
uint64_t getCurrentProfileCount()
Get the profiler's current count.
CallLifetimeEnd(Address addr, llvm::Value *size)
llvm::function_ref< std::pair< llvm::Value *, llvm::Value * > CodeGenFunction &, const OMPExecutableDirective &S, Address LB, Address UB)> CodeGenDispatchBoundsTy
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...
Represents an ObjC class declaration.
RValue convertTempToRValue(Address addr, QualType type, SourceLocation Loc)
Given the address of a temporary variable, produce an r-value of its type.
Checking the operand of a cast to a virtual base object.
JumpDest getJumpDestInCurrentScope(StringRef Name=StringRef())
The given basic block lies in the current EH scope, but may be a target of a potentially scope-crossi...
detail::InMemoryDirectory::const_iterator I
llvm::Value * EmitCheckedInBoundsGEP(llvm::Value *Ptr, ArrayRef< llvm::Value * > IdxList, bool SignedIndices, bool IsSubtraction, SourceLocation Loc, const Twine &Name="")
Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to detect undefined behavior whe...
llvm::AllocaInst * EHSelectorSlot
The selector slot.
llvm::Value * EmitARCRetainAutoreleasedReturnValue(llvm::Value *value)
Retain the given object which is the result of a function call.
static bool ShouldNullCheckClassCastValue(const CastExpr *Cast)
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)
Do a fused retain/autorelease of the given object.
llvm::Value * EmitSEHExceptionCode()
~LexicalScope()
Exit this cleanup scope, emitting any accumulated cleanups.
LValue EmitLValueForField(LValue Base, const FieldDecl *Field)
Checking the 'this' pointer for a call to a non-static member function.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
llvm::CallSite EmitRuntimeCallOrInvoke(llvm::Value *callee, ArrayRef< llvm::Value * > args, const Twine &name="")
Emits a call or invoke instruction to the given runtime function.
This represents '#pragma omp target parallel for simd' directive.
LValue EmitExtVectorElementExpr(const ExtVectorElementExpr *E)
OpenMP 4.0 [2.4, Array Sections].
RValue EmitObjCMessageExpr(const ObjCMessageExpr *E, ReturnValueSlot Return=ReturnValueSlot())
Const iterator for iterating over Stmt * arrays that contain only Expr *.
void EmitCXXConstructExpr(const CXXConstructExpr *E, AggValueSlot Dest)
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
CompoundStmt - This represents a group of statements like { stmt stmt }.
AutoVarEmission EmitAutoVarAlloca(const VarDecl &var)
EmitAutoVarAlloca - Emit the alloca and debug information for a local variable.
std::pair< llvm::Value *, llvm::Value * > ComplexPairTy
Represents a prototype with parameter type info, e.g.
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.
void EmitAlignmentAssumption(llvm::Value *PtrValue, llvm::Value *Alignment, llvm::Value *OffsetValue=nullptr)
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()
CGBlockInfo - Information to generate a block literal.
void EmitAnyExprToMem(const Expr *E, Address Location, Qualifiers Quals, bool IsInitializer)
EmitAnyExprToMem - Emits the code necessary to evaluate an arbitrary expression into the given memory...
unsigned getNumObjects() const
RValue - This trivial value class is used to represent the result of an expression that is evaluated...
void EmitSanitizerStatReport(llvm::SanitizerStatKind SSK)
bool addPrivate(const VarDecl *LocalVD, llvm::function_ref< Address()> PrivateGen)
Registers LocalVD variable as a private and apply PrivateGen function for it to generate correspondin...
CleanupKind getARCCleanupKind()
Retrieves the default cleanup kind for an ARC cleanup.
llvm::Value * getSizeForLifetimeMarkers() const
static AutoVarEmission invalid()
std::vector< bool > & Stack
void EmitOMPLoopBody(const OMPLoopDirective &D, JumpDest LoopExit)
Helper for the OpenMP loop directives.
void EmitDelegateCallArg(CallArgList &args, const VarDecl *param, SourceLocation loc)
EmitDelegateCallArg - We are performing a delegate call; that is, the current function is delegating ...
Represents a call to the builtin function __builtin_va_arg.
Address CreateDefaultAlignTempAlloca(llvm::Type *Ty, const Twine &Name="tmp")
CreateDefaultAlignedTempAlloca - This creates an alloca with the default ABI alignment of the given L...
llvm::Value * ExceptionSlot
The exception slot.
This represents '#pragma omp distribute' directive.
llvm::Value * EmitVAStartEnd(llvm::Value *ArgValue, bool IsStart)
Emits a call to an LLVM variable-argument intrinsic, either llvm.va_start or llvm.va_end.
Exposes information about the current target.
llvm::Value * EmitARCStoreWeak(Address addr, llvm::Value *value, bool ignored)
i8* @objc_storeWeak(i8** addr, i8* value) Returns value.
virtual StringRef getHelperName() const
Get the name of the capture helper.
void EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)
Emit code in this function to perform a guarded variable initialization.
llvm::Value * GetVTablePtr(Address This, llvm::Type *VTableTy, const CXXRecordDecl *VTableClass)
GetVTablePtr - Return the Value of the vtable pointer member pointed to by This.
LValue EmitInitListLValue(const InitListExpr *E)
static TypeEvaluationKind getEvaluationKind(QualType T)
hasAggregateLLVMType - Return true if the specified AST type will map into an aggregate LLVM type or ...
void EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst)
CXXDtorType
C++ destructor types.
llvm::Value * getPointer() const
llvm::Value * EmitBuiltinAvailable(ArrayRef< llvm::Value * > Args)
llvm::BasicBlock * EHResumeBlock
EHResumeBlock - Unified block containing a call to llvm.eh.resume.
void EmitCapturedLocals(CodeGenFunction &ParentCGF, const Stmt *OutlinedStmt, bool IsFilter)
Scan the outlined statement for captures from the parent function.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
llvm::Function * generateDestroyHelper(Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray, const VarDecl *VD)
generateDestroyHelper - Generates a helper function which, when invoked, destroys the given object...
Expr - This represents one expression.
void enter(CodeGenFunction &CGF, const Stmt *Finally, llvm::Constant *beginCatchFn, llvm::Constant *endCatchFn, llvm::Constant *rethrowFn)
Enters a finally block for an implementation using zero-cost exceptions.
void EmitARCMoveWeak(Address dst, Address src)
void @objc_moveWeak(i8** dest, i8** src) Disregards the current value in dest.
void EmitAutoVarInit(const AutoVarEmission &emission)
Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited...
LValue EmitCXXTypeidLValue(const CXXTypeidExpr *E)
llvm::Value * EmitComplexToScalarConversion(ComplexPairTy Src, QualType SrcTy, QualType DstTy, SourceLocation Loc)
Emit a conversion from the specified complex type to the specified destination type, where the destination type is an LLVM scalar type.
llvm::function_ref< void(CodeGenFunction &, SourceLocation, const unsigned, const bool)> CodeGenOrderedTy
void EmitCaseStmt(const CaseStmt &S)
RValue EmitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *E)
llvm::Function * GenerateSEHFilterFunction(CodeGenFunction &ParentCGF, const SEHExceptStmt &Except)
Create a stub filter function that will ultimately hold the code of the filter expression.
static ParamValue forIndirect(Address addr)
void pushCallObjectDeleteCleanup(const FunctionDecl *OperatorDelete, llvm::Value *CompletePtr, QualType ElementType)
void GenerateObjCMethod(const ObjCMethodDecl *OMD)
Generate an Objective-C method.
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, RValue rvalue)
void EmitCallArgs(CallArgList &Args, const T *CallArgTypeInfo, llvm::iterator_range< CallExpr::const_arg_iterator > ArgRange, AbstractCallee AC=AbstractCallee(), unsigned ParamsToSkip=0, EvaluationOrder Order=EvaluationOrder::Default)
EmitCallArgs - Emit call arguments for a function.
void EmitOMPTeamsDirective(const OMPTeamsDirective &S)
void EmitVTableAssumptionLoad(const VPtr &vptr, Address This)
Emit assumption that vptr load == global vtable.
void ForceCleanup()
Force the emission of cleanups now, instead of waiting until this object is destroyed.
void EmitCXXAggrConstructorCall(const CXXConstructorDecl *D, const ArrayType *ArrayTy, Address ArrayPtr, const CXXConstructExpr *E, bool ZeroInitialization=false)
EmitCXXAggrConstructorCall - Emit a loop to call a particular constructor for each of several members...
static bool isObjCMethodWithTypeParams(const ObjCMethodDecl *method)
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a C++ destructor within a class.
llvm::Value * EmitSEHExceptionInfo()
Address EmitCompoundStmt(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
EmitCompoundStmt - Emit a compound statement {..} node.
llvm::Constant * GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo)
Generate the destroy-helper function for a block closure object: static void block_destroy_helper(blo...
This represents '#pragma omp target teams distribute parallel for simd' combined directive.
static saved_type save(CodeGenFunction &CGF, type value)
void SetFPAccuracy(llvm::Value *Val, float Accuracy)
SetFPAccuracy - Set the minimum required accuracy of the given floating point operation, expressed as the maximum relative error in ulp.
AggValueSlot CreateAggTemp(QualType T, const Twine &Name="tmp")
CreateAggTemp - Create a temporary memory object for the given aggregate type.
llvm::AllocaInst * NormalCleanupDest
i32s containing the indexes of the cleanup destinations.
void EmitLambdaBlockInvokeBody()
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
DeclContext * getDeclContext()
void EmitSEHTryStmt(const SEHTryStmt &S)
ASTContext & getContext() const
llvm::Value * EmitToMemory(llvm::Value *Value, QualType Ty)
EmitToMemory - Change a scalar value from its value representation to its in-memory representation...
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
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
llvm::Value * getAnyValue() const
CXXTryStmt - A C++ try block, including all handlers.
void EmitOMPLinearClauseInit(const OMPLoopDirective &D)
Emit initial code for linear variables.
void generateObjCSetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, llvm::Constant *AtomicHelperFn)
~OMPPrivateScope()
Exit scope - all the mapped variables are restored.
llvm::Value * getExceptionFromSlot()
Returns the contents of the function's exception object and selector slots.
This represents '#pragma omp target teams distribute simd' combined directive.
void EmitAsanPrologueOrEpilogue(bool Prologue)
llvm::Value * EmitARCAutorelease(llvm::Value *value)
Autorelease the given object.
void EmitStoreOfScalar(llvm::Value *Value, Address Addr, bool Volatile, QualType Ty, LValueBaseInfo BaseInfo=LValueBaseInfo(AlignmentSource::Type), llvm::MDNode *TBAAInfo=nullptr, bool isInit=false, QualType TBAABaseTy=QualType(), uint64_t TBAAOffset=0, bool isNontemporal=false)
EmitStoreOfScalar - Store a scalar value to an address, taking care to appropriately convert from the...
stable_iterator stable_begin() const
Create a stable reference to the top of the EH stack.
llvm::LLVMContext & getLLVMContext()
llvm::BasicBlock * GetIndirectGotoBlock()
llvm::Value * OldCXXThisValue
bool currentFunctionUsesSEHTry() const
void EmitNullabilityCheck(LValue LHS, llvm::Value *RHS, SourceLocation Loc)
Given an assignment *LHS = RHS, emit a test that checks if RHS is nonnull, if LHS is marked _Nonnull...
void EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Dest)
Checking the value assigned to a _Nonnull pointer. Must not be null.
An RAII object to record that we're evaluating a statement expression.
RValue EmitCXXMemberOrOperatorMemberCallExpr(const CallExpr *CE, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue, bool HasQualifier, NestedNameSpecifier *Qualifier, bool IsArrow, const Expr *Base)
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.
unsigned getNumParams() const
void EmitOMPMasterDirective(const OMPMasterDirective &S)
~ArrayInitLoopExprScope()
llvm::Function * GenerateCapturedStmtFunction(const CapturedStmt &S)
Creates the outlined function for a CapturedStmt.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
This represents '#pragma omp target teams' directive.
LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T)
An expression that sends a message to the given Objective-C object or class.
Address EmitPointerWithAlignment(const Expr *Addr, LValueBaseInfo *BaseInfo=nullptr)
EmitPointerWithAlignment - Given an expression with a pointer type, emit the value and compute our be...
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 EmitAggregateCopyCtor(Address DestPtr, Address SrcPtr, QualType DestTy, QualType SrcTy)
An object which temporarily prevents a value from being destroyed by aggressive peephole optimization...
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
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
void emitArrayDestroy(llvm::Value *begin, llvm::Value *end, QualType elementType, CharUnits elementAlign, Destroyer *destroyer, bool checkZeroLength, bool useEHCleanup)
emitArrayDestroy - Destroys all the elements of the given array, beginning from last to first...
ConstantEmission tryEmitAsConstant(DeclRefExpr *refExpr)
Try to emit a reference to the given value without producing it as an l-value.
The scope of a CXXDefaultInitExpr.
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)
EmitCXXGlobalVarDeclInit - Create the initializer for a C++ variable with global storage.
RValue EmitLoadOfBitfieldLValue(LValue LV, SourceLocation Loc)
static AggValueSlot forAddr(Address addr, Qualifiers quals, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, IsZeroed_t isZeroed=IsNotZeroed)
forAddr - Make a slot for an aggregate value.
RValue EmitAtomicLoad(LValue LV, SourceLocation SL, AggValueSlot Slot=AggValueSlot::ignored())
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)
GlobalDecl - represents a global declaration.
bool isCXXThisExprCaptured() const
This represents '#pragma omp flush' directive.
SanitizerScope(CodeGenFunction *CGF)
This represents '#pragma omp parallel for simd' directive.
DoStmt - This represents a 'do/while' stmt.
AsmStmt is the base class for GCCAsmStmt and MSAsmStmt.
void EmitDeclStmt(const DeclStmt &S)
llvm::Value * EmitAMDGPUBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
LValue EmitLoadOfPointerLValue(Address Ptr, const PointerType *PtrTy)
llvm::BasicBlock * getEHDispatchBlock(EHScopeStack::stable_iterator scope)
VarBypassDetector Bypasses
The l-value was considered opaque, so the alignment was determined from a type.
llvm::Value * EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void EmitAlignmentAssumption(llvm::Value *PtrValue, unsigned Alignment, llvm::Value *OffsetValue=nullptr)
void setBlockContextParameter(const ImplicitParamDecl *D, unsigned argNum, llvm::Value *ptr)
llvm::function_ref< void(CodeGenFunction &, const OMPLoopDirective &, JumpDest)> CodeGenLoopTy
void enterByrefCleanup(const AutoVarEmission &emission)
Enter a cleanup to destroy a __block variable.
CGCallee EmitCallee(const Expr *E)
This represents '#pragma omp target enter data' directive.
void EmitOMPFlushDirective(const OMPFlushDirective &S)
OMPPrivateScope(CodeGenFunction &CGF)
Enter a new OpenMP private scope.
The scope of an ArrayInitLoopExpr.
bool HaveInsertPoint() const
HaveInsertPoint - True if an insertion point is defined.
Address recoverAddrOfEscapedLocal(CodeGenFunction &ParentCGF, Address ParentVar, llvm::Value *ParentFP)
Recovers the address of a local in a parent function.
static bool needsSaving(type value)
llvm::SmallVector< VPtr, 4 > VPtrsVector
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
bool SawAsmBlock
Whether we processed a Microsoft-style asm block during CodeGen.
RValue EmitNVPTXDevicePrintfCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue)
llvm::GlobalVariable * AddInitializerToStaticVarDecl(const VarDecl &D, llvm::GlobalVariable *GV)
AddInitializerToStaticVarDecl - Add the initializer for 'D' to the global variable that has already b...
This captures a statement into a function.
Represents a call to an inherited base class constructor from an inheriting constructor.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
LValue EmitVAArgExprLValue(const VAArgExpr *E)
llvm::Value * EmitCXXTypeidExpr(const CXXTypeidExpr *E)
~FieldConstructionScope()
void PushDestructorCleanup(QualType T, Address Addr)
PushDestructorCleanup - Push a cleanup to call the complete-object destructor of an object of the giv...
ASTContext & getContext() const
void pushDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)
pushDestroy - Push the standard destructor for the given type as at least a normal cleanup...
This represents '#pragma omp single' directive.
Encodes a location in the source.
bool LValueIsSuitableForInlineAtomic(LValue Src)
An LValue is a candidate for having its loads and stores be made atomic if we are operating under /vo...
llvm::Value * EmitObjCArrayLiteral(const ObjCArrayLiteral *E)
void EnsureInsertPoint()
EnsureInsertPoint - Ensure that an insertion point is defined so that emitted IR has a place to go...
void EmitARCIntrinsicUse(ArrayRef< llvm::Value * > values)
Given a number of pointers, inform the optimizer that they're being intrinsically used up until this ...
void EmitOMPForDirective(const OMPForDirective &S)
void EmitARCRelease(llvm::Value *value, ARCPreciseLifetime_t precise)
Release the given object.
LValue EmitDeclRefLValue(const DeclRefExpr *E)
std::pair< LValue, llvm::Value * > EmitARCStoreUnsafeUnretained(const BinaryOperator *e, bool ignored)
A saved depth on the scope stack.
std::unique_ptr< CGCoroData > Data
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Represents a C++ temporary.
llvm::Value * EvaluateExprAsBool(const Expr *E)
EvaluateExprAsBool - Perform the usual unary conversions on the specified expression and compare the ...
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)
EmitFromMemory - Change a scalar value from its memory representation to its value representation...
llvm::BasicBlock * getUnreachableBlock()
void setBeforeOutermostConditional(llvm::Value *value, Address addr)
This is a basic class for representing single OpenMP executable directive.
void EmitVTableAssumptionLoads(const CXXRecordDecl *ClassDecl, Address This)
Emit assumption load for all bases.
SmallVector< llvm::Value *, 8 > ObjCEHValueStack
ObjCEHValueStack - Stack of Objective-C exception values, used for rethrows.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
void EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S)
llvm::Value * EmitARCUnsafeClaimAutoreleasedReturnValue(llvm::Value *value)
Claim a possibly-autoreleased return value at +0.
Represents a call to a member function that may be written either with member call syntax (e...
bool isCleanupPadScope() const
Returns true while emitting a cleanuppad.
LValue EmitAggExprToLValue(const Expr *E)
EmitAggExprToLValue - Emit the computation of the specified expression of aggregate type into a tempo...
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
RValue EmitCoroutineIntrinsic(const CallExpr *E, unsigned int IID)
void DeactivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
DeactivateCleanupBlock - Deactivates the given cleanup block.
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Checking the operand of a cast to a base object.
OpenMPDirectiveKind
OpenMP directives.
LabelDecl - Represents the declaration of a label.
CharUnits OldCXXThisAlignment
llvm::Constant * createAtExitStub(const VarDecl &VD, llvm::Constant *Dtor, llvm::Constant *Addr)
Create a stub function, suitable for being passed to atexit, which passes the given address to the gi...
const BlockByrefInfo & getBlockByrefInfo(const VarDecl *var)
BuildByrefInfo - This routine changes a __block variable declared as T x into:
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 ...
void EmitOMPLinearClauseFinal(const OMPLoopDirective &D, const llvm::function_ref< llvm::Value *(CodeGenFunction &)> &CondGen)
Emit final code for linear clauses.
LValue EmitUnsupportedLValue(const Expr *E, const char *Name)
EmitUnsupportedLValue - Emit a dummy l-value using the type of E and issue an ErrorUnsupported style ...
llvm::Value * EmitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E)
Represents a static or instance method of a struct/union/class.
static type restore(CodeGenFunction &CGF, saved_type value)
OpenMPLinearClauseKind Modifier
Modifier of 'linear' clause.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
This represents '#pragma omp taskwait' directive.
void EmitOMPTaskgroupDirective(const OMPTaskgroupDirective &S)
SanitizerSet SanOpts
Sanitizers enabled for this function.
void EmitOMPTargetParallelForSimdDirective(const OMPTargetParallelForSimdDirective &S)
ObjCCategoryDecl - Represents a category declaration.
This is a basic class for representing single OpenMP clause.
bool isTrivialInitializer(const Expr *Init)
Determine whether the given initializer is trivial in the sense that it requires no code to be genera...
void EmitOMPTeamsDistributeSimdDirective(const OMPTeamsDistributeSimdDirective &S)
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>.
void EmitCXXTemporary(const CXXTemporary *Temporary, QualType TempType, Address Ptr)
Emits all the code to cause the given temporary to be cleaned up.
llvm::Value * EmitNeonCall(llvm::Function *F, SmallVectorImpl< llvm::Value * > &O, const char *name, unsigned shift=0, bool rightshift=false)
ObjCProtocolExpr used for protocol expression in Objective-C.
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)
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.
void PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize, std::initializer_list< llvm::Value ** > ValuesToReload={})
Takes the old cleanup stack size and emits the cleanup blocks that have been added.
const LangOptions & getLangOpts() const
llvm::BasicBlock * getEHResumeBlock(bool isCleanup)
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
static Destroyer emitARCIntrinsicUse
void EmitOMPForSimdDirective(const OMPForSimdDirective &S)
All available information about a concrete callee.
llvm::Instruction * CurrentFuncletPad
LValue EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E)
void EmitOMPAtomicDirective(const OMPAtomicDirective &S)
JumpDest getJumpDestInCurrentScope(llvm::BasicBlock *Target)
The given basic block lies in the current EH scope, but may be a target of a potentially scope-crossi...
void exit(CodeGenFunction &CGF)
void EmitOMPSectionDirective(const OMPSectionDirective &S)
void EmitOMPSectionsDirective(const OMPSectionsDirective &S)
RValue EmitCXXMemberPointerCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue)
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues, like target-specific attributes, builtins and so on.
Checking the object expression in a non-static data member access.
This represents '#pragma omp ordered' directive.
void EmitParmDecl(const VarDecl &D, ParamValue Arg, unsigned ArgNo)
EmitParmDecl - Emit a ParmVarDecl or an ImplicitParamDecl.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
static ParamValue forDirect(llvm::Value *value)
static llvm::Value * restore(CodeGenFunction &CGF, saved_type value)
void EmitForStmt(const ForStmt &S, ArrayRef< const Attr * > Attrs=None)
This represents '#pragma omp target update' directive.
ObjCBoxedExpr - used for generalized expression boxing.
void EmitOMPTaskLoopDirective(const OMPTaskLoopDirective &S)
RValue EmitCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue=ReturnValueSlot())
RValue EmitBuiltinNewDeleteCall(const FunctionProtoType *Type, const Expr *Arg, bool IsDelete)
llvm::Value * EmitARCRetain(QualType type, llvm::Value *value)
Produce the code to do a retain.
Address EmitMSVAListRef(const Expr *E)
Emit a "reference" to a __builtin_ms_va_list; this is always the value of the expression, because a __builtin_ms_va_list is a pointer to a char.
const CGFunctionInfo * CurFnInfo
void EmitStartEHSpec(const Decl *D)
EmitStartEHSpec - Emit the start of the exception spec.
void Emit(CodeGenFunction &CGF, Flags flags) override
Emit the cleanup.
void EmitInlinedInheritingCXXConstructorCall(const CXXConstructorDecl *Ctor, CXXCtorType CtorType, bool ForVirtualBase, bool Delegating, CallArgList &Args)
Emit a call to an inheriting constructor (that is, one that invokes a constructor inherited from a ba...
CapturedRegionKind getKind() const
static ConstantEmission forReference(llvm::Constant *C)
void enterFullExpression(const ExprWithCleanups *E)
void EmitDecl(const Decl &D)
EmitDecl - Emit a declaration.
static Destroyer destroyARCStrongImprecise
void FinishFunction(SourceLocation EndLoc=SourceLocation())
FinishFunction - Complete IR generation of the current function.
CXXCtorType
C++ constructor types.
void EmitObjCMRRAutoreleasePoolPop(llvm::Value *Ptr)
Produce the code to do a primitive release.
CompoundAssignOperator - For compound assignments (e.g.
void InitializeVTablePointer(const VPtr &vptr)
Initialize the vtable pointer of the given subobject.
Address EmitVAListRef(const Expr *E)
JumpDest getOMPCancelDestination(OpenMPDirectiveKind Kind)
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type, returning the result.
! Language semantics require right-to-left evaluation.
FunctionArgList - Type for representing both the decl and type of parameters to a function...
llvm::BasicBlock * getMSVCDispatchBlock(EHScopeStack::stable_iterator scope)
void GenerateOpenMPCapturedVars(const CapturedStmt &S, SmallVectorImpl< llvm::Value * > &CapturedVars)
void EmitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt &S)
CGFunctionInfo - Class to encapsulate the information about a function definition.
llvm::Value * EmitNeonRShiftImm(llvm::Value *Vec, llvm::Value *Amt, llvm::Type *Ty, bool usgn, const char *name)
CharUnits getAlignment() const
Return the alignment of this pointer.
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
This class organizes the cross-function state that is used while generating LLVM code.
void EmitDeclRefExprDbgValue(const DeclRefExpr *E, const APValue &Init)
void EmitOMPTargetTeamsDirective(const OMPTargetTeamsDirective &S)
Class provides a way to call simple version of codegen for OpenMP region, or an advanced with possibl...
Address getObjectAddress(CodeGenFunction &CGF) const
Returns the address of the object within this declaration.
void EmitCXXDestructorCall(const CXXDestructorDecl *D, CXXDtorType Type, bool ForVirtualBase, bool Delegating, Address This)
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.
Address LoadBlockStruct()
LValue InitCapturedStruct(const CapturedStmt &S)
[C99 6.4.2.2] - A predefined identifier such as func.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Address EmitFieldAnnotations(const FieldDecl *D, Address V)
Emit field annotations for the given field & value.
RValue EmitUnsupportedRValue(const Expr *E, const char *Name)
EmitUnsupportedRValue - Emit a dummy r-value using the type of E and issue an ErrorUnsupported style ...
static bool shouldBindAsLValue(const Expr *expr)
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
void GenerateObjCGetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
GenerateObjCGetter - Synthesize an Objective-C property getter function.
bool isZero() const
isZero - Test whether the quantity equals zero.
void EmitOMPTargetParallelDirective(const OMPTargetParallelDirective &S)
llvm::Value * getDirectValue() const
void EmitObjCAutoreleasePoolPop(llvm::Value *Ptr)
Produce the code to do a primitive release.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
virtual ~CGCapturedStmtInfo()
static AggValueSlot ignored()
ignored - Returns an aggregate value slot indicating that the aggregate value is being ignored...
CodeGenFunction::ComplexPairTy ComplexPairTy
void EmitOMPParallelForDirective(const OMPParallelForDirective &S)
llvm::Value * EmitARCLoadWeakRetained(Address addr)
i8* @objc_loadWeakRetained(i8** addr)
void EmitAnyExprToExn(const Expr *E, Address Addr)
This represents '#pragma omp section' directive.
This represents '#pragma omp teams distribute' directive.
A scope within which we are constructing the fields of an object which might use a CXXDefaultInitExpr...
llvm::Value * EmitAnnotationCall(llvm::Value *AnnotationFn, llvm::Value *AnnotatedVal, StringRef AnnotationStr, SourceLocation Location)
Emit an annotation call (intrinsic or builtin).
llvm::Value * EmitWebAssemblyBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::LoadInst * CreateAlignedLoad(llvm::Value *Addr, CharUnits Align, const llvm::Twine &Name="")
void EmitOMPPrivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
void EmitOMPTargetParallelForDirective(const OMPTargetParallelForDirective &S)
Checking the bound value in a reference binding.
LValue EmitCallExprLValue(const CallExpr *E)
LValue EmitPseudoObjectLValue(const PseudoObjectExpr *e)
This represents '#pragma omp simd' directive.
Represents a 'co_yield' expression.
void EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor, const FunctionArgList &Args)
StmtExprEvaluation(CodeGenFunction &CGF)
void InitializeVTablePointers(const CXXRecordDecl *ClassDecl)
void EmitOMPLinearClause(const OMPLoopDirective &D, CodeGenFunction::OMPPrivateScope &PrivateScope)
Emit initial code for linear clauses.
static LValue MakeAddr(Address address, QualType type, ASTContext &Context, LValueBaseInfo BaseInfo, llvm::MDNode *TBAAInfo=nullptr)
Address getIndirectAddress() const
void EmitOMPTeamsDistributeParallelForDirective(const OMPTeamsDistributeParallelForDirective &S)
QualType TypeOfSelfObject()
TypeOfSelfObject - Return type of object that this self represents.
Checking the destination of a store. Must be suitably sized and aligned.
detail::InMemoryDirectory::const_iterator E
A pointer to member type per C++ 8.3.3 - Pointers to members.
void EmitAggregateCopy(Address DestPtr, Address SrcPtr, QualType EltTy, bool isVolatile=false, bool isAssignment=false)
EmitAggregateCopy - Emit an aggregate copy.
bool EmitOMPFirstprivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
void EmitOMPCancelDirective(const OMPCancelDirective &S)
llvm::SmallVector< char, 256 > LifetimeExtendedCleanupStack
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
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)
Address getNormalCleanupDestSlot()
const Decl * getDecl() const
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).
bool hasFunctionDecl() const
void EmitAggExpr(const Expr *E, AggValueSlot AS)
EmitAggExpr - Emit the computation of the specified expression of aggregate type. ...
void EmitCoreturnStmt(const CoreturnStmt &S)
Represents a __leave statement.
JumpDest ReturnBlock
ReturnBlock - Unified return block.
llvm::DenseMap< const Decl *, Address > DeclMapTy
Checking the operand of a static_cast to a derived reference type.
static bool hasAggregateEvaluationKind(QualType T)
void EmitOMPReductionClauseFinal(const OMPExecutableDirective &D, const OpenMPDirectiveKind ReductionKind)
Emit final update of reduction values to original variables at the end of the directive.
llvm::Value * EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx)
SwitchStmt - This represents a 'switch' stmt.
void EmitAutoVarCleanups(const AutoVarEmission &emission)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
API for captured statement code generation.
static saved_type save(CodeGenFunction &CGF, type value)
static bool isObjCMethodWithTypeParams(const T *)
Represents the body of a coroutine.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
llvm::Type * ConvertType(const TypeDecl *T)
const LValue & getOpaqueLValueMapping(const OpaqueValueExpr *e)
getOpaqueLValueMapping - Given an opaque value expression (which must be mapped to an l-value)...
void EmitBlockWithFallThrough(llvm::BasicBlock *BB, const Stmt *S)
When instrumenting to collect profile data, the counts for some blocks such as switch cases need to n...
llvm::Value * vectorWrapScalar16(llvm::Value *Op)
llvm::DebugLoc SourceLocToDebugLoc(SourceLocation Location)
Converts Location to a DebugLoc, if debug information is enabled.
const T * getAs() const
Member-template getAs<specific type>'.
Checking the operand of a static_cast to a derived pointer type.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
CharUnits OffsetFromNearestVBase
Represents Objective-C's collection statement.
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
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.
ObjCEncodeExpr, used for @encode in Objective-C.
static void EmitOMPTargetTeamsDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDirective &S)
LValue EmitArraySubscriptExpr(const ArraySubscriptExpr *E, bool Accessed=false)
A stack of loop information corresponding to loop nesting levels.
void EmitAsmStmt(const AsmStmt &S)
llvm::Value * EmitNeonShiftVector(llvm::Value *V, llvm::Type *Ty, bool negateForRightShift)
This class organizes the cross-module state that is used while lowering AST types to LLVM types...
void EmitOMPTaskBasedDirective(const OMPExecutableDirective &S, const RegionCodeGenTy &BodyGen, const TaskGenTy &TaskGen, OMPTaskDataTy &Data)
Represents a call to a CUDA kernel function.
Represents a 'co_await' expression.
RValue EmitRValueForField(LValue LV, const FieldDecl *FD, SourceLocation Loc)
const TargetInfo & Target
void EmitLambdaStaticInvokeFunction(const CXXMethodDecl *MD)
bool has(SanitizerMask K) const
Check if a certain (single) sanitizer is enabled.
llvm::AssertingVH< llvm::Instruction > AllocaInsertPt
AllocaInsertPoint - This is an instruction in the entry block before which we prefer to insert alloca...
bool isFunctionType() const
LValue EmitLValueForIvar(QualType ObjectTy, llvm::Value *Base, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers)
LValue EmitLoadOfReferenceLValue(Address Ref, const ReferenceType *RefTy)
QualType BuildFunctionArgList(GlobalDecl GD, FunctionArgList &Args)
void EmitScalarInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
Base for LValueReferenceType and RValueReferenceType.
void EmitSynthesizedCXXCopyCtor(Address Dest, Address Src, const Expr *Exp)
bool hasProfileClangInstr() const
Check if Clang profile instrumenation is on.
llvm::Value * EmitIvarOffset(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)
llvm::Value * EmitARCRetainAutorelease(QualType type, llvm::Value *value)
Do a fused retain/autorelease of the given object.
LValue EmitCastLValue(const CastExpr *E)
EmitCastLValue - Casts are never lvalues unless that cast is to a reference type. ...
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
void EmitOMPTargetEnterDataDirective(const OMPTargetEnterDataDirective &S)
void EmitARCInitWeak(Address addr, llvm::Value *value)
i8* @objc_initWeak(i8** addr, i8* value) Returns value.
void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
void checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl)
FieldDecl * LambdaThisCaptureField
const ParmVarDecl * getParamDecl(unsigned I) const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
llvm::Value * LoadCXXVTT()
LoadCXXVTT - Load the VTT parameter to base constructors/destructors have virtual bases...
ARCPreciseLifetime_t
Does an ARC strong l-value have precise lifetime?
ComplexPairTy EmitComplexExpr(const Expr *E, bool IgnoreReal=false, bool IgnoreImag=false)
EmitComplexExpr - Emit the computation of the specified expression of complex type, returning the result.
void EmitMCountInstrumentation()
EmitMCountInstrumentation - Emit call to .mcount.
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 EmitOMPDistributeSimdDirective(const OMPDistributeSimdDirective &S)
VPtrsVector getVTablePointers(const CXXRecordDecl *VTableClass)
const Decl * CurFuncDecl
CurFuncDecl - Holds the Decl for the current outermost non-closure context.
A pair of helper functions for a __block variable.
void EmitStopPoint(const Stmt *S)
EmitStopPoint - Emit a debug stoppoint if we are emitting debug info.
GotoStmt - This represents a direct goto.
Address LoadCXXThisAddress()
DominatingLLVMValue::saved_type SavedValue
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const Expr *e)
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
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...
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
void unprotectFromPeepholes(PeepholeProtection protection)
void EmitOMPReductionClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
Emit initial code for reduction variables.
void EmitCallAndReturnForThunk(llvm::Constant *Callee, const ThunkInfo *Thunk)
A non-RAII class containing all the information about a bound opaque value.
This represents '#pragma omp target parallel' directive.
void EmitOMPTargetTeamsDistributeDirective(const OMPTargetTeamsDistributeDirective &S)
void ErrorUnsupported(const Stmt *S, const char *Type)
ErrorUnsupported - Print out an error that codegen doesn't support the specified stmt yet...
true
A convenience builder class for complex constant initializers, especially for anonymous global struct...
Represents a C++ struct/union/class.
void EmitIfStmt(const IfStmt &S)
llvm::Value * EmitObjCCollectionLiteral(const Expr *E, const ObjCMethodDecl *MethodWithObjects)
ContinueStmt - This represents a continue.
void EmitBranch(llvm::BasicBlock *Block)
EmitBranch - Emit a branch to the specified basic block from the current insert block, taking care to avoid creation of branches from dummy blocks.
llvm::PointerIntPair< llvm::Value *, 1, bool > saved_type
LValue EmitCoawaitLValue(const CoawaitExpr *E)
llvm::BasicBlock * getInvokeDest()
void EmitReturnStmt(const ReturnStmt &S)
EmitReturnStmt - Note that due to GCC extensions, this can have an operand if the function returns vo...
llvm::Function * LookupNeonLLVMIntrinsic(unsigned IntrinsicID, unsigned Modifier, llvm::Type *ArgTy, const CallExpr *E)
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
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)
EmitFunctionProlog - Emit the target specific LLVM code to load the arguments for the given function...
static Destroyer destroyCXXObject
static bool IsConstructorDelegationValid(const CXXConstructorDecl *Ctor)
Checks whether the given constructor is a valid subject for the complete-to-base constructor delegati...
ObjCIvarDecl - Represents an ObjC instance variable.
LValue MakeAddrLValue(Address Addr, QualType T, LValueBaseInfo BaseInfo=LValueBaseInfo(AlignmentSource::Type))
static type restore(CodeGenFunction &CGF, saved_type value)
! No language constraints on evaluation order.
WhileStmt - This represents a 'while' stmt.
void EmitCXXDeleteExpr(const CXXDeleteExpr *E)
void EmitOMPUseDevicePtrClause(const OMPClause &C, OMPPrivateScope &PrivateScope, const llvm::DenseMap< const ValueDecl *, Address > &CaptureDeviceAddrMap)
LValue EmitLValue(const Expr *E)
EmitLValue - Emit code to compute a designator that specifies the location of the expression...
Address ReturnValue
ReturnValue - The temporary alloca to hold the return value.
void EmitTrapCheck(llvm::Value *Checked)
Create a basic block that will call the trap intrinsic, and emit a conditional branch to it...
void pushStackRestore(CleanupKind kind, Address SPMem)
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)
EmitLoadOfLValue - Given an expression that represents a value lvalue, this method emits the address ...
llvm::Value * EmitARCRetainBlock(llvm::Value *value, bool mandatory)
Retain the given block, with _Block_copy semantics.
This represents '#pragma omp taskloop simd' directive.
LValue EmitPredefinedLValue(const PredefinedExpr *E)
std::pair< llvm::Value *, QualType > getVLASize(const VariableArrayType *vla)
getVLASize - Returns an LLVM value that corresponds to the size, in non-variably-sized elements...
void generateObjCGetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, const ObjCMethodDecl *GetterMothodDecl, llvm::Constant *AtomicHelperFn)
void EmitVTablePtrCheckForCall(const CXXRecordDecl *RD, llvm::Value *VTable, CFITypeCheckKind TCK, SourceLocation Loc)
EmitVTablePtrCheckForCall - Virtual method MD is being called via VTable.
StringLiteral - This represents a string literal expression, e.g.
Defines the clang::TargetInfo interface.
bool EmitOMPCopyinClause(const OMPExecutableDirective &D)
Emit code for copyin clause in D directive.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
static bool IsWrappedCXXThis(const Expr *E)
Check if E is a C++ "this" pointer wrapped in value-preserving casts.
Address EmitCXXUuidofExpr(const CXXUuidofExpr *E)
void StartObjCMethod(const ObjCMethodDecl *MD, const ObjCContainerDecl *CD)
StartObjCMethod - Begin emission of an ObjCMethod.
llvm::MDNode * getTBAAInfo(QualType QTy)
Address EmitExtVectorElementLValue(LValue V)
Generates lvalue for partial ext_vector access.
LValue EmitCompoundAssignmentLValue(const CompoundAssignOperator *E)
void EnterSEHTryStmt(const SEHTryStmt &S)
void startOutlinedSEHHelper(CodeGenFunction &ParentCGF, bool IsFilter, const Stmt *OutlinedStmt)
Arrange a function prototype that can be called by Windows exception handling personalities.
CGCapturedStmtInfo * CapturedStmtInfo
llvm::Value * EmitScalarConversion(llvm::Value *Src, QualType SrcTy, QualType DstTy, SourceLocation Loc)
Emit a conversion from the specified type to the specified destination type, both of which are LLVM s...
bool useLifetimeMarkers() const
const llvm::function_ref< void(CodeGenFunction &, llvm::Value *, const OMPTaskDataTy &)> TaskGenTy
void EmitObjCAutoreleasePoolCleanup(llvm::Value *Ptr)
This represents '#pragma omp sections' directive.
LValue EmitMemberExpr(const MemberExpr *E)
Struct with all informations about dynamic [sub]class needed to set vptr.
bool hasVolatileMember(QualType T)
hasVolatileMember - returns true if aggregate type has a volatile member.
stable_iterator getInnermostNormalCleanup() const
Returns the innermost normal cleanup on the stack, or stable_end() if there are no normal cleanups...
This represents '#pragma omp target data' directive.
void EmitOMPTargetExitDataDirective(const OMPTargetExitDataDirective &S)
A reference to a declared variable, function, enum, etc.
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.
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)
EmitSimpleStmt - Try to emit a "simple" statement which does not necessarily require an insertion poi...
void EmitCfiSlowPathCheck(SanitizerMask Kind, llvm::Value *Cond, llvm::ConstantInt *TypeId, llvm::Value *Ptr, ArrayRef< llvm::Constant * > StaticArgs)
Emit a slow path cross-DSO CFI check which calls __cfi_slowpath if Cond if false. ...
void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
This structure provides a set of types that are commonly used during IR emission. ...
BreakStmt - This represents a break.
static void EmitOMPTargetDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetDirective &S)
Emit device code for the target directive.
void EmitOMPTargetDataDirective(const OMPTargetDataDirective &S)
void EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr)
CapturedRegionKind
The different kinds of captured statement.
void EmitBranchThroughCleanup(JumpDest Dest)
EmitBranchThroughCleanup - Emit a branch from the current insert block through the normal cleanup han...
void EmitEndEHSpec(const Decl *D)
EmitEndEHSpec - Emit the end of the exception spec.
llvm::Constant * EmitCheckSourceLocation(SourceLocation Loc)
Emit a description of a source location in a format suitable for passing to a runtime sanitizer handl...
Address EmitCompoundStmtWithoutScope(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
void EmitOMPDistributeParallelForDirective(const OMPDistributeParallelForDirective &S)
llvm::Value * LoadObjCSelf()
LoadObjCSelf - Load the value of self.
const CXXRecordDecl * VTableClass
CodeGenTypes & getTypes() const
A trivial tuple used to represent a source range.
void EmitObjCAtTryStmt(const ObjCAtTryStmt &S)
LValue - This represents an lvalue references.
An abstract representation of regular/ObjC call/message targets.
llvm::BlockAddress * GetAddrOfLabel(const LabelDecl *L)
void EmitWhileStmt(const WhileStmt &S, ArrayRef< const Attr * > Attrs=None)
This represents '#pragma omp taskyield' directive.
Information for lazily generating a cleanup.
void EmitVarAnnotations(const VarDecl *D, llvm::Value *V)
Emit local annotations for the local variable V, declared by D.
This represents '#pragma omp distribute parallel for simd' composite directive.
llvm::Value * EmitObjCConsumeObject(QualType T, llvm::Value *Ptr)
Produce the code for a CK_ARCConsumeObject.
Represents a C array with a specified size that is not an integer-constant-expression.
This represents '#pragma omp parallel sections' directive.
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
bool CurFuncIsThunk
In C++, whether we are code generating a thunk.
void EmitBlockAfterUses(llvm::BasicBlock *BB)
EmitBlockAfterUses - Emit the given block somewhere hopefully near its uses, and leave the insertion ...
void EmitCfiCheckStub()
Emit a stub for the cross-DSO CFI check function.
LValue MakeAddrLValue(llvm::Value *V, QualType T, CharUnits Alignment, LValueBaseInfo BaseInfo=LValueBaseInfo(AlignmentSource::Type))
void EmitBreakStmt(const BreakStmt &S)
llvm::Value * emitArrayLength(const ArrayType *arrayType, QualType &baseType, Address &addr)
emitArrayLength - Compute the length of an array, even if it's a VLA, and drill down to the base elem...
RValue EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue)
void EmitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt &S)
static bool containsBreak(const Stmt *S)
containsBreak - Return true if the statement contains a break out of it.
Address GetAddressOfBaseClass(Address Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue, SourceLocation Loc)
GetAddressOfBaseClass - This function will add the necessary delta to the load of 'this' and returns ...
CallArgList - Type for representing both the value and type of arguments in a call.
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, LValue lvalue)
Address CreateMemTemp(QualType T, const Twine &Name="tmp", bool CastToDefaultAddrSpace=true)
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignment...
void PopCleanupBlock(bool FallThroughIsBranchThrough=false)
PopCleanupBlock - Will pop the cleanup entry on the stack and process all branch fixups.
Represents Objective-C's @autoreleasepool Statement.
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *OV)
Build the opaque value mapping for an OpaqueValueExpr whose source expression is set to the expressio...
LValue EmitStringLiteralLValue(const StringLiteral *E)
void EmitOMPTaskDirective(const OMPTaskDirective &S)
Address emitBlockByrefAddress(Address baseAddr, const VarDecl *V, bool followForward=true)
BuildBlockByrefAddress - Computes the location of the data in a variable which is declared as __block...
void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint=true)
llvm::Value * EmitVTableTypeCheckedLoad(const CXXRecordDecl *RD, llvm::Value *VTable, uint64_t VTableByteOffset)
Emit a type checked load from the given vtable.
This represents '#pragma omp target parallel for' directive.
llvm::Value * EmitTargetBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
EmitTargetBuiltinExpr - Emit the given builtin call.
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...
void BuildBlockRelease(llvm::Value *DeclPtr, BlockFieldFlags flags)
RValue EmitCall(const CGFunctionInfo &CallInfo, const CGCallee &Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, llvm::Instruction **callOrInvoke=nullptr)
EmitCall - Generate a call of the given function, expecting the given result type, and using the given argument list which specifies both the LLVM arguments and the types they were derived from.
llvm::SmallVector< const JumpDest *, 2 > SEHTryEpilogueStack
void EmitOMPTargetTeamsDistributeParallelForDirective(const OMPTargetTeamsDistributeParallelForDirective &S)
llvm::Value * EmitSystemZBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
bool Privatize()
Privatizes local variables previously registered as private.
bool hasLabelBeenSeenInCurrentScope() const
Return true if a label was seen in the current scope.
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.
void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty)
llvm::Value * EmitObjCProtocolExpr(const ObjCProtocolExpr *E)
llvm::Constant * getValue() const
static unsigned getAccessedFieldNo(unsigned Idx, const llvm::Constant *Elts)
getAccessedFieldNo - Given an encoded value and a result number, return the input field number being ...
This represents '#pragma omp taskloop' directive.