14 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
15 #define LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
34 #include "llvm/ADT/ArrayRef.h"
35 #include "llvm/ADT/DenseMap.h"
36 #include "llvm/ADT/SmallVector.h"
37 #include "llvm/IR/ValueHandle.h"
38 #include "llvm/Support/Debug.h"
54 class CXXDestructorDecl;
55 class CXXForRangeStmt;
59 class EnumConstantDecl;
61 class FunctionProtoType;
63 class ObjCContainerDecl;
64 class ObjCInterfaceDecl;
67 class ObjCImplementationDecl;
68 class ObjCPropertyImplDecl;
70 class TargetCodeGenInfo;
72 class ObjCForCollectionStmt;
74 class ObjCAtThrowStmt;
75 class ObjCAtSynchronizedStmt;
76 class ObjCAutoreleasePoolStmt;
84 class BlockByrefHelpers;
87 class BlockFieldFlags;
111 JumpDest() : Block(nullptr), ScopeDepth(), Index(0) {}
115 : Block(Block), ScopeDepth(Depth), Index(Index) {}
117 bool isValid()
const {
return Block !=
nullptr; }
118 llvm::BasicBlock *
getBlock()
const {
return Block; }
128 llvm::BasicBlock *Block;
143 llvm::BasicBlock *BB,
177 :
Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) {}
180 :
Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) {
186 I !=
E; ++
I, ++Field) {
187 if (
I->capturesThis())
188 CXXThisFieldDecl = *Field;
189 else if (
I->capturesVariable())
190 CaptureFields[
I->getCapturedVar()] = *Field;
204 return CaptureFields.lookup(VD);
228 llvm::SmallDenseMap<const VarDecl *, FieldDecl *> CaptureFields;
290 llvm::DenseMap<const VarDecl *, llvm::Value *>
NRVOFlags;
357 llvm::Constant *BeginCatchFn;
361 llvm::AllocaInst *ForEHVar;
365 llvm::AllocaInst *SavedExnVar;
369 llvm::Constant *beginCatchFn, llvm::Constant *endCatchFn,
370 llvm::Constant *rethrowFn);
385 template <
class T,
class... As>
393 typedef std::tuple<typename DominatingValue<As>::saved_type...> SavedTuple;
403 template <
class T,
class... As>
413 static_assert(
sizeof(Header) % llvm::AlignOf<T>::Alignment == 0,
414 "Cleanup will be allocated on misaligned address");
417 new (Buffer +
sizeof(Header)) T(A...);
448 llvm::Instruction *DominatingIP);
458 llvm::Instruction *DominatingIP);
464 size_t LifetimeExtendedCleanupStackSize;
465 bool OldDidCallStackSave;
482 LifetimeExtendedCleanupStackSize =
484 OldDidCallStackSave = CGF.DidCallStackSave;
485 CGF.DidCallStackSave =
false;
492 CGF.DidCallStackSave = OldDidCallStackSave;
494 LifetimeExtendedCleanupStackSize);
507 CGF.DidCallStackSave = OldDidCallStackSave;
509 LifetimeExtendedCleanupStackSize);
526 CGF.CurLexicalScope =
this;
533 Labels.push_back(label);
553 CGF.CurLexicalScope = ParentScope;
563 typedef llvm::DenseMap<const Decl *, Address>
DeclMapTy;
569 DeclMapTy SavedLocals;
570 DeclMapTy SavedPrivates;
587 llvm::function_ref<
Address()> PrivateGen) {
591 if (SavedLocals.count(LocalVD))
return false;
594 auto it =
CGF.LocalDeclMap.find(LocalVD);
595 if (it !=
CGF.LocalDeclMap.end()) {
596 SavedLocals.insert({LocalVD, it->second});
609 SavedPrivates.insert({LocalVD, Addr});
623 copyInto(SavedPrivates,
CGF.LocalDeclMap);
624 SavedPrivates.clear();
625 return !SavedLocals.empty();
630 copyInto(SavedLocals,
CGF.LocalDeclMap);
643 static void copyInto(
const DeclMapTy &src, DeclMapTy &dest) {
644 for (
auto &pair : src) {
645 if (!pair.second.isValid()) {
646 dest.erase(pair.first);
650 auto it = dest.find(pair.first);
651 if (it != dest.end()) {
652 it->second = pair.second;
668 size_t OldLifetimeExtendedStackSize);
709 llvm::BasicBlock *StartBB;
713 : StartBB(CGF.
Builder.GetInsertBlock()) {}
716 assert(CGF.OutermostConditional !=
this);
717 if (!CGF.OutermostConditional)
718 CGF.OutermostConditional =
this;
722 assert(CGF.OutermostConditional !=
nullptr);
723 if (CGF.OutermostConditional ==
this)
724 CGF.OutermostConditional =
nullptr;
741 auto store =
new llvm::StoreInst(value, addr.
getPointer(), &block->back());
757 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
758 CGF.OutermostConditional =
nullptr;
762 CGF.OutermostConditional = SavedOutermostConditional;
771 llvm::Instruction *Inst;
791 : OpaqueValue(ov), BoundLValue(boundLValue) {}
818 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
826 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
838 bool isValid()
const {
return OpaqueValue !=
nullptr; }
839 void clear() { OpaqueValue =
nullptr; }
842 assert(OpaqueValue &&
"no data to unbind!");
845 CGF.OpaqueLValues.erase(OpaqueValue);
847 CGF.OpaqueRValues.erase(OpaqueValue);
870 if (isa<ConditionalOperator>(op))
903 bool DisableDebugInfo;
907 bool DidCallStackSave;
913 llvm::IndirectBrInst *IndirectBranch;
917 DeclMapTy LocalDeclMap;
922 llvm::SmallDenseMap<const ParmVarDecl *, const ImplicitParamDecl *, 2>
927 llvm::DenseMap<llvm::AllocaInst *, int> EscapedLocals;
930 llvm::DenseMap<const LabelDecl*, JumpDest> LabelMap;
934 struct BreakContinue {
935 BreakContinue(JumpDest Break, JumpDest Continue)
936 : BreakBlock(Break), ContinueBlock(Continue) {}
939 JumpDest ContinueBlock;
941 SmallVector<BreakContinue, 8> BreakContinueStack;
946 llvm::MDNode *createProfileWeights(uint64_t TrueCount, uint64_t FalseCount);
947 llvm::MDNode *createProfileWeights(ArrayRef<uint64_t> Weights);
948 llvm::MDNode *createProfileWeightsForLoop(
const Stmt *Cond,
955 PGO.emitCounterIncrement(
Builder, S);
956 PGO.setCurrentStmt(S);
962 if (!Count.hasValue())
969 PGO.setCurrentRegionCount(Count);
975 return PGO.getCurrentRegionCount();
982 llvm::SwitchInst *SwitchInsn;
988 llvm::BasicBlock *CaseRangeBlock;
992 llvm::DenseMap<const OpaqueValueExpr *, LValue> OpaqueLValues;
993 llvm::DenseMap<const OpaqueValueExpr *, RValue> OpaqueRValues;
1001 llvm::DenseMap<const Expr*, llvm::Value*> VLASizeMap;
1005 llvm::BasicBlock *UnreachableBlock;
1008 unsigned NumReturnExprs;
1011 unsigned NumSimpleReturnExprs;
1023 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1024 CGF.CXXDefaultInitExprThis = This;
1027 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1032 Address OldCXXDefaultInitExprThis;
1042 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.
getPointer();
1043 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.
getAlignment();
1088 llvm::DenseMap<const ValueDecl *, BlockByrefInfo> BlockByrefInfos;
1090 llvm::BasicBlock *TerminateLandingPad;
1091 llvm::BasicBlock *TerminateHandler;
1092 llvm::BasicBlock *TrapBB;
1105 llvm::Function *Fn);
1114 if (DisableDebugInfo)
1140 if (!UnreachableBlock) {
1144 return UnreachableBlock;
1153 const auto *FD = dyn_cast_or_null<FunctionDecl>(
CurCodeDecl);
1154 return FD && FD->usesSEHTry();
1182 Destroyer *destroyer,
bool useEHCleanupForArray);
1185 bool useEHCleanupForArray);
1191 bool useEHCleanupForArray);
1194 bool useEHCleanupForArray,
1199 bool checkZeroLength,
bool useEHCleanup);
1216 llvm_unreachable(
"bad destruction kind");
1237 llvm::Constant *AtomicHelperFn);
1248 llvm::Constant *AtomicHelperFn);
1260 const DeclMapTy &ldm,
1261 bool IsLambdaConversionToBlock);
1273 class AutoVarEmission;
1287 bool followForward =
true);
1291 const llvm::Twine &name);
1375 bool BaseIsNonVirtualPrimaryBase,
1377 VisitedVirtualBasesSetTy &VBases, VPtrsVector &vptrs);
1486 llvm::Function *parent =
nullptr,
1487 llvm::BasicBlock *before =
nullptr) {
1512 void EmitBlock(llvm::BasicBlock *BB,
bool IsFinished=
false);
1531 return Builder.GetInsertBlock() !=
nullptr;
1567 bool forPointeeType =
false);
1579 const Twine &
Name =
"tmp");
1581 const Twine &
Name =
"tmp");
1594 const Twine &
Name =
"tmp");
1648 bool ignoreResult =
false);
1673 bool capturedByInit);
1679 const RecordDecl *RD = cast<RecordDecl>(RT->getDecl());
1707 QualType EltTy,
bool isVolatile=
false,
1708 bool isAssignment =
false);
1712 auto it = LocalDeclMap.find(VD);
1713 assert(it != LocalDeclMap.end() &&
1714 "Invalid argument to GetAddrOfLocalVar(), no decl!");
1724 it = OpaqueLValues.find(e);
1725 assert(it != OpaqueLValues.end() &&
"no mapping for opaque value!");
1735 it = OpaqueRValues.find(e);
1736 assert(it != OpaqueRValues.end() &&
"no mapping for opaque value!");
1792 assert(CXXThisValue &&
"no 'this' value for this function");
1793 return CXXThisValue;
1802 assert(CXXStructorImplicitParamValue &&
"no VTT value for this function");
1803 return CXXStructorImplicitParamValue;
1812 bool BaseIsVirtual);
1828 bool NullCheckValue);
1849 bool ForVirtualBase,
bool Delegating,
1867 bool ZeroInitialization =
false);
1873 bool ZeroInitialization =
false);
1878 bool ForVirtualBase,
bool Delegating,
1899 const Expr *Arg,
bool IsDelete);
1946 bool SkipNullCheck =
false);
1952 QualType IndexType,
bool Accessed);
1955 bool isInc,
bool isPre);
1957 bool isInc,
bool isPre);
1980 bool capturedByInit);
2011 bool IsConstantAggregate;
2019 AutoVarEmission(
const VarDecl &variable)
2020 : Variable(&variable), Addr(
Address::
invalid()), NRVOFlag(nullptr),
2022 SizeForLifetimeMarkers(nullptr) {}
2024 bool wasEmittedAsGlobal()
const {
return !Addr.
isValid(); }
2030 return SizeForLifetimeMarkers !=
nullptr;
2034 return SizeForLifetimeMarkers;
2047 if (!IsByRef)
return Addr;
2059 llvm::GlobalValue::LinkageTypes
Linkage);
2129 bool GetLast =
false,
2174 const Stmt *OutlinedStmt);
2261 OMPPrivateScope &PrivateScope);
2263 OMPPrivateScope &PrivateScope);
2288 OMPPrivateScope &PrivateScope);
2306 OMPPrivateScope &PrivateScope);
2359 const Stmt &S,
bool RequiresCleanup,
const Expr *LoopCond,
2360 const Expr *IncExpr,
2378 OMPPrivateScope &LoopScope,
bool Ordered,
Address LB,
2439 llvm::AtomicOrdering AO,
bool IsVolatile =
false,
2445 bool IsVolatile,
bool isInit);
2449 llvm::AtomicOrdering Success = llvm::SequentiallyConsistent,
2450 llvm::AtomicOrdering Failure = llvm::SequentiallyConsistent,
2472 llvm::MDNode *TBAAInfo =
nullptr,
2474 uint64_t TBAAOffset = 0,
2475 bool isNontemporal =
false);
2489 llvm::MDNode *TBAAInfo =
nullptr,
bool isInit =
false,
2491 uint64_t TBAAOffset = 0,
bool isNontemporal =
false);
2543 bool Accessed =
false);
2545 bool IsLowerBound =
true);
2564 llvm::PointerIntPair<llvm::Constant*, 1, bool> ValueAndIsReference;
2566 : ValueAndIsReference(C, isReference) {}
2577 return ValueAndIsReference.getOpaqueValue() !=
nullptr;
2589 return ValueAndIsReference.getPointer();
2612 unsigned CVRQualifiers);
2637 llvm::Instruction **callOrInvoke =
nullptr);
2649 const Twine &name =
"");
2652 const Twine &name =
"");
2654 const Twine &name =
"");
2657 const Twine &name =
"");
2661 const Twine &
Name =
"");
2664 const Twine &name =
"");
2666 const Twine &name =
"");
2713 unsigned BuiltinID,
const CallExpr *E,
2723 const llvm::CmpInst::Predicate Fp,
2724 const llvm::CmpInst::Predicate Ip,
2725 const llvm::Twine &
Name =
"");
2729 unsigned LLVMIntrinsic,
2730 unsigned AltLLVMIntrinsic,
2731 const char *NameHint,
2742 unsigned shift = 0,
bool rightshift =
false);
2745 bool negateForRightShift);
2747 llvm::Type *Ty,
bool usgn,
const char *name);
2789 bool resultIgnored);
2791 bool resultIgnored);
2802 std::pair<LValue,llvm::Value*>
2804 std::pair<LValue,llvm::Value*>
2867 bool IgnoreReal =
false,
2868 bool IgnoreImag =
false);
2887 llvm::GlobalVariable *
2889 llvm::GlobalVariable *GV);
2898 llvm::Constant *Addr);
2903 llvm::Constant *addr);
2922 const std::vector<std::pair<llvm::WeakVH,
2923 llvm::Constant*> > &DtorsAndObjects);
2927 llvm::GlobalVariable *Addr,
2953 StringRef AnnotationStr,
2993 llvm::BasicBlock *FalseBlock, uint64_t TrueCount);
3046 llvm::MDNode *getRangeForLoadFromType(
QualType Ty);
3049 void deferPlaceholderReplacement(llvm::Instruction *Old,
llvm::Value *New);
3052 DeferredReplacements;
3056 assert(!LocalDeclMap.count(VD) &&
"Decl already exists in LocalDeclMap!");
3057 LocalDeclMap.insert({VD, Addr});
3064 void ExpandTypeFromArgs(QualType Ty, LValue Dst,
3070 void ExpandTypeToArgs(QualType Ty, RValue RV, llvm::FunctionType *IRFuncTy,
3071 SmallVectorImpl<llvm::Value *> &IRCallArgs,
3072 unsigned &IRCallArgPos);
3074 llvm::Value* EmitAsmInput(
const TargetInfo::ConstraintInfo &Info,
3075 const Expr *InputExpr, std::string &ConstraintStr);
3077 llvm::Value* EmitAsmInputLValue(
const TargetInfo::ConstraintInfo &Info,
3078 LValue InputValue, QualType InputType,
3079 std::string &ConstraintStr,
3080 SourceLocation Loc);
3085 llvm::Value *evaluateOrEmitBuiltinObjectSize(
const Expr *E,
unsigned Type,
3086 llvm::IntegerType *ResType);
3091 llvm::Value *emitBuiltinObjectSize(
const Expr *E,
unsigned Type,
3092 llvm::IntegerType *ResType);
3101 return classDecl->getTypeParamListAsWritten();
3105 return catDecl->getTypeParamList();
3111 template<
typename T>
3116 template <
typename T>
3118 llvm::iterator_range<CallExpr::const_arg_iterator> ArgRange,
3120 unsigned ParamsToSkip = 0) {
3124 assert((ParamsToSkip == 0 || CallArgTypeInfo) &&
3125 "Can't skip parameters if type info is not provided");
3126 if (CallArgTypeInfo) {
3132 for (
auto I = CallArgTypeInfo->param_type_begin() + ParamsToSkip,
3133 E = CallArgTypeInfo->param_type_end();
3134 I !=
E; ++
I, ++Arg) {
3135 assert(Arg != ArgRange.end() &&
"Running over edge of argument list!");
3136 assert((isGenericMethod ||
3137 ((*I)->isVariablyModifiedType() ||
3138 (*I).getNonReferenceType()->isObjCRetainableType() ||
3145 "type mismatch in call argument!");
3146 ArgTypes.push_back(*
I);
3152 assert((Arg == ArgRange.end() || !CallArgTypeInfo ||
3153 CallArgTypeInfo->isVariadic()) &&
3154 "Extra arguments in non-variadic function!");
3157 for (
auto *A : llvm::make_range(Arg, ArgRange.end()))
3158 ArgTypes.push_back(getVarArgType(A));
3160 EmitCallArgs(Args, ArgTypes, ArgRange, CalleeDecl, ParamsToSkip);
3164 llvm::iterator_range<CallExpr::const_arg_iterator> ArgRange,
3166 unsigned ParamsToSkip = 0);
3199 void EmitDeclMetadata();
3201 BlockByrefHelpers *buildByrefHelpers(llvm::StructType &byrefType,
3202 const AutoVarEmission &emission);
3204 void AddObjCARCExceptionMetadata(llvm::Instruction *Inst);
3206 llvm::Value *GetValueForARMHint(
unsigned BuiltinID);
3217 if (!isa<llvm::Instruction>(value))
return false;
3220 llvm::BasicBlock *block = cast<llvm::Instruction>(value)->getParent();
3221 return (block != &block->getParent()->getEntryBlock());
3226 if (!needsSaving(value))
return saved_type(value,
false);
3240 if (!value.getInt())
return value.getPointer();
3243 auto alloca = cast<llvm::AllocaInst>(value.getPointer());
3283 enum Kind { ScalarLiteral, ScalarAddress, AggregateLiteral,
3284 AggregateAddress, ComplexAddress };
3288 unsigned Align : 29;
3290 :
Value(v), K(k), Align(a) {}
3293 static bool needsSaving(
RValue value);
3301 return saved_type::needsSaving(value);
3304 return saved_type::save(CGF, value);
3307 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.
void EmitInitializerForField(FieldDecl *Field, LValue LHS, Expr *Init, ArrayRef< VarDecl * > ArrayIndexes)
ReturnValueSlot - Contains the address where the return value of a function can be stored...
void EnterDtorCleanups(const CXXDestructorDecl *Dtor, CXXDtorType Type)
EnterDtorCleanups - Enter the cleanups necessary to complete the given phase of destruction for a des...
Information about the layout of a __block variable.
void EmitIndirectGotoStmt(const IndirectGotoStmt &S)
This represents '#pragma omp master' directive.
SourceLocation getEnd() const
virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S)
Emit the captured statement body.
Address EmitLoadOfReference(Address Ref, const ReferenceType *RefTy, AlignmentSource *Source=nullptr)
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)
void EmitCallArgs(CallArgList &Args, const T *CallArgTypeInfo, llvm::iterator_range< CallExpr::const_arg_iterator > ArgRange, const FunctionDecl *CalleeDecl=nullptr, unsigned ParamsToSkip=0)
EmitCallArgs - Emit call arguments for a function.
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)
LValue EmitComplexCompoundAssignmentLValue(const CompoundAssignOperator *E)
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
llvm::Value * EmitARCRetainAutoreleaseScalarExpr(const Expr *expr)
Destroyer * getDestroyer(QualType::DestructionKind destructionKind)
A (possibly-)qualified type.
void EmitVTablePtrCheckForCall(const CXXMethodDecl *MD, llvm::Value *VTable, CFITypeCheckKind TCK, SourceLocation Loc)
EmitVTablePtrCheckForCall - Virtual method MD is being called via VTable.
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()
void EmitOMPReductionClauseFinal(const OMPExecutableDirective &D)
Emit final update of reduction values to original variables at the end of the directive.
llvm::Type * ConvertTypeForMem(QualType T)
void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount)
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...
void EmitAttributedStmt(const AttributedStmt &S)
llvm::Constant * EmitCheckTypeDescriptor(QualType T)
Emit a description of a type in a format suitable for passing to a runtime sanitizer handler...
AlignmentSource
The source of the alignment of an l-value; an expression of confidence in the alignment actually matc...
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)
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 EmitNonNullArgCheck(RValue RV, QualType ArgType, SourceLocation ArgLoc, const FunctionDecl *FD, unsigned ParmNum)
Create a check for a function parameter that may potentially be declared as non-null.
llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp")
CreateTempAlloca - This creates a alloca and inserts it into the entry block.
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.
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
Address getEHSelectorSlot()
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.
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'.
The base class of the type hierarchy.
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 typeIsSuitableForInlineAtomic(QualType Ty, bool IsVolatile) const
An type is a candidate for having its loads and stores be made atomic if we are operating under /vola...
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)
Address EmitArrayToPointerDecay(const Expr *Array, AlignmentSource *AlignSource=nullptr)
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.
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)
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.
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)
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
LValue EmitCXXUuidofLValue(const CXXUuidofExpr *E)
const CXXBaseSpecifier *const * path_const_iterator
void EmitOMPParallelForSimdDirective(const OMPParallelForSimdDirective &S)
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.
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.
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...
CharUnits getNaturalTypeAlignment(QualType T, AlignmentSource *Source=nullptr, bool forPointeeType=false)
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)
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)
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)
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.
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...
llvm::Value * EmitObjCThrowOperand(const Expr *expr)
~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)
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.
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 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.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
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)
llvm::Value * EmitDynamicCast(Address V, const CXXDynamicCastExpr *DCE)
llvm::Value * EmitObjCExtendObjectLifetime(QualType T, llvm::Value *Ptr)
RValue EmitReferenceBindingToExpr(const Expr *E)
Emits a reference binding to the passed in expression.
llvm::SmallPtrSet< const CXXRecordDecl *, 4 > VisitedVirtualBasesSetTy
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...
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.
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 GenerateCXXGlobalDtorsFunc(llvm::Function *Fn, const std::vector< std::pair< llvm::WeakVH, llvm::Constant * > > &DtorsAndObjects)
GenerateCXXGlobalDtorsFunc - Generates code for destroying global variables.
llvm::Value * EmitARCAutoreleaseReturnValue(llvm::Value *value)
Autorelease the given object.
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...
RValue EmitCall(const CGFunctionInfo &FnInfo, llvm::Value *Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, CGCalleeInfo CalleeInfo=CGCalleeInfo(), 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.
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)
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 - Similary 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.
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)...
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.
Describes an C or C++ initializer list.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
void pushRegularPartialArrayCleanup(llvm::Value *arrayBegin, llvm::Value *arrayEnd, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)
pushRegularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the gi...
A class controlling the emission of a finally block.
Address emitAddrOfRealComponent(Address complex, QualType complexType)
llvm::Value * BuildVector(ArrayRef< llvm::Value * > Ops)
llvm::Value * EmitObjCStringLiteral(const ObjCStringLiteral *E)
Emits an instance of NSConstantString representing the object.
static bool hasScalarEvaluationKind(QualType T)
Address GetAddrOfBlockDecl(const VarDecl *var, bool ByRef)
ForStmt - This represents a 'for (init;cond;inc)' stmt.
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 EmitARCDestroyStrong(Address addr, ARCPreciseLifetime_t precise)
Destroy a __strong variable.
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 EmitOMPLastprivateClauseFinal(const OMPExecutableDirective &D, llvm::Value *IsLastIterCond=nullptr)
Emit final copying of lastprivate values to original variables at the end of the worksharing or simd ...
void EmitContinueStmt(const ContinueStmt &S)
void EmitOMPTargetDirective(const OMPTargetDirective &S)
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...
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.
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()
void incrementProfileCounter(const Stmt *S)
Increment the profiler's counter for the given statement.
LValue EmitCXXConstructLValue(const CXXConstructExpr *E)
void initFullExprCleanup()
Set up the last cleaup that was pushed as a conditional full-expression cleanup.
llvm::Function * GenerateSEHFinallyFunction(CodeGenFunction &ParentCGF, const SEHFinallyStmt &Finally)
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...
void EmitDeleteCall(const FunctionDecl *DeleteFD, llvm::Value *Ptr, QualType DeleteTy)
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.
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...
uint64_t getCurrentProfileCount()
Get the profiler's current count.
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::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)
void EmitDeclRefExprDbgValue(const DeclRefExpr *E, llvm::Constant *Init)
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.
LValue MakeAddrLValue(Address Addr, QualType T, AlignmentSource AlignSource=AlignmentSource::Type)
LValue EmitExtVectorElementExpr(const ExtVectorElementExpr *E)
OpenMP 4.0 [2.4, Array Sections].
RValue EmitObjCMessageExpr(const ObjCMessageExpr *E, ReturnValueSlot Return=ReturnValueSlot())
void EmitCXXConstructExpr(const CXXConstructExpr *E, AggValueSlot Dest)
void EmitCheck(ArrayRef< std::pair< llvm::Value *, SanitizerMask >> Checked, StringRef CheckName, ArrayRef< llvm::Constant * > StaticArgs, ArrayRef< llvm::Value * > DynamicArgs)
Create a basic block that will call a handler function in a sanitizer runtime with the provided argum...
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.
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...
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()
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.
ID
Defines the set of possible language-specific address spaces.
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.
LValue MakeAddrLValue(llvm::Value *V, QualType T, CharUnits Alignment, AlignmentSource AlignSource=AlignmentSource::Type)
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::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)
bool CanDevirtualizeMemberFunctionCall(const Expr *Base, const CXXMethodDecl *MD)
CanDevirtualizeMemberFunctionCalls - Checks whether virtual calls on given expr can be devirtualized...
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.
void EmitCaseStmt(const CaseStmt &S)
void EmitStoreOfScalar(llvm::Value *Value, Address Addr, bool Volatile, QualType Ty, AlignmentSource AlignSource=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...
llvm::Function * GenerateSEHFilterFunction(CodeGenFunction &ParentCGF, const SEHExceptStmt &Except)
Create a stub filter function that will ultimately hold the code of the filter expression.
RValue EmitCXXMemberOrOperatorCall(const CXXMethodDecl *MD, llvm::Value *Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E)
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 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.
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...
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
CharUnits getNaturalPointeeTypeAlignment(QualType T, AlignmentSource *Source=nullptr)
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.
static LValue MakeAddr(Address address, QualType type, ASTContext &Context, AlignmentSource alignSource, llvm::MDNode *TBAAInfo=nullptr)
llvm::Value * getExceptionFromSlot()
Returns the contents of the function's exception object and selector slots.
void EmitAsanPrologueOrEpilogue(bool Prologue)
llvm::Value * EmitARCAutorelease(llvm::Value *value)
Autorelease the given object.
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 EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Dest)
An RAII object to record that we're evaluating a statement expression.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues, like target-specific attributes, builtins and so on.
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.
Address EmitPointerWithAlignment(const Expr *Addr, AlignmentSource *Source=nullptr)
EmitPointerWithAlignment - Given an expression with a pointer type, emit the value and compute our be...
void EmitOMPMasterDirective(const OMPMasterDirective &S)
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;...
LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T)
An expression that sends a message to the given Objective-C object or class.
ComplexPairTy EmitComplexPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
JumpDest(llvm::BasicBlock *Block, EHScopeStack::stable_iterator Depth, unsigned Index)
void ResolveBranchFixups(llvm::BasicBlock *Target)
void EmitForwardingCallToLambda(const CXXMethodDecl *LambdaCallOperator, CallArgList &CallArgs)
void EmitMCountInstrumentation()
EmitMCountInstrumentation - Emit call to .mcount.
void EmitAggregateCopyCtor(Address DestPtr, Address SrcPtr, QualType DestTy, QualType SrcTy)
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)
Creates clause with a list of variables VL and a linear step Step.
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.
void EmitCXXAggrConstructorCall(const CXXConstructorDecl *D, const ConstantArrayType *ArrayTy, Address ArrayPtr, const CXXConstructExpr *E, bool ZeroInitialization=false)
EmitCXXAggrConstructorCall - Emit a loop to call a particular constructor for each of several members...
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)
llvm::BasicBlock * getEHDispatchBlock(EHScopeStack::stable_iterator scope)
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)
void enterByrefCleanup(const AutoVarEmission &emission)
Enter a cleanup to destroy a __block variable.
void EmitOMPFlushDirective(const OMPFlushDirective &S)
OMPPrivateScope(CodeGenFunction &CGF)
Enter a new OpenMP private scope.
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.
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.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
LValue EmitVAArgExprLValue(const VAArgExpr *E)
ConstExprIterator const_arg_iterator
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)
const TemplateArgument * iterator
A saved depth on the scope stack.
std::pair< RValue, llvm::Value * > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, llvm::AtomicOrdering Success=llvm::SequentiallyConsistent, llvm::AtomicOrdering Failure=llvm::SequentiallyConsistent, bool IsWeak=false, AggValueSlot Slot=AggValueSlot::ignored())
Emit a compare-and-exchange op for atomic type.
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.
llvm::Value * EmitLoadOfScalar(Address Addr, bool Volatile, QualType Ty, SourceLocation Loc, AlignmentSource AlignSource=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 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)
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.
bool ConstantFoldsToSimpleInteger(const Expr *Cond, bool &Result)
ConstantFoldsToSimpleInteger - If the specified expression does not fold to a constant, or if it does but contains a label, return false.
LValue EmitAggExprToLValue(const Expr *E)
EmitAggExprToLValue - Emit the computation of the specified expression of aggregate type into a tempo...
void DeactivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
DeactivateCleanupBlock - Deactivates the given cleanup block.
void EmitCallAndReturnForThunk(llvm::Value *Callee, const ThunkInfo *Thunk)
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 ...
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.
ObjCCategoryDecl - Represents a category declaration.
bool isTrivialInitializer(const Expr *Init)
Determine whether the given initializer is trivial in the sense that it requires no code to be genera...
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.
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
void EmitOMPForSimdDirective(const OMPForSimdDirective &S)
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)
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)
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.
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.
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.
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.
llvm::Value * getDirectValue() const
void EmitObjCAutoreleasePoolPop(llvm::Value *Ptr)
Produce the code to do a primitive release.
Address CreateMemTemp(QualType T, const Twine &Name="tmp")
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignment...
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.
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)
Checking the bound value in a reference binding.
LValue EmitCallExprLValue(const CallExpr *E)
LValue EmitPseudoObjectLValue(const PseudoObjectExpr *e)
This represents '#pragma omp simd' directive.
void EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor, const FunctionArgList &Args)
StmtExprEvaluation(CodeGenFunction &CGF)
void InitializeVTablePointers(const CXXRecordDecl *ClassDecl)
Address getIndirectAddress() const
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()
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, llvm::Value *V, QualType Type, CharUnits Alignment=CharUnits::Zero(), bool SkipNullCheck=false)
Emit a check that V is the address of storage of the appropriate size and alignment for an object of ...
void EmitAggExpr(const Expr *E, AggValueSlot AS)
EmitAggExpr - Emit the computation of the specified expression of aggregate type. ...
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)
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 *)
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)
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.
LValue EmitArraySubscriptExpr(const ArraySubscriptExpr *E, bool Accessed=false)
Address EmitCXXMemberDataPointerAddress(const Expr *E, Address base, llvm::Value *memberPtr, const MemberPointerType *memberPtrType, AlignmentSource *AlignSource=nullptr)
Emit the address of a field using a member data pointer.
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...
Represents a call to a CUDA kernel function.
RValue EmitRValueForField(LValue LV, const FieldDecl *FD, SourceLocation Loc)
const TargetInfo & Target
void EmitLambdaStaticInvokeFunction(const CXXMethodDecl *MD)
llvm::AssertingVH< llvm::Instruction > AllocaInsertPt
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)
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
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)
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 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
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.
RValue EmitCXXStructorCall(const CXXMethodDecl *MD, llvm::Value *Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E, StructorType Type)
ObjCIvarRefExpr - A reference to an ObjC instance variable.
void EmitFunctionBody(FunctionArgList &Args, const Stmt *Body)
void StartThunk(llvm::Function *Fn, GlobalDecl GD, const CGFunctionInfo &FnInfo)
LValue EmitConditionalOperatorLValue(const AbstractConditionalOperator *E)
VPtrsVector getVTablePointers(const CXXRecordDecl *VTableClass)
const Decl * CurFuncDecl
CurFuncDecl - Holds the Decl for the current outermost non-closure context.
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.
A non-RAII class containing all the information about a bound opaque value.
llvm::Value * BuildAppleKextVirtualCall(const CXXMethodDecl *MD, NestedNameSpecifier *Qual, llvm::Type *Ty)
BuildAppleKextVirtualCall - This routine is to support gcc's kext ABI making indirect call to virtual...
void ErrorUnsupported(const Stmt *S, const char *Type)
ErrorUnsupported - Print out an error that codegen doesn't support the specified stmt yet...
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
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
ObjCIvarDecl - Represents an ObjC instance variable.
static type restore(CodeGenFunction &CGF, saved_type value)
WhileStmt - This represents a 'while' stmt.
void PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize)
Takes the old cleanup stack size and emits the cleanup blocks that have been added.
void EmitCXXDeleteExpr(const CXXDeleteExpr *E)
LValue EmitLValue(const Expr *E)
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 ...
void EmitCfiSlowPathCheck(llvm::Value *Cond, llvm::ConstantInt *TypeId, llvm::Value *Ptr)
Emit a slow path cross-DSO CFI check which calls __cfi_slowpath if Cond if false. ...
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)
StringLiteral - This represents a string literal expression, e.g.
Defines the clang::TargetInfo interface.
void ForceCleanup()
Force the emission of cleanups now, instead of waiting until this object is destroyed.
bool EmitOMPCopyinClause(const OMPExecutableDirective &D)
Emit code for copyin clause in D directive.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
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
RValue EmitLoadOfBitfieldLValue(LValue LV)
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.
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 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.
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())
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.
llvm::BlockAddress * GetAddrOfLabel(const LabelDecl *L)
void EmitWhileStmt(const WhileStmt &S, ArrayRef< const Attr * > Attrs=None)
This represents '#pragma omp taskyield' directive.
void EmitVarAnnotations(const VarDecl *D, llvm::Value *V)
Emit local annotations for the local variable V, declared by D.
llvm::Value * EmitObjCConsumeObject(QualType T, llvm::Value *Ptr)
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 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.
bool requiresLandingPad() const
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, LValue lvalue)
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.
Represents the canonical version of C arrays with a specified constant size.
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...
CGCalleeInfo - Class to encapsulate the information about a callee to be used during the generation o...
void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint=true)
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)
llvm::SmallVector< const JumpDest *, 2 > SEHTryEpilogueStack
llvm::Value * EmitSystemZBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
bool Privatize()
Privatizes local variables previously registered as private.
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 * BuildAppleKextVirtualDestructorCall(const CXXDestructorDecl *DD, CXXDtorType Type, const CXXRecordDecl *RD)
BuildVirtualCall - This routine makes indirect vtable call for call to virtual destructors.
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.