13#ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
14#define LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H
38#include "llvm/ADT/ArrayRef.h"
39#include "llvm/ADT/DenseMap.h"
40#include "llvm/ADT/MapVector.h"
41#include "llvm/ADT/SmallVector.h"
42#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
43#include "llvm/IR/Instructions.h"
44#include "llvm/IR/ValueHandle.h"
45#include "llvm/Support/Debug.h"
46#include "llvm/Transforms/Utils/SanitizerStats.h"
51class ConvergenceControlInst;
57class CanonicalLoopInfo;
84class OMPUseDevicePtrClause;
85class OMPUseDeviceAddrClause;
87class OMPExecutableDirective;
147 return (block != &block->getParent()->getEntryBlock());
210 LLVM_PREFERRED_TYPE(Kind)
218 : Vals{Val1, Val2}, K(ComplexAddress) {}
221 : AggregateAddr(AggregateAddr), K(K) {}
233 return saved_type::save(CGF, value);
245class ApplyAtomGroup {
246 uint64_t OriginalAtom = 0;
249 ApplyAtomGroup(
const ApplyAtomGroup &) =
delete;
250 void operator=(
const ApplyAtomGroup &) =
delete;
260 CodeGenFunction(
const CodeGenFunction &) =
delete;
261 void operator=(
const CodeGenFunction &) =
delete;
273 : Block(Block), ScopeDepth(Depth), Index(Index) {}
275 bool isValid()
const {
return Block !=
nullptr; }
276 llvm::BasicBlock *
getBlock()
const {
return Block; }
286 llvm::BasicBlock *
Block;
327 typedef llvm::function_ref<void(CodeGenFunction &,
const OMPLoopDirective &,
330 typedef llvm::function_ref<void(CodeGenFunction &,
SourceLocation,
331 const unsigned,
const bool)>
335 typedef llvm::function_ref<std::pair<LValue, LValue>(
340 typedef llvm::function_ref<std::pair<llvm::Value *, llvm::Value *>(
347 void InsertHelper(llvm::Instruction *I,
const llvm::Twine &Name,
348 llvm::BasicBlock::iterator InsertPt)
const;
370 std::unique_ptr<CGCoroData>
Data;
399 Twine
const &SuspendPointName,
427 return CurLexicalScope->hasLabels();
428 return !LabelMap.empty();
444 llvm::AssertingVH<llvm::Instruction> PostAllocaInsertPt =
nullptr;
450 if (!PostAllocaInsertPt) {
452 "Expected static alloca insertion point at function prologue");
454 "EBB should be entry block of the current code gen function");
456 PostAllocaInsertPt->setName(
"postallocapt");
460 return PostAllocaInsertPt;
465 return Builder.CreateAddrSpaceCast(
466 Src, DestTy, Src->hasName() ? Src->getName() +
".ascast" :
"");
482 I != E; ++I, ++Field) {
483 if (I->capturesThis())
484 CXXThisFieldDecl = *Field;
485 else if (I->capturesVariable())
486 CaptureFields[I->getCapturedVar()->getCanonicalDecl()] = *Field;
487 else if (I->capturesVariableByCopy())
488 CaptureFields[I->getCapturedVar()->getCanonicalDecl()] = *Field;
521 return CaptureFields;
529 llvm::SmallDenseMap<const VarDecl *, FieldDecl *> CaptureFields;
533 llvm::Value *ThisValue;
543 CodeGenFunction &CGF;
550 CGF.CapturedStmtInfo = NewCapturedStmtInfo;
558 const Decl *CalleeDecl;
565 return isa_and_nonnull<FunctionDecl>(CalleeDecl);
569 if (
const auto *FD = dyn_cast<FunctionDecl>(CalleeDecl))
570 return FD->getNumParams();
574 if (
const auto *FD = dyn_cast<FunctionDecl>(CalleeDecl))
575 return FD->getParamDecl(I);
588 CodeGenFunction *CGF;
634 HLSLControlFlowHintAttr::SpellingNotCalculated;
643 if (
CGM.getCodeGenOpts().getFiniteLoops() ==
671 llvm::DenseMap<const VarDecl *, llvm::Value *>
NRVOFlags;
702 assert(!
Deactivated &&
"Deactivating already deactivated scope");
703 auto &Stack =
CGF.DeferredDeactivationCleanupStack;
705 CGF.DeactivateCleanupBlock(Stack[I - 1].Cleanup,
706 Stack[I - 1].DominatingIP);
707 Stack[I - 1].DominatingIP->eraseFromParent();
725 bool isRedundantBeforeReturn()
override {
return true; }
732 void Emit(CodeGenFunction &CGF, Flags flags)
override {
740 class FakeUse final :
public EHScopeStack::Cleanup {
746 void Emit(CodeGenFunction &CGF, Flags flags)
override {
759 LLVM_PREFERRED_TYPE(
bool)
806 CodeGenFunction &CGF;
811 CodeGenFunction &CGF,
815 CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan;
818 CGF.OMPParentLoopDirectiveForScan = ParentLoopDirectiveForScan;
834 void ConstructorHelper(
FPOptions FPFeatures);
835 CodeGenFunction &CGF;
837 llvm::fp::ExceptionBehavior OldExcept;
838 llvm::RoundingMode OldRounding;
839 std::optional<CGBuilderTy::FastMathFlagGuard> FMFGuard;
846 : CGM(CGM_), SavedAtomicOpts(CGM.getAtomicOpts()) {
847 CGM.setAtomicOpts(AO);
850 : CGM(CGM_), SavedAtomicOpts(CGM.getAtomicOpts()) {
854 for (
auto Option : AA->atomicOptions()) {
856 case AtomicAttr::remote_memory:
857 AO.remote_memory = true;
859 case AtomicAttr::no_remote_memory:
860 AO.remote_memory = false;
862 case AtomicAttr::fine_grained_memory:
863 AO.fine_grained_memory = true;
865 case AtomicAttr::no_fine_grained_memory:
866 AO.fine_grained_memory = false;
868 case AtomicAttr::ignore_denormal_mode:
869 AO.ignore_denormal_mode = true;
871 case AtomicAttr::no_ignore_denormal_mode:
872 AO.ignore_denormal_mode = false;
876 CGM.setAtomicOpts(AO);
899 llvm::FunctionCallee BeginCatchFn;
903 llvm::AllocaInst *ForEHVar =
nullptr;
907 llvm::AllocaInst *SavedExnVar =
nullptr;
910 void enter(CodeGenFunction &CGF,
const Stmt *Finally,
911 llvm::FunctionCallee beginCatchFn,
912 llvm::FunctionCallee endCatchFn, llvm::FunctionCallee rethrowFn);
913 void exit(CodeGenFunction &CGF);
927 template <
class T,
class... As>
935 typedef std::tuple<typename DominatingValue<As>::saved_type...> SavedTuple;
939 EHStack.pushCleanupTuple<CleanupType>(
kind, Saved);
945 template <
class T,
class... As>
953 "cleanup active flag should never need saving");
955 typedef std::tuple<typename DominatingValue<As>::saved_type...> SavedTuple;
963 template <
class T,
class... As>
976 "Cleanup will be allocated on misaligned address");
979 new (Buffer +
sizeof(Header))
T(A...);
981 new (Buffer +
sizeof(Header) +
sizeof(
T))
RawAddress(ActiveFlag);
987 template <
class T,
class... As>
990 llvm::Instruction *DominatingIP =
994 {
EHStack.stable_begin(), DominatingIP});
1032 llvm::Instruction *DominatingIP);
1042 llvm::Instruction *DominatingIP);
1046 class RunCleanupsScope {
1048 size_t LifetimeExtendedCleanupStackSize;
1050 bool OldDidCallStackSave;
1056 RunCleanupsScope(
const RunCleanupsScope &) =
delete;
1057 void operator=(
const RunCleanupsScope &) =
delete;
1066 CleanupStackDepth =
CGF.EHStack.stable_begin();
1067 LifetimeExtendedCleanupStackSize =
1068 CGF.LifetimeExtendedCleanupStack.size();
1069 OldDidCallStackSave =
CGF.DidCallStackSave;
1070 CGF.DidCallStackSave =
false;
1071 OldCleanupScopeDepth =
CGF.CurrentCleanupScopeDepth;
1072 CGF.CurrentCleanupScopeDepth = CleanupStackDepth;
1083 return CGF.EHStack.stable_begin() != CleanupStackDepth;
1095 CGF.DidCallStackSave = OldDidCallStackSave;
1108 class LexicalScope :
public RunCleanupsScope {
1111 LexicalScope *ParentScope;
1113 LexicalScope(
const LexicalScope &) =
delete;
1114 void operator=(
const LexicalScope &) =
delete;
1122 Labels.push_back(label);
1132 CGF.CurLexicalScope = ParentScope;
1135 if (!Labels.empty())
1151 void operator=(
const OMPMapVars &) =
delete;
1156 assert(SavedLocals.empty() &&
"Did not restored original addresses.");
1166 if (SavedLocals.count(LocalVD))
1170 auto it = CGF.LocalDeclMap.find(LocalVD);
1171 if (it != CGF.LocalDeclMap.end())
1172 SavedLocals.try_emplace(LocalVD, it->second);
1183 SavedTempAddresses.try_emplace(LocalVD, TempAddr);
1192 copyInto(SavedTempAddresses, CGF.LocalDeclMap);
1193 SavedTempAddresses.clear();
1194 return !SavedLocals.empty();
1199 if (!SavedLocals.empty()) {
1200 copyInto(SavedLocals, CGF.LocalDeclMap);
1201 SavedLocals.clear();
1210 if (!
Addr.isValid())
1221 class OMPPrivateScope :
public RunCleanupsScope {
1223 OMPPrivateScope(
const OMPPrivateScope &) =
delete;
1224 void operator=(
const OMPPrivateScope &) =
delete;
1237 return MappedVars.setVarAddr(
CGF, LocalVD,
Addr);
1277 CodeGenFunction &CGF;
1282 : CGF(CGF), SavedMap(CGF.LocalDeclMap) {}
1290 std::initializer_list<llvm::Value **> ValuesToReload = {});
1297 size_t OldLifetimeExtendedStackSize,
1298 std::initializer_list<llvm::Value **> ValuesToReload = {});
1347 llvm::BasicBlock *StartBB;
1351 : StartBB(CGF.
Builder.GetInsertBlock()) {}
1354 assert(CGF.OutermostConditional !=
this);
1355 if (!CGF.OutermostConditional)
1356 CGF.OutermostConditional =
this;
1359 void end(CodeGenFunction &CGF) {
1360 assert(CGF.OutermostConditional !=
nullptr);
1361 if (CGF.OutermostConditional ==
this)
1362 CGF.OutermostConditional =
nullptr;
1375 CodeGenFunction &CGF) {
1377 llvm::BasicBlock *block = OutermostConditional->getStartingBlock();
1378 auto store =
new llvm::StoreInst(value, addr.
emitRawPointer(CGF),
1379 block->back().getIterator());
1386 CodeGenFunction &CGF;
1395 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
1396 CGF.OutermostConditional =
nullptr;
1400 CGF.OutermostConditional = SavedOutermostConditional;
1401 CGF.EnsureInsertPoint();
1409 llvm::Instruction *Inst =
nullptr;
1422 class OpaqueValueMappingData {
1428 : OpaqueValue(ov), BoundLValue(boundLValue) {}
1439 return expr->isGLValue() ||
expr->getType()->isFunctionType() ||
1453 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
1460 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
1462 OpaqueValueMappingData data(ov,
false);
1472 bool isValid()
const {
return OpaqueValue !=
nullptr; }
1476 assert(OpaqueValue &&
"no data to unbind!");
1479 CGF.OpaqueLValues.erase(OpaqueValue);
1481 CGF.OpaqueRValues.erase(OpaqueValue);
1489 CodeGenFunction &CGF;
1519 assert(OV->
getSourceExpr() &&
"wrong form of OpaqueValueMapping used "
1520 "for OVE with no source expression");
1549 unsigned VLAExprCounter = 0;
1550 bool DisableDebugInfo =
false;
1554 bool DidCallStackSave =
false;
1560 llvm::IndirectBrInst *IndirectBranch =
nullptr;
1568 llvm::DenseMap<const ParmVarDecl *, EHScopeStack::stable_iterator>
1569 CalleeDestructedParamCleanups;
1574 llvm::SmallDenseMap<const ParmVarDecl *, const ImplicitParamDecl *, 2>
1579 llvm::DenseMap<llvm::AllocaInst *, int> EscapedLocals;
1582 llvm::DenseMap<const LabelDecl *, JumpDest> LabelMap;
1586 struct BreakContinue {
1587 BreakContinue(
const Stmt &LoopOrSwitch, JumpDest Break, JumpDest Continue)
1588 : LoopOrSwitch(&LoopOrSwitch), BreakBlock(Break),
1589 ContinueBlock(Continue) {}
1591 const Stmt *LoopOrSwitch;
1592 JumpDest BreakBlock;
1593 JumpDest ContinueBlock;
1598 class OpenMPCancelExitStack {
1602 CancelExit() =
default;
1603 CancelExit(OpenMPDirectiveKind Kind, JumpDest ExitBlock,
1605 : Kind(Kind), ExitBlock(ExitBlock), ContBlock(ContBlock) {}
1609 bool HasBeenEmitted =
false;
1614 SmallVector<CancelExit, 8> Stack;
1617 OpenMPCancelExitStack() : Stack(1) {}
1618 ~OpenMPCancelExitStack() =
default;
1620 JumpDest getExitBlock()
const {
return Stack.back().ExitBlock; }
1624 const llvm::function_ref<
void(CodeGenFunction &)> CodeGen) {
1625 if (Stack.back().Kind == Kind && getExitBlock().isValid()) {
1626 assert(CGF.getOMPCancelDestination(Kind).isValid());
1627 assert(CGF.HaveInsertPoint());
1628 assert(!Stack.back().HasBeenEmitted);
1629 auto IP = CGF.Builder.saveAndClearIP();
1630 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1632 CGF.EmitBranch(Stack.back().ContBlock.getBlock());
1633 CGF.Builder.restoreIP(IP);
1634 Stack.back().HasBeenEmitted =
true;
1643 Stack.push_back({
Kind,
1644 HasCancel ? CGF.getJumpDestInCurrentScope(
"cancel.exit")
1646 HasCancel ? CGF.getJumpDestInCurrentScope(
"cancel.cont")
1651 void exit(CodeGenFunction &CGF) {
1652 if (getExitBlock().isValid()) {
1653 assert(CGF.getOMPCancelDestination(Stack.back().Kind).isValid());
1654 bool HaveIP = CGF.HaveInsertPoint();
1655 if (!Stack.back().HasBeenEmitted) {
1657 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1658 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1659 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1661 CGF.EmitBlock(Stack.back().ContBlock.getBlock());
1663 CGF.Builder.CreateUnreachable();
1664 CGF.Builder.ClearInsertionPoint();
1670 OpenMPCancelExitStack OMPCancelStack;
1673 llvm::Value *emitCondLikelihoodViaExpectIntrinsic(llvm::Value *Cond,
1676 std::unique_ptr<CodeGenPGO> PGO;
1679 llvm::MDNode *createProfileWeights(uint64_t TrueCount,
1680 uint64_t FalseCount)
const;
1681 llvm::MDNode *createProfileWeights(ArrayRef<uint64_t> Weights)
const;
1682 llvm::MDNode *createProfileWeightsForLoop(
const Stmt *Cond,
1683 uint64_t LoopCount)
const;
1714 bool UseBoth =
false,
1715 llvm::Value *StepV =
nullptr);
1718 return (
CGM.getCodeGenOpts().hasProfileClangInstr() &&
1719 CGM.getCodeGenOpts().MCDCCoverage &&
1720 !
CurFn->hasFnAttribute(llvm::Attribute::NoProfile));
1757 llvm::Value *Backup);
1761 llvm::Value *Backup, uint64_t Atom);
1766 llvm::Value *Backup);
1775 llvm::SwitchInst *SwitchInsn =
nullptr;
1784 llvm::BasicBlock *CaseRangeBlock =
nullptr;
1788 llvm::DenseMap<const OpaqueValueExpr *, LValue> OpaqueLValues;
1789 llvm::DenseMap<const OpaqueValueExpr *, RValue> OpaqueRValues;
1797 llvm::DenseMap<const Expr *, llvm::Value *> VLASizeMap;
1801 llvm::BasicBlock *UnreachableBlock =
nullptr;
1804 unsigned NumReturnExprs = 0;
1807 unsigned NumSimpleReturnExprs = 0;
1825 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1826 CGF.CXXDefaultInitExprThis =
This;
1829 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1833 CodeGenFunction &CGF;
1834 Address OldCXXDefaultInitExprThis;
1845 CGF.CXXThisValue =
CGF.CXXDefaultInitExprThis.getBasePointer();
1846 CGF.CXXThisAlignment =
CGF.CXXDefaultInitExprThis.getAlignment();
1870 : CGF(CGF), OldArrayInitIndex(CGF.ArrayInitIndex) {
1871 CGF.ArrayInitIndex = Index;
1876 CodeGenFunction &CGF;
1877 llvm::Value *OldArrayInitIndex;
1885 OldCXXABIThisDecl(CGF.CXXABIThisDecl),
1886 OldCXXABIThisValue(CGF.CXXABIThisValue),
1887 OldCXXThisValue(CGF.CXXThisValue),
1888 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),
1889 OldCXXThisAlignment(CGF.CXXThisAlignment),
1891 OldCXXInheritedCtorInitExprArgs(
1892 std::move(CGF.CXXInheritedCtorInitExprArgs)) {
1894 CGF.CurFuncDecl = CGF.CurCodeDecl =
1896 CGF.CXXABIThisDecl =
nullptr;
1897 CGF.CXXABIThisValue =
nullptr;
1898 CGF.CXXThisValue =
nullptr;
1903 CGF.CXXInheritedCtorInitExprArgs.clear();
1906 CGF.CurGD = OldCurGD;
1907 CGF.CurFuncDecl = OldCurFuncDecl;
1908 CGF.CurCodeDecl = OldCurCodeDecl;
1909 CGF.CXXABIThisDecl = OldCXXABIThisDecl;
1910 CGF.CXXABIThisValue = OldCXXABIThisValue;
1911 CGF.CXXThisValue = OldCXXThisValue;
1912 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;
1913 CGF.CXXThisAlignment = OldCXXThisAlignment;
1914 CGF.ReturnValue = OldReturnValue;
1915 CGF.FnRetTy = OldFnRetTy;
1916 CGF.CXXInheritedCtorInitExprArgs =
1917 std::move(OldCXXInheritedCtorInitExprArgs);
1921 CodeGenFunction &CGF;
1923 const Decl *OldCurFuncDecl;
1924 const Decl *OldCurCodeDecl;
1926 llvm::Value *OldCXXABIThisValue;
1927 llvm::Value *OldCXXThisValue;
1958 llvm::CallInst *RTLFnCI;
1962 RLFnCI->removeFromParent();
1965 void Emit(CodeGenFunction &CGF, Flags )
override {
1992 StringRef FirstSeparator =
".",
1993 StringRef Separator =
".");
1998 CGBuilderTy::InsertPointGuard IPG(CGF.
Builder);
1999 assert(IP.getBlock()->end() != IP.getPoint() &&
2000 "OpenMP IR Builder should cause terminated block!");
2002 llvm::BasicBlock *IPBB = IP.getBlock();
2003 llvm::BasicBlock *DestBB = IPBB->getUniqueSuccessor();
2004 assert(DestBB &&
"Finalization block should have one successor!");
2007 IPBB->getTerminator()->eraseFromParent();
2008 CGF.
Builder.SetInsertPoint(IPBB);
2021 const Stmt *RegionBodyStmt,
2027 llvm::BasicBlock &FiniBB, llvm::Function *Fn,
2029 llvm::BasicBlock *CodeGenIPBB = CodeGenIP.getBlock();
2030 if (llvm::Instruction *CodeGenIPBBTI = CodeGenIPBB->getTerminatorOrNull())
2031 CodeGenIPBBTI->eraseFromParent();
2033 CGF.
Builder.SetInsertPoint(CodeGenIPBB);
2035 if (Fn->doesNotThrow())
2040 if (CGF.
Builder.saveIP().isSet())
2041 CGF.
Builder.CreateBr(&FiniBB);
2053 const Stmt *RegionBodyStmt,
2061 llvm::AssertingVH<llvm::Instruction> OldAllocaIP;
2063 CodeGenFunction &CGF;
2067 llvm::BasicBlock &RetBB)
2069 assert(AllocaIP.isSet() &&
2070 "Must specify Insertion point for allocas of outlined function");
2071 OldAllocaIP = CGF.AllocaInsertPt;
2072 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
2074 OldReturnBlock = CGF.ReturnBlock;
2075 CGF.ReturnBlock = CGF.getJumpDestInCurrentScope(&RetBB);
2079 CGF.AllocaInsertPt = OldAllocaIP;
2080 CGF.ReturnBlock = OldReturnBlock;
2087 llvm::AssertingVH<llvm::Instruction> OldAllocaIP;
2088 CodeGenFunction &CGF;
2092 llvm::BasicBlock &FiniBB)
2098 assert((!AllocaIP.isSet() ||
2099 CGF.AllocaInsertPt->getParent() == AllocaIP.getBlock()) &&
2100 "Insertion point should be in the entry block of containing "
2102 OldAllocaIP = CGF.AllocaInsertPt;
2103 if (AllocaIP.isSet())
2104 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
2111 (void)CGF.getJumpDestInCurrentScope(&FiniBB);
2122 llvm::Value *CXXABIThisValue =
nullptr;
2123 llvm::Value *CXXThisValue =
nullptr;
2133 llvm::Value *ArrayInitIndex =
nullptr;
2142 llvm::Value *CXXStructorImplicitParamValue =
nullptr;
2147 ConditionalEvaluation *OutermostConditional =
nullptr;
2150 LexicalScope *CurLexicalScope =
nullptr;
2158 llvm::DenseMap<const ValueDecl *, BlockByrefInfo> BlockByrefInfos;
2162 llvm::Value *RetValNullabilityPrecondition =
nullptr;
2166 bool requiresReturnValueNullabilityCheck()
const {
2167 return RetValNullabilityPrecondition;
2175 bool requiresReturnValueCheck()
const;
2180 llvm::BasicBlock *TerminateLandingPad =
nullptr;
2181 llvm::BasicBlock *TerminateHandler =
nullptr;
2185 llvm::MapVector<llvm::Value *, llvm::BasicBlock *> TerminateFunclets;
2189 unsigned LargestVectorWidth = 0;
2193 bool ShouldEmitLifetimeMarkers;
2197 void EmitKernelMetadata(
const FunctionDecl *FD, llvm::Function *Fn);
2200 CodeGenFunction(CodeGenModule &cgm,
bool suppressNewContext =
false);
2206 if (DisableDebugInfo)
2214 return CGM.getCodeGenOpts().OptimizationLevel == 0;
2232 if (!UnreachableBlock) {
2236 return UnreachableBlock;
2240 if (!
EHStack.requiresLandingPad())
2250 return CGM.getTargetCodeGenInfo();
2266 llvm::Value *arrayEnd,
2276 Destroyer *destroyer,
bool useEHCleanupForArray);
2281 bool useEHCleanupForArray);
2284 bool useEHCleanupForArray);
2288 llvm::Value *CompletePtr,
2292 std::pair<llvm::Value *, llvm::Value *> AddrSizePair);
2294 bool useEHCleanupForArray);
2297 bool useEHCleanupForArray,
2301 Destroyer *destroyer,
bool checkZeroLength,
2318 CGM.getCodeGenOpts().ObjCAutoRefCountExceptions;
2320 llvm_unreachable(
"bad destruction kind");
2341 llvm::Constant *AtomicHelperFn);
2352 llvm::Constant *AtomicHelperFn);
2366 bool IsLambdaConversionToBlock,
2367 bool BuildGlobalBlock);
2383 class AutoVarEmission;
2404 bool LoadBlockVarAddr,
bool CanThrow);
2415 bool followForward =
true);
2417 bool followForward,
const llvm::Twine &name);
2449 llvm::Constant *CallOpFn =
nullptr);
2456 llvm::Function **ImplFn);
2477 const ThunkInfo *Thunk,
bool IsUnprototyped);
2491 llvm::FunctionCallee Callee);
2496 bool IsUnprototyped);
2525 bool BaseIsNonVirtualPrimaryBase,
2585 llvm::Value *VTable,
2586 llvm::Type *VTableTy,
2587 uint64_t VTableByteOffset);
2631 uint64_t RetKeyInstructionsSourceAtom);
2657 llvm::Type *LLVMTy =
nullptr);
2682 llvm::Function *parent =
nullptr,
2683 llvm::BasicBlock *before =
nullptr) {
2684 return llvm::BasicBlock::Create(
getLLVMContext(), name, parent, before);
2704 void EmitBlock(llvm::BasicBlock *BB,
bool IsFinished =
false);
2742 llvm::BasicBlock *LHSBlock,
2743 llvm::BasicBlock *RHSBlock,
2744 llvm::BasicBlock *MergeBlock,
2746 Builder.SetInsertPoint(MergeBlock);
2747 llvm::PHINode *PtrPhi =
Builder.CreatePHI(LHS.
getType(), 2,
"cond");
2764 if (Alignment.isZero())
2766 CGM.getNaturalTypeAlignment(
T, BaseInfo, TBAAInfo, ForPointeeType);
2768 CGM.getPointerAuthInfoForPointeeType(
T),
nullptr,
2775 CGM.getTBAAAccessInfo(
T));
2795 CGM.getTBAAAccessInfo(
T));
2827 CGM.getTBAAAccessInfo(RefTy));
2840 struct AllocaTracker {
2841 void Add(llvm::AllocaInst *I) { Allocas.push_back(I); }
2847 AllocaTracker *Allocas =
nullptr;
2850 void emitStoresForConstant(
const VarDecl &D, Address Loc,
bool isVolatile,
2851 llvm::Constant *constant,
bool IsAutoInit);
2853 void emitStoresForZeroInit(
const VarDecl &D, Address Loc,
bool isVolatile);
2855 void emitStoresForPatternInit(
const VarDecl &D, Address Loc,
bool isVolatile);
2857 void emitStoresForInitAfterBZero(llvm::Constant *
Init, Address Loc,
2858 bool isVolatile,
bool IsAutoInit);
2864 : CGF(CGF), OldTracker(CGF.Allocas) {
2865 CGF.Allocas = &Tracker;
2872 CodeGenFunction &CGF;
2873 AllocaTracker *OldTracker;
2874 AllocaTracker Tracker;
2881 llvm::Value *ArraySize =
nullptr);
2909 llvm::AllocaInst *
CreateTempAlloca(llvm::Type *Ty,
const Twine &Name =
"tmp",
2910 llvm::Value *ArraySize =
nullptr);
2916 CharUnits align,
const Twine &Name =
"tmp",
2917 llvm::Value *ArraySize =
nullptr,
2926 const Twine &Name =
"tmp",
2927 llvm::Value *ArraySize =
nullptr,
2934 const Twine &Name =
"tmp",
2935 llvm::Value *ArraySize =
nullptr);
2948 const Twine &Name =
"tmp");
2966 const Twine &Name =
"tmp",
2973 const Twine &Name =
"tmp");
3001 llvm::Value *Dst,
QualType DstType,
3017 bool ignoreResult =
false);
3040 bool IsInitializer);
3052 bool capturedByInit);
3057 if (
const auto *RD =
T->getAsRecordDecl())
3058 return RD->hasVolatileMember();
3100 bool isVolatile =
false);
3104 auto it = LocalDeclMap.find(VD);
3105 assert(it != LocalDeclMap.end() &&
3106 "Invalid argument to GetAddrOfLocalVar(), no decl!");
3146 llvm::Value *
EmitVAStartEnd(llvm::Value *ArgValue,
bool IsStart);
3192 assert(CXXThisValue &&
"no 'this' value for this function");
3193 return CXXThisValue;
3202 assert(CXXStructorImplicitParamValue &&
"no VTT value for this function");
3203 return CXXStructorImplicitParamValue;
3211 bool BaseIsVirtual);
3225 bool NullCheckValue);
3251 bool ForVirtualBase,
3260 bool InheritedFromVBase,
3272 llvm::CallBase **CallOrInvoke =
nullptr);
3287 bool NewPointerIsChecked,
3288 bool ZeroInitialization =
false);
3291 llvm::Value *NumElements,
Address ArrayPtr,
3293 bool NewPointerIsChecked,
3294 bool ZeroInitialization =
false);
3303 llvm::Type *ElementTy,
Address NewPtr,
3304 llvm::Value *NumElements,
3305 llvm::Value *AllocSizeWithoutCookie);
3322 QualType DeleteTy, llvm::Value *NumElements =
nullptr,
3324 llvm::Constant *CalleeOverride =
nullptr);
3327 const CallExpr *TheCallExpr,
bool IsDelete);
3384 llvm::Value *ArraySize =
nullptr) {
3388 SkippedChecks, ArraySize);
3394 llvm::Value *ArraySize =
nullptr) {
3398 SkippedChecks, ArraySize);
3407 llvm::Value *ArraySize =
nullptr);
3413 llvm::Value *Index,
QualType IndexType,
bool Accessed);
3415 llvm::Value *IndexVal,
QualType IndexType,
3416 llvm::Value *BoundsVal,
QualType BoundsType,
3448 llvm::Value *IndexVal,
bool Accessed,
3449 bool FlexibleArray);
3452 bool isInc,
bool isPre);
3454 bool isInc,
bool isPre);
3469 void EmitDecl(
const Decl &D,
bool EvaluateConditionDecl =
false);
3477 bool capturedByInit);
3491 class AutoVarEmission {
3502 llvm::Value *NRVOFlag;
3506 bool IsEscapingByRef;
3510 bool IsConstantAggregate;
3513 bool UseLifetimeMarkers;
3524 AutoVarEmission(
const VarDecl &variable)
3526 IsEscapingByRef(
false), IsConstantAggregate(
false),
3529 bool wasEmittedAsGlobal()
const {
return !
Addr.isValid(); }
3548 if (!IsEscapingByRef)
3568 bool EmitDebugInfo);
3571 llvm::GlobalValue::LinkageTypes
Linkage);
3586 return ParamValue(value);
3590 return ParamValue(addr);
3597 assert(!
Addr.hasOffset() &&
"unexpected offset");
3598 return Addr.getBasePointer();
3630 llvm::Value *Alignment,
3631 llvm::Value *OffsetValue,
3632 llvm::Value *TheCheck,
3633 llvm::Instruction *Assumption);
3637 llvm::Value *Alignment,
3638 llvm::Value *OffsetValue =
nullptr);
3642 llvm::Value *Alignment,
3643 llvm::Value *OffsetValue =
nullptr);
3686 void EmitForStmt(
const ForStmt &S, ArrayRef<const Attr *> Attrs = {});
3692 void EmitDefaultStmt(
const DefaultStmt &S, ArrayRef<const Attr *> Attrs);
3693 void EmitCaseStmt(
const CaseStmt &S, ArrayRef<const Attr *> Attrs);
3710 bool ignoreResult =
false);
3714 bool ignoreResult =
false);
3721 void ExitCXXTryStmt(
const CXXTryStmt &S,
bool IsFnTryBlock =
false);
3729 llvm::SmallPtrSet<llvm::BasicBlock *, 10> &
V);
3733 const Stmt *OutlinedStmt);
3736 const SEHExceptStmt &Except);
3739 const SEHFinallyStmt &Finally);
3742 llvm::Value *ParentFP, llvm::Value *EntryEBP);
3762 Address ParentVar, llvm::Value *ParentFP);
3765 ArrayRef<const Attr *> Attrs = {});
3772 CodeGenFunction &CGF;
3778 CGF.OMPCancelStack.enter(CGF, Kind, HasCancel);
3843 OMPPrivateScope &PrivateScope);
3845 OMPPrivateScope &PrivateScope);
3848 const llvm::DenseMap<const ValueDecl *, llvm::Value *>
3849 CaptureDeviceAddrMap);
3852 const llvm::DenseMap<const ValueDecl *, llvm::Value *>
3853 CaptureDeviceAddrMap);
3878 OMPPrivateScope &PrivateScope);
3888 llvm::Value *IsLastIterCond =
nullptr);
3906 OMPPrivateScope &PrivateScope,
3907 bool ForInscan =
false);
3947 OMPTargetDataInfo &InputInfo);
3950 OMPPrivateScope &
Scope);
4055 StringRef ParentName,
4082 StringRef ParentName,
4127 const Expr *LoopCond,
const Expr *IncExpr,
4134 OMPPrivateScope &LoopScope);
4164 struct OMPLoopArguments {
4174 llvm::Value *Chunk =
nullptr;
4176 Expr *EUB =
nullptr;
4178 Expr *IncExpr =
nullptr;
4182 Expr *Cond =
nullptr;
4184 Expr *NextLB =
nullptr;
4186 Expr *NextUB =
nullptr;
4189 OMPLoopArguments() =
default;
4191 llvm::Value *Chunk =
nullptr,
Expr *EUB =
nullptr,
4193 Expr *Cond =
nullptr,
Expr *NextLB =
nullptr,
4194 Expr *NextUB =
nullptr)
4195 : LB(LB), UB(UB), ST(ST), IL(IL), Chunk(Chunk), EUB(EUB),
4196 IncExpr(IncExpr),
Init(
Init), Cond(Cond), NextLB(NextLB),
4199 void EmitOMPOuterLoop(
bool DynamicOrOrdered,
bool IsMonotonic,
4201 const OMPLoopArguments &LoopArgs,
4204 void EmitOMPForOuterLoop(
const OpenMPScheduleTy &ScheduleKind,
4206 OMPPrivateScope &LoopScope,
bool Ordered,
4207 const OMPLoopArguments &LoopArgs,
4209 void EmitOMPDistributeOuterLoop(OpenMPDistScheduleClauseKind ScheduleKind,
4211 OMPPrivateScope &LoopScope,
4212 const OMPLoopArguments &LoopArgs,
4225 if (S.getStructuredBlock())
4365 llvm::AtomicOrdering AO,
bool IsVolatile =
false,
4371 bool IsVolatile,
bool isInit);
4375 llvm::AtomicOrdering
Success =
4376 llvm::AtomicOrdering::SequentiallyConsistent,
4377 llvm::AtomicOrdering
Failure =
4378 llvm::AtomicOrdering::SequentiallyConsistent,
4384 llvm::AtomicRMWInst::BinOp Op,
Address Addr, llvm::Value *Val,
4385 llvm::AtomicOrdering Order = llvm::AtomicOrdering::SequentiallyConsistent,
4386 llvm::SyncScope::ID SSID = llvm::SyncScope::System,
4393 llvm::SyncScope::ID SSID = llvm::SyncScope::System);
4420 bool isNontemporal =
false) {
4422 CGM.getTBAAAccessInfo(Ty), isNontemporal);
4428 bool isNontemporal =
false);
4442 bool isInit =
false,
bool isNontemporal =
false) {
4444 CGM.getTBAAAccessInfo(Ty), isInit, isNontemporal);
4450 bool isNontemporal =
false);
4458 bool isInit =
false);
4487 llvm::Value **
Result =
nullptr);
4500 llvm::CallBase **CallOrInvoke =
nullptr);
4509 bool Accessed =
false);
4514 bool IsLowerBound =
true);
4538 LValueBaseInfo *BaseInfo =
nullptr,
4539 TBAAAccessInfo *TBAAInfo =
nullptr);
4541 class ConstantEmission {
4542 llvm::PointerIntPair<llvm::Constant *, 1, bool> ValueAndIsReference;
4556 return ValueAndIsReference.getOpaqueValue() !=
nullptr;
4568 return ValueAndIsReference.getPointer();
4588 bool IsInBounds =
true);
4591 llvm::Value *ThisValue);
4622 llvm::CallBase **CallOrInvoke,
bool IsMustTail,
4624 bool IsVirtualFunctionPointerThunk =
false);
4627 llvm::CallBase **CallOrInvoke =
nullptr,
4628 bool IsMustTail =
false) {
4634 llvm::CallBase **CallOrInvoke =
nullptr,
4641 llvm::CallBase **CallOrInvoke =
nullptr);
4643 llvm::CallBase **CallOrInvoke =
nullptr);
4650 const Twine &name =
"");
4653 const Twine &name =
"");
4655 const Twine &Name =
"");
4658 const Twine &Name =
"");
4662 const Twine &Name =
"");
4665 llvm::Type *RetTy,
const Twine &Name =
"");
4667 const Twine &name =
"");
4670 const Twine &name =
"");
4673 const Twine &name =
"");
4680 const Twine &Name =
"");
4683 const Twine &name =
"");
4685 const Twine &name =
"");
4702 llvm::Value *Discriminator);
4704 llvm::Value *StorageAddress,
4705 llvm::ConstantInt *Discriminator);
4707 llvm::Value *StorageAddress,
4720 bool IsKnownNonNull);
4734 bool IsKnownNonNull);
4736 const Expr *PointerExpr,
4742 bool IsKnownNonNull);
4746 std::pair<llvm::Value *, CGPointerAuthInfo>
4787 CallArgList *RtlArgs, llvm::CallBase **CallOrInvoke);
4790 llvm::Value *ImplicitParam,
4792 llvm::CallBase **CallOrInvoke =
nullptr);
4795 llvm::CallBase **CallOrInvoke =
nullptr);
4799 const Expr *
Base, llvm::CallBase **CallOrInvoke);
4802 const Expr *E,
Address base, llvm::Value *memberPtr,
4807 llvm::CallBase **CallOrInvoke);
4812 llvm::CallBase **CallOrInvoke);
4817 llvm::CallBase **CallOrInvoke);
4828 bool InvertArg,
bool IsPop =
false);
4847 llvm::CallBase **CallOrInvoke);
4856 const llvm::CmpInst::Predicate Pred,
4857 const llvm::Twine &Name =
"");
4860 llvm::Triple::ArchType
Arch);
4863 llvm::Triple::ArchType
Arch);
4866 llvm::Triple::ArchType
Arch);
4874 unsigned AltLLVMIntrinsic,
const char *NameHint,
4875 unsigned Modifier,
const CallExpr *E,
4880 unsigned Modifier, llvm::Type *ArgTy,
4884 unsigned shift = 0,
bool rightshift =
false);
4887 const CallExpr *E,
const char *name);
4889 llvm::Type *Ty1,
bool Extract,
4891 const CallExpr *E,
const char *name);
4895 const CallExpr *E,
const char *name);
4899 const CallExpr *E,
const char *name);
4901 const llvm::ElementCount &Count);
4904 bool negateForRightShift);
4906 llvm::Type *Ty,
bool usgn,
const char *name);
4922 llvm::Type *ReturnType,
4929 unsigned BuiltinID);
4932 unsigned BuiltinID);
4934 llvm::ScalableVectorType *VTy);
4936 llvm::StructType *Ty);
4945 unsigned BuiltinID,
bool IsZExtReturn);
4948 unsigned BuiltinID);
4951 unsigned BuiltinID);
4983 llvm::Triple::ArchType
Arch);
5025 llvm::AtomicOrdering &AO,
5026 llvm::SyncScope::ID &SSID);
5065 bool resultIgnored);
5067 bool resultIgnored);
5081 llvm::Type *returnType);
5084 std::pair<LValue, llvm::Value *>
5088 std::pair<LValue, llvm::Value *>
5091 llvm::Value *
EmitObjCAlloc(llvm::Value *value, llvm::Type *returnType);
5093 llvm::Type *returnType);
5102 bool allowUnsafeClaim);
5166 llvm::TypeSize DstSize,
bool DstIsVolatile);
5175 bool IgnoreImag =
false);
5201 llvm::GlobalVariable *GV);
5212 llvm::Constant *
Addr);
5215 llvm::FunctionCallee Dtor,
5216 llvm::Constant *
Addr,
5217 llvm::FunctionCallee &
AtExit);
5222 llvm::Constant *addr);
5227 llvm::Constant *addr);
5247 llvm::BasicBlock *InitBlock,
5248 llvm::BasicBlock *NoInitBlock,
GuardKind Kind,
5262 ArrayRef<std::tuple<llvm::FunctionType *, llvm::WeakTrackingVH,
5264 DtorsOrStermFinalizers);
5267 llvm::GlobalVariable *
Addr,
5286 llvm::Value *AnnotatedVal,
5287 StringRef AnnotationStr,
5289 const AnnotateAttr *
Attr);
5320 bool AllowLabels =
false);
5326 bool AllowLabels =
false);
5340 llvm::BasicBlock *TrueBlock,
5341 llvm::BasicBlock *FalseBlock,
5342 uint64_t TrueCount = 0,
5344 const Expr *CntrIdx =
nullptr);
5352 llvm::BasicBlock *FalseBlock, uint64_t TrueCount,
5354 const Expr *ConditionalOp =
nullptr,
5355 const VarDecl *ConditionalDecl =
nullptr);
5367 Expr *pointerOperand, llvm::Value *pointer,
5369 bool isSubtraction);
5380 const Twine &Name =
"");
5383 llvm::Type *elementType,
bool SignedIndices,
5385 CharUnits Align,
const Twine &Name =
"");
5431 llvm::Value *Cond, llvm::ConstantInt *TypeId,
5442 bool NoMerge =
false,
const TrapReason *TR =
nullptr);
5446 llvm::CallInst *
EmitTrapCall(llvm::Intrinsic::ID IntrID,
5461 AbstractCallee AC,
unsigned ParmNum);
5496 unsigned NumElementsDst,
5497 const llvm::Twine &Name =
"");
5509 llvm::CallBase *addConvergenceControlToken(llvm::CallBase *Input);
5513 llvm::ConvergenceControlInst *
5514 getOrEmitConvergenceEntryToken(llvm::Function *F);
5517 llvm::MDNode *getRangeForLoadFromType(
QualType Ty);
5520 void deferPlaceholderReplacement(llvm::Instruction *Old, llvm::Value *
New);
5523 DeferredReplacements;
5527 assert(!LocalDeclMap.count(VD) &&
"Decl already exists in LocalDeclMap!");
5528 LocalDeclMap.insert({VD,
Addr});
5535 void ExpandTypeFromArgs(QualType Ty, LValue Dst,
5536 llvm::Function::arg_iterator &AI);
5541 void ExpandTypeToArgs(QualType Ty, CallArg Arg, llvm::FunctionType *IRFuncTy,
5542 SmallVectorImpl<llvm::Value *> &IRCallArgs,
5543 unsigned &IRCallArgPos);
5545 std::pair<llvm::Value *, llvm::Type *>
5546 EmitAsmInput(
const TargetInfo::ConstraintInfo &Info,
const Expr *InputExpr,
5547 std::string &ConstraintStr);
5549 std::pair<llvm::Value *, llvm::Type *>
5550 EmitAsmInputLValue(
const TargetInfo::ConstraintInfo &Info, LValue InputValue,
5551 QualType InputType, std::string &ConstraintStr,
5552 SourceLocation Loc);
5559 llvm::Value *evaluateOrEmitBuiltinObjectSize(
const Expr *E,
unsigned Type,
5560 llvm::IntegerType *ResType,
5561 llvm::Value *EmittedE,
5567 llvm::Value *emitBuiltinObjectSize(
const Expr *E,
unsigned Type,
5568 llvm::IntegerType *ResType,
5569 llvm::Value *EmittedE,
bool IsDynamic);
5571 llvm::Value *emitCountedBySize(
const Expr *E, llvm::Value *EmittedE,
5572 unsigned Type, llvm::IntegerType *ResType);
5574 llvm::Value *emitCountedByMemberSize(
const MemberExpr *E,
const Expr *Idx,
5575 llvm::Value *EmittedE,
5576 QualType CastedArrayElementTy,
5578 llvm::IntegerType *ResType);
5580 llvm::Value *emitCountedByPointerSize(
const ImplicitCastExpr *E,
5581 const Expr *Idx, llvm::Value *EmittedE,
5582 QualType CastedArrayElementTy,
5584 llvm::IntegerType *ResType);
5586 void emitZeroOrPatternForAutoVarInit(QualType type,
const VarDecl &D,
5602 llvm::PointerUnion<const FunctionProtoType *, const ObjCMethodDecl *>
P;
5609 llvm::iterator_range<CallExpr::const_arg_iterator> ArgRange,
5610 AbstractCallee AC = AbstractCallee(),
5611 unsigned ParamsToSkip = 0,
5649 std::optional<StringRef>
Arch = std::nullopt)
5674 void EmitDeclMetadata();
5677 const AutoVarEmission &emission);
5679 void AddObjCARCExceptionMetadata(llvm::Instruction *Inst);
5681 llvm::Value *GetValueForARMHint(
unsigned BuiltinID);
5682 llvm::Value *EmitX86CpuIs(
const CallExpr *E);
5683 llvm::Value *EmitX86CpuIs(StringRef CPUStr);
5684 llvm::Value *EmitX86CpuSupports(
const CallExpr *E);
5686 llvm::Value *EmitX86CpuSupports(std::array<uint32_t, 4> FeatureMask);
5687 llvm::Value *EmitX86CpuInit();
5688 llvm::Value *FormX86ResolverCondition(
const FMVResolverOption &RO);
5689 llvm::Value *EmitAArch64CpuInit();
5690 llvm::Value *FormAArch64ResolverCondition(
const FMVResolverOption &RO);
5691 llvm::Value *EmitAArch64CpuSupports(
const CallExpr *E);
5695inline DominatingLLVMValue::saved_type
5704 llvm::AllocaInst *AI =
5706 AI->setAlignment(align);
5727llvm::fp::ExceptionBehavior
Enums/classes describing ABI related information about constructors, destructors and thunks.
static bool CanThrow(Expr *E, ASTContext &Ctx)
static T * buildByrefHelpers(CodeGenModule &CGM, const BlockByrefInfo &byrefInfo, T &&generator)
Lazily build the copy and dispose helpers for a __block variable with the given information.
static bool isInAllocaArgument(CGCXXABI &ABI, QualType type)
CodeGenFunction::ComplexPairTy ComplexPairTy
Defines the clang::Expr interface and subclasses for C++ expressions.
llvm::MachO::Target Target
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a kind
Defines some OpenMP-specific enums and functions.
This file defines OpenACC AST classes for statement-level contructs.
This file defines OpenMP AST classes for executable directives and clauses.
This file defines SYCL AST classes used to represent calls to SYCL kernels.
C Language Family Type Representation.
This represents 'pragma omp atomic' directive.
This represents 'pragma omp barrier' directive.
This represents 'pragma omp cancel' directive.
This represents 'pragma omp cancellation point' directive.
This represents 'pragma omp critical' directive.
This represents 'pragma omp depobj' directive.
This represents 'pragma omp distribute' directive.
This represents 'pragma omp distribute parallel for' composite directive.
This represents 'pragma omp distribute parallel for simd' composite directive.
This represents 'pragma omp distribute simd' composite directive.
This represents 'pragma omp error' directive.
This represents 'pragma omp flush' directive.
This represents 'pragma omp for' directive.
This represents 'pragma omp for simd' directive.
Represents the 'pragma omp fuse' loop transformation directive.
This represents 'pragma omp loop' directive.
Represents the 'pragma omp interchange' loop transformation directive.
This represents 'pragma omp interop' directive.
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
This represents 'pragma omp masked' directive.
This represents 'pragma omp masked taskloop' directive.
This represents 'pragma omp masked taskloop simd' directive.
This represents 'pragma omp master' directive.
This represents 'pragma omp master taskloop' directive.
This represents 'pragma omp master taskloop simd' directive.
This represents block-associated 'pragma omp ordered' directive.
This represents standalone 'pragma omp ordered' directive.
This represents 'pragma omp parallel for' directive.
This represents 'pragma omp parallel for simd' directive.
This represents 'pragma omp parallel masked' directive.
This represents 'pragma omp parallel masked taskloop' directive.
This represents 'pragma omp parallel masked taskloop simd' directive.
This represents 'pragma omp parallel master' directive.
This represents 'pragma omp parallel master taskloop' directive.
This represents 'pragma omp parallel master taskloop simd' directive.
This represents 'pragma omp parallel sections' directive.
Represents the 'pragma omp reverse' loop transformation directive.
This represents 'pragma omp scan' directive.
This represents 'pragma omp scope' directive.
This represents 'pragma omp section' directive.
This represents 'pragma omp sections' directive.
This represents 'pragma omp simd' directive.
This represents 'pragma omp single' directive.
Represents the 'pragma omp split' loop transformation directive.
This represents the 'pragma omp stripe' loop transformation directive.
This represents 'pragma omp target data' directive.
This represents 'pragma omp target' directive.
This represents 'pragma omp target enter data' directive.
This represents 'pragma omp target exit data' directive.
This represents 'pragma omp target parallel' directive.
This represents 'pragma omp target parallel for' directive.
This represents 'pragma omp target parallel for simd' directive.
This represents 'pragma omp target parallel loop' directive.
This represents 'pragma omp target simd' directive.
This represents 'pragma omp target teams' directive.
This represents 'pragma omp target teams distribute' combined directive.
This represents 'pragma omp target teams distribute parallel for' combined directive.
This represents 'pragma omp target teams distribute parallel for simd' combined directive.
This represents 'pragma omp target teams distribute simd' combined directive.
This represents 'pragma omp target teams loop' directive.
This represents 'pragma omp target update' directive.
This represents 'pragma omp task' directive.
This represents 'pragma omp taskloop' directive.
This represents 'pragma omp taskloop simd' directive.
This represents 'pragma omp taskgroup' directive.
This represents 'pragma omp taskwait' directive.
This represents 'pragma omp taskyield' directive.
This represents 'pragma omp teams' directive.
This represents 'pragma omp teams distribute' directive.
This represents 'pragma omp teams distribute parallel for' composite directive.
This represents 'pragma omp teams distribute parallel for simd' composite directive.
This represents 'pragma omp teams distribute simd' combined directive.
This represents 'pragma omp teams loop' directive.
This represents the 'pragma omp tile' loop transformation directive.
This represents the 'pragma omp unroll' loop transformation directive.
This represents clause 'use_device_addr' in the 'pragma omp ...' directives.
This represents clause 'use_device_ptr' in the 'pragma omp ...' directives.
const Stmt * getAssociatedStmt() const
Stmt * getStructuredBlock()
Stmt * getStructuredBlock()
This class represents a 'loop' construct. The 'loop' construct applies to a 'for' loop (or range-for ...
a trap message and trap category.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
This structure holds the information gathered about the constraints for an inline assembly statement.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Attr - This represents one attribute.
Represents an attribute applied to a statement.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
A builtin binary operation expression such as "x + y" or "x <= y".
static bool isLogicalOp(Opcode Opc)
BinaryOperatorKind Opcode
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a call to a CUDA kernel function.
Represents binding an expression to a temporary.
Represents a call to a C++ constructor.
Represents a C++ constructor within a class.
A default argument (C++ [dcl.fct.default]).
A use of a default initializer in a constructor or in aggregate initialization.
Represents a delete expression for memory deallocation and destructor calls, e.g.
Represents a C++ destructor within a class.
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Represents a call to an inherited base class constructor from an inheriting constructor.
Represents a call to a member function that may be written either with member call syntax (e....
Represents a static or instance method of a struct/union/class.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
A call to an overloaded operator written using operator syntax.
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Represents a C++ struct/union/class.
Represents a C++ temporary.
A C++ throw-expression (C++ [except.throw]).
CXXTryStmt - A C++ try block, including all handlers.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
This captures a statement into a function.
const Capture * const_capture_iterator
capture_iterator capture_end() const
Retrieve an iterator pointing past the end of the sequence of captures.
const RecordDecl * getCapturedRecordDecl() const
Retrieve the record declaration for captured variables.
capture_iterator capture_begin()
Retrieve an iterator pointing to the first capture.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
const CXXBaseSpecifier *const * path_const_iterator
CharUnits - This is an opaque type for sizes expressed in character units.
bool isZero() const
isZero - Test whether the quantity equals zero.
llvm::Align getAsAlign() const
getAsAlign - Returns Quantity as a valid llvm::Align, Beware llvm::Align assumes power of two 8-bit b...
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
llvm::Value * getBasePointer() const
llvm::Value * emitRawPointer(CodeGenFunction &CGF) const
Return the pointer contained in this class after authenticating it and adding offset to it if necessa...
CharUnits getAlignment() const
llvm::Type * getElementType() const
Return the type of the values stored in this address.
void setAlignment(CharUnits Value)
llvm::Value * getOffset() const
void replaceBasePointer(llvm::Value *P)
This function is used in situations where the caller is doing some sort of opaque "laundering" of the...
llvm::PointerType * getType() const
Return the type of the pointer value.
static AggValueSlot ignored()
ignored - Returns an aggregate value slot indicating that the aggregate value is being ignored.
static AggValueSlot forAddr(Address addr, Qualifiers quals, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed, IsSanitizerChecked_t isChecked=IsNotSanitizerChecked)
forAddr - Make a slot for an aggregate value.
A scoped helper to set the current source atom group for CGDebugInfo::addInstToCurrentSourceAtom.
A pair of helper functions for a __block variable.
Information about the layout of a __block variable.
CGBlockInfo - Information to generate a block literal.
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
llvm::StoreInst * CreateAlignedStore(llvm::Value *Val, llvm::Value *Addr, CharUnits Align, bool IsVolatile=false)
llvm::LoadInst * CreateAlignedLoad(llvm::Type *Ty, llvm::Value *Addr, CharUnits Align, const llvm::Twine &Name="")
Implements C++ ABI-specific code generation functions.
All available information about a concrete callee.
This class gathers all debug information during compilation and is responsible for emitting to llvm g...
CGFunctionInfo - Class to encapsulate the information about a function definition.
CallArgList - Type for representing both the value and type of arguments in a call.
AbstractCallee(const ObjCMethodDecl *OMD)
const ParmVarDecl * getParamDecl(unsigned I) const
const Decl * getDecl() const
unsigned getNumParams() const
bool hasFunctionDecl() const
AbstractCallee(const FunctionDecl *FD)
ArrayInitLoopExprScope(CodeGenFunction &CGF, llvm::Value *Index)
~ArrayInitLoopExprScope()
Address getAllocatedAddress() const
Returns the raw, allocated address, which is not necessarily the address of the object itself.
friend class CodeGenFunction
bool useLifetimeMarkers() const
RawAddress getOriginalAllocatedAddress() const
Returns the address for the original alloca instruction.
Address getObjectAddress(CodeGenFunction &CGF) const
Returns the address of the object within this declaration.
static AutoVarEmission invalid()
CGAtomicOptionsRAII(CodeGenModule &CGM_, AtomicOptions AO)
CGAtomicOptionsRAII(CodeGenModule &CGM_, const AtomicAttr *AA)
CGAtomicOptionsRAII(const CGAtomicOptionsRAII &)=delete
CGAtomicOptionsRAII & operator=(const CGAtomicOptionsRAII &)=delete
API for captured statement code generation.
CapturedRegionKind getKind() const
virtual llvm::Value * getContextValue() const
virtual ~CGCapturedStmtInfo()
static bool classof(const CGCapturedStmtInfo *)
virtual void setContextValue(llvm::Value *V)
bool isCXXThisExprCaptured() const
virtual FieldDecl * getThisFieldDecl() const
llvm::SmallDenseMap< const VarDecl *, FieldDecl * > getCaptureFields()
Get the CaptureFields.
CGCapturedStmtInfo(CapturedRegionKind K=CR_Default)
virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S)
Emit the captured statement body.
virtual StringRef getHelperName() const
Get the name of the capture helper.
CGCapturedStmtInfo(const CapturedStmt &S, CapturedRegionKind K=CR_Default)
virtual const FieldDecl * lookup(const VarDecl *VD) const
Lookup the captured field decl for a variable.
CGCapturedStmtRAII(CodeGenFunction &CGF, CGCapturedStmtInfo *NewCapturedStmtInfo)
CGFPOptionsRAII(CodeGenFunction &CGF, FPOptions FPFeatures)
CharUnits OldCXXThisAlignment
~CXXDefaultInitExprScope()
SourceLocExprScopeGuard SourceLocScope
llvm::Value * OldCXXThisValue
CXXDefaultInitExprScope(CodeGenFunction &CGF, const CXXDefaultInitExpr *E)
void Emit(CodeGenFunction &CGF, Flags flags) override
CallLifetimeEnd(RawAddress addr)
An object to manage conditionally-evaluated expressions.
llvm::BasicBlock * getStartingBlock() const
Returns a block which will be executed prior to each evaluation of the conditional code.
void begin(CodeGenFunction &CGF)
ConditionalEvaluation(CodeGenFunction &CGF)
void end(CodeGenFunction &CGF)
static ConstantEmission forValue(llvm::Constant *C)
static ConstantEmission forReference(llvm::Constant *C)
LValue getReferenceLValue(CodeGenFunction &CGF, const Expr *RefExpr) const
llvm::Constant * getValue() const
void Emit(CodeGenFunction &CGF, Flags flags) override
FieldConstructionScope(CodeGenFunction &CGF, Address This)
~FieldConstructionScope()
A class controlling the emission of a finally block.
void exit(CodeGenFunction &CGF)
void enter(CodeGenFunction &CGF, const Stmt *Finally, llvm::FunctionCallee beginCatchFn, llvm::FunctionCallee endCatchFn, llvm::FunctionCallee rethrowFn)
Enters a finally block for an implementation using zero-cost exceptions.
InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)
~InlinedInheritingConstructorScope()
void rescopeLabels()
Change the cleanup scope of the labels in this lexical scope to match the scope of the enclosing cont...
void addLabel(const LabelDecl *label)
~LexicalScope()
Exit this cleanup scope, emitting any accumulated cleanups.
void ForceCleanup()
Force the emission of cleanups now, instead of waiting until this object is destroyed.
InlinedRegionBodyRAII(CodeGenFunction &cgf, InsertPointTy &AllocaIP, llvm::BasicBlock &FiniBB)
OMPAllocateCleanupTy(llvm::CallInst *RLFnCI)
void Emit(CodeGenFunction &CGF, Flags) override
OutlinedRegionBodyRAII(CodeGenFunction &cgf, InsertPointTy &AllocaIP, llvm::BasicBlock &RetBB)
~OutlinedRegionBodyRAII()
OMPCancelStackRAII(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel)
OMPLocalDeclMapRAII(CodeGenFunction &CGF)
The class used to assign some variables some temporarily addresses.
bool apply(CodeGenFunction &CGF)
Applies new addresses to the list of the variables.
void restore(CodeGenFunction &CGF)
Restores original addresses of the variables.
bool setVarAddr(CodeGenFunction &CGF, const VarDecl *LocalVD, Address TempAddr)
Sets the address of the variable LocalVD to be TempAddr in function CGF.
The scope used to remap some variables as private in the OpenMP loop body (or other captured region e...
void restoreMap()
Restore all mapped variables w/o clean up.
bool Privatize()
Privatizes local variables previously registered as private.
bool isGlobalVarCaptured(const VarDecl *VD) const
Checks if the global variable is captured in current function.
OMPPrivateScope(CodeGenFunction &CGF)
Enter a new OpenMP private scope.
~OMPPrivateScope()
Exit scope - all the mapped variables are restored.
bool addPrivate(const VarDecl *LocalVD, Address Addr)
Registers LocalVD variable as a private with Addr as the address of the corresponding private variabl...
A non-RAII class containing all the information about a bound opaque value.
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const LValue &lv)
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const RValue &rv)
static bool shouldBindAsLValue(const Expr *expr)
void unbind(CodeGenFunction &CGF)
static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const Expr *e)
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *OV)
Build the opaque value mapping for an OpaqueValueExpr whose source expression is set to the expressio...
OpaqueValueMapping(CodeGenFunction &CGF, const AbstractConditionalOperator *op)
Build the opaque value mapping for the given conditional operator if it's the GNU ?
static bool shouldBindAsLValue(const Expr *expr)
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, RValue rvalue)
OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, LValue lvalue)
llvm::Value * getDirectValue() const
Address getIndirectAddress() const
static ParamValue forIndirect(Address addr)
static ParamValue forDirect(llvm::Value *value)
llvm::Value * getAnyValue() const
ParentLoopDirectiveForScanRegion(CodeGenFunction &CGF, const OMPExecutableDirective &ParentLoopDirectiveForScan)
~ParentLoopDirectiveForScanRegion()
An object which temporarily prevents a value from being destroyed by aggressive peephole optimization...
friend class CodeGenFunction
PeepholeProtection()=default
RunCleanupsScope(CodeGenFunction &CGF)
Enter a new cleanup scope.
~RunCleanupsScope()
Exit this cleanup scope, emitting any accumulated cleanups.
void ForceCleanup(std::initializer_list< llvm::Value ** > ValuesToReload={})
Force the emission of cleanups now, instead of waiting until this object is destroyed.
bool requiresCleanups() const
Determine whether this scope requires any cleanups.
SanitizerScope(CodeGenFunction *CGF)
StmtExprEvaluation(CodeGenFunction &CGF)
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
EHScopeStack::stable_iterator CurrentCleanupScopeDepth
llvm::CallInst * EmitIntrinsicCall(llvm::Intrinsic::ID ID, ArrayRef< llvm::Value * > Args, const Twine &Name="")
RValue EmitAMDGPUDevicePrintfCallExpr(const CallExpr *E)
LValue EmitMatrixSubscriptExpr(const MatrixSubscriptExpr *E)
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.
LValue EmitCoawaitLValue(const CoawaitExpr *E)
llvm::Value * GetVTablePtr(Address This, llvm::Type *VTableTy, const CXXRecordDecl *VTableClass, VTableAuthMode AuthMode=VTableAuthMode::Authenticate)
GetVTablePtr - Return the Value of the vtable pointer member pointed to by This.
void EmitOMPParallelMaskedTaskLoopDirective(const OMPParallelMaskedTaskLoopDirective &S)
RValue EmitNVPTXDevicePrintfCallExpr(const CallExpr *E)
llvm::Value * EmitSVEPredicateCast(llvm::Value *Pred, llvm::ScalableVectorType *VTy)
StringRef AMDGPUAvailableVisibleMode
The mode string from the amdgpu_av attribute on the current statement, or empty if the attribute is n...
llvm::Value * EmitAVRBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::Value * EmitObjCConsumeObject(QualType T, llvm::Value *Ptr)
Produce the code for a CK_ARCConsumeObject.
llvm::Value * EmitFP8NeonFMLACall(unsigned IID, bool ExtendLaneArg, llvm::Type *RetTy, SmallVectorImpl< llvm::Value * > &Ops, const CallExpr *E, const char *name)
void EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)
Emit code in this function to perform a guarded variable initialization.
void EmitBoundsCheckImpl(const Expr *ArrayExpr, QualType ArrayBaseType, llvm::Value *IndexVal, QualType IndexType, llvm::Value *BoundsVal, QualType BoundsType, bool Accessed)
void EmitRISCVMultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)
void EmitOMPParallelMaskedDirective(const OMPParallelMaskedDirective &S)
void EmitOMPTaskyieldDirective(const OMPTaskyieldDirective &S)
LValue EmitLoadOfReferenceLValue(LValue RefLVal)
void EmitCXXTryStmt(const CXXTryStmt &S)
GlobalDecl CurGD
CurGD - The GlobalDecl for the current function being compiled.
void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount, Stmt::Likelihood LH=Stmt::LH_None, const Expr *ConditionalOp=nullptr, const VarDecl *ConditionalDecl=nullptr)
EmitBranchOnBoolExpr - Emit a branch on a boolean condition (e.g.
void setCurrentProfileCount(uint64_t Count)
Set the profiler's current count.
llvm::CallInst * EmitTrapCall(llvm::Intrinsic::ID IntrID, bool EnsureInsertPoint=true)
Emit a call to trap or debugtrap.
llvm::Constant * createAtExitStub(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr)
Create a stub function, suitable for being passed to atexit, which passes the given address to the gi...
void EmitSehCppScopeBegin()
llvm::Value * EmitObjCAutorelease(llvm::Value *value, llvm::Type *returnType)
Autorelease the given object.
RValue EmitObjCMessageExpr(const ObjCMessageExpr *E, ReturnValueSlot Return=ReturnValueSlot())
llvm::Value * emitBoolVecConversion(llvm::Value *SrcVec, unsigned NumElementsDst, const llvm::Twine &Name="")
void EmitOMPLastprivateClauseFinal(const OMPExecutableDirective &D, bool NoFinals, llvm::Value *IsLastIterCond=nullptr)
Emit final copying of lastprivate values to original variables at the end of the worksharing or simd ...
void EmitCXXConstructExpr(const CXXConstructExpr *E, AggValueSlot Dest)
CurrentSourceLocExprScope CurSourceLocExprScope
Source location information about the default argument or member initializer expression we're evaluat...
void EmitARCMoveWeak(Address dst, Address src)
void @objc_moveWeak(i8** dest, i8** src) Disregards the current value in dest.
llvm::BasicBlock * getFuncletEHDispatchBlock(EHScopeStack::stable_iterator scope)
void EmitAArch64MultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)
void EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor, const FunctionArgList &Args)
void processInReduction(const OMPExecutableDirective &S, OMPTaskDataTy &Data, CodeGenFunction &CGF, const CapturedStmt *CS, OMPPrivateScope &Scope)
llvm::Value * EmitARCRetainAutoreleaseReturnValue(llvm::Value *value)
Do a fused retain/autorelease of the given object.
void emitDestroy(Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
emitDestroy - Immediately perform the destruction of the given object.
LValue EmitCXXConstructLValue(const CXXConstructExpr *E)
void EmitMustTailThunk(GlobalDecl GD, llvm::Value *AdjustedThisPtr, llvm::FunctionCallee Callee)
Emit a musttail call for a thunk with a potentially adjusted this pointer.
static Destroyer destroyNonTrivialCStruct
AggValueSlot::Overlap_t getOverlapForFieldInit(const FieldDecl *FD)
Determine whether a field initialization may overlap some other object.
RValue EmitCoroutineIntrinsic(const CallExpr *E, unsigned int IID)
bool isBinaryLogicalOp(const Expr *E) const
llvm::Value * BuildVector(ArrayRef< llvm::Value * > Ops)
void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor, CXXCtorType CtorType, const FunctionArgList &Args, SourceLocation Loc)
void ActivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
ActivateCleanupBlock - Activates an initially-inactive cleanup.
void emitByrefStructureInit(const AutoVarEmission &emission)
Initialize the structural components of a __block variable, i.e.
llvm::CallInst * EmitIntrinsicCall(llvm::Intrinsic::ID ID, ArrayRef< llvm::Value * > Args, llvm::Type *RetTy, const Twine &Name="")
llvm::Value * performAddrSpaceCast(llvm::Value *Src, llvm::Type *DestTy)
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...
LValue EmitConditionalOperatorLValue(const AbstractConditionalOperator *E)
llvm::Value * EmitARCReclaimReturnedObject(const Expr *e, bool allowUnsafeClaim)
std::pair< LValue, llvm::Value * > EmitARCStoreAutoreleasing(const BinaryOperator *e)
void EmitOMPTaskLoopBasedDirective(const OMPLoopDirective &S)
ComplexPairTy EmitComplexPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
void SetDivFPAccuracy(llvm::Value *Val)
Set the minimum required accuracy of the given sqrt operation based on CodeGenOpts.
llvm::Value * EmitARCUnsafeUnretainedScalarExpr(const Expr *expr)
EmitARCUnsafeUnretainedScalarExpr - Semantically equivalent to immediately releasing the resut of Emi...
llvm::Value * EmitObjCSelectorExpr(const ObjCSelectorExpr *E)
Emit a selector.
llvm::Value * EmitScalarOrConstFoldImmArg(unsigned ICEArguments, unsigned Idx, const CallExpr *E)
void BuildBlockRelease(llvm::Value *DeclPtr, BlockFieldFlags flags, bool CanThrow)
llvm::Function * createTLSAtExitStub(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr, llvm::FunctionCallee &AtExit)
Create a stub function, suitable for being passed to __pt_atexit_np, which passes the given address t...
SanitizerSet SanOpts
Sanitizers enabled for this function.
void emitOMPSimpleStore(LValue LVal, RValue RVal, QualType RValTy, SourceLocation Loc)
static void EmitOMPTargetParallelDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelDirective &S)
void EmitAsanPrologueOrEpilogue(bool Prologue)
CounterForIncrement
Used to specify which counter in a pair shall be incremented.
@ UseSkipPath
Skip (false)
void callCStructMoveConstructor(LValue Dst, LValue Src)
void EmitInlinedInheritingCXXConstructorCall(const CXXConstructorDecl *Ctor, CXXCtorType CtorType, bool ForVirtualBase, bool Delegating, CallArgList &Args)
Emit a call to an inheriting constructor (that is, one that invokes a constructor inherited from a ba...
void pushStackRestore(CleanupKind kind, Address SPMem)
LValue EmitInitListLValue(const InitListExpr *E)
bool isUnderlyingBasePointerConstantNull(const Expr *E)
Check whether the underlying base pointer is a constant null.
llvm::DenseMap< const VarDecl *, llvm::Value * > NRVOFlags
A mapping from NRVO variables to the flags used to indicate when the NRVO has been applied to this va...
void EmitNullInitialization(Address DestPtr, QualType Ty)
EmitNullInitialization - Generate code to set a value of the given type to null, If the type contains...
bool IsOutlinedSEHHelper
True if the current function is an outlined SEH helper.
void EmitARCInitWeak(Address addr, llvm::Value *value)
i8* @objc_initWeak(i8** addr, i8* value) Returns value.
void EmitOMPCanonicalLoop(const OMPCanonicalLoop *S)
Emit an OMPCanonicalLoop using the OpenMPIRBuilder.
llvm::Value * getSelectorFromSlot()
llvm::Value * getExceptionFromSlot()
Returns the contents of the function's exception object and selector slots.
void checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl)
LValue EmitArraySubscriptExpr(const ArraySubscriptExpr *E, bool Accessed=false)
llvm::Value * EmitSVEStructLoad(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
Address LoadCXXThisAddress()
static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts=false)
ContainsLabel - Return true if the statement contains a label in it.
llvm::Value * EmitSVEMaskedLoad(const CallExpr *, llvm::Type *ReturnTy, SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID, bool IsZExtReturn)
llvm::CallInst * EmitRuntimeCall(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args, const Twine &name="")
void EmitPPCAIXMultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)
define internal ptr @foo.resolver() { entry: is_version_1 = __builtin_cpu_supports(version_1) br i1 %...
Address LoadBlockStruct()
bool ShouldSkipSanitizerInstrumentation()
ShouldSkipSanitizerInstrumentation - Return true if the current function should not be instrumented w...
llvm::Value * EmitPPCBuiltinCpu(unsigned BuiltinID, llvm::Type *ReturnType, StringRef CPUStr)
llvm::Value * EmitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E)
void EmitCXXForRangeStmt(const CXXForRangeStmt &S, ArrayRef< const Attr * > Attrs={})
void EmitOMPGenericLoopDirective(const OMPGenericLoopDirective &S)
SmallVector< Address, 1 > SEHCodeSlotStack
A stack of exception code slots.
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...
llvm::Value * EmitFP8NeonCall(unsigned IID, ArrayRef< llvm::Type * > Tys, SmallVectorImpl< llvm::Value * > &O, const CallExpr *E, const char *name)
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E)
llvm::Value * GetCountedByFieldExprGEP(const Expr *Base, const FieldDecl *FD, const FieldDecl *CountDecl)
llvm::BlockAddress * GetAddrOfLabel(const LabelDecl *L)
void VolatilizeTryBlocks(llvm::BasicBlock *BB, llvm::SmallPtrSet< llvm::BasicBlock *, 10 > &V)
LValue MakeAddrLValue(llvm::Value *V, QualType T, CharUnits Alignment, AlignmentSource Source=AlignmentSource::Type)
llvm::Value * EmitRISCVCpuSupports(const CallExpr *E)
void EmitOMPScanDirective(const OMPScanDirective &S)
void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit)
EmitComplexExprIntoLValue - Emit the given expression of complex type and place its result into the s...
llvm::BasicBlock * getInvokeDestImpl()
llvm::Value * EmitRISCVCpuInit()
const CastExpr * CurCast
If a cast expression is being visited, this holds the current cast's expression.
static bool hasScalarEvaluationKind(QualType T)
llvm::Type * ConvertType(QualType T)
bool isCleanupPadScope() const
Returns true while emitting a cleanuppad.
llvm::Value * EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx)
void EmitOpenACCExitDataConstruct(const OpenACCExitDataConstruct &S)
void GenerateCode(GlobalDecl GD, llvm::Function *Fn, const CGFunctionInfo &FnInfo)
Address EmitCXXUuidofExpr(const CXXUuidofExpr *E)
AwaitSuspendWrapperInfo CurAwaitSuspendWrapper
void EmitFakeUse(Address Addr)
llvm::function_ref< std::pair< llvm::Value *, llvm::Value * >(CodeGenFunction &, const OMPExecutableDirective &S, Address LB, Address UB)> CodeGenDispatchBoundsTy
void EmitSanitizerStatReport(llvm::SanitizerStatKind SSK)
static Destroyer destroyARCWeak
LValue InitCapturedStruct(const CapturedStmt &S)
void addInstToNewSourceAtom(llvm::Instruction *KeyInstruction, llvm::Value *Backup)
Add KeyInstruction and an optional Backup instruction to a new atom group (See ApplyAtomGroup for mor...
FieldDecl * LambdaThisCaptureField
CGCapturedStmtInfo * CapturedStmtInfo
void EmitOMPDistributeDirective(const OMPDistributeDirective &S)
BuiltinCheckKind
Specifies which type of sanitizer check to apply when handling a particular builtin.
Address recoverAddrOfEscapedLocal(CodeGenFunction &ParentCGF, Address ParentVar, llvm::Value *ParentFP)
Recovers the address of a local in a parent function.
RValue EmitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *E)
llvm::Value * EmitSVEGatherPrefetch(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
llvm::Value * EmitObjCProtocolExpr(const ObjCProtocolExpr *E)
void EmitOMPParallelForDirective(const OMPParallelForDirective &S)
llvm::CallBase * EmitCallOrInvoke(llvm::FunctionCallee 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...
llvm::Value * EmitSystemZBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void pushEHDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)
pushEHDestroy - Push the standard destructor for the given type as an EH-only cleanup.
void EmitNoreturnRuntimeCallOrInvoke(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args)
Emits a call or invoke to the given noreturn runtime function.
llvm::CallBase * EmitRuntimeCallOrInvoke(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args, const Twine &name="")
Emits a call or invoke instruction to the given runtime function.
void callCStructDestructor(LValue Dst)
RValue EmitCXXMemberOrOperatorMemberCallExpr(const CallExpr *CE, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue, bool HasQualifier, NestedNameSpecifier Qualifier, bool IsArrow, const Expr *Base, llvm::CallBase **CallOrInvoke)
PeepholeProtection protectFromPeepholes(RValue rvalue)
protectFromPeepholes - Protect a value that we're intending to store to the side, but which will prob...
ComplexPairTy EmitLoadOfComplex(LValue src, SourceLocation loc)
EmitLoadOfComplex - Load a complex number from the specified l-value.
void EmitOMPMasterDirective(const OMPMasterDirective &S)
llvm::Value * EmitSEHAbnormalTermination()
void EmitOMPParallelMasterTaskLoopSimdDirective(const OMPParallelMasterTaskLoopSimdDirective &S)
RValue emitStdcFirstBit(const CallExpr *E, llvm::Intrinsic::ID IntID, bool InvertArg)
llvm::Value * EmitARCAutoreleaseReturnValue(llvm::Value *value)
Autorelease the given object.
bool inSuspendBlock() const
llvm::Value * EmitARCRetain(QualType type, llvm::Value *value)
Produce the code to do a retain.
llvm::Value * EmitPointerAuthQualify(PointerAuthQualifier Qualifier, llvm::Value *Pointer, QualType ValueType, Address StorageAddress, bool IsKnownNonNull)
void EmitVTablePtrCheckForCall(const CXXRecordDecl *RD, llvm::Value *VTable, CFITypeCheckKind TCK, SourceLocation Loc)
EmitVTablePtrCheckForCall - Virtual method MD is being called via VTable.
void EmitLambdaStaticInvokeBody(const CXXMethodDecl *MD)
CleanupKind getARCCleanupKind()
Retrieves the default cleanup kind for an ARC cleanup.
CGPointerAuthInfo EmitPointerAuthInfo(const PointerAuthSchema &Schema, llvm::Value *StorageAddress, llvm::ConstantInt *Discriminator)
llvm::Value * EmitARCAutorelease(llvm::Value *value)
Autorelease the given object.
void EmitOMPSimdInit(const OMPLoopDirective &D)
Helpers for the OpenMP loop directives.
llvm::Value * EmitARCRetainAutoreleaseScalarExpr(const Expr *expr)
llvm::Value * EmitSMEReadWrite(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
llvm::Type * SVEBuiltinMemEltTy(const SVETypeFlags &TypeFlags)
SVEBuiltinMemEltTy - Returns the memory element type for this memory access builtin.
const OMPExecutableDirective * OMPParentLoopDirectiveForScan
Parent loop-based directive for scan directive.
bool shouldUseFusedARCCalls()
llvm::Value * EmitSVEScatterStore(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
void EmitOpenACCInitConstruct(const OpenACCInitConstruct &S)
bool CurFuncIsThunk
In C++, whether we are code generating a thunk.
void EmitAtomicInit(Expr *E, LValue lvalue)
void EmitLambdaDelegatingInvokeBody(const CXXMethodDecl *MD, CallArgList &CallArgs)
void EmitAggFinalDestCopy(QualType Type, AggValueSlot Dest, const LValue &Src, ExprValueKind SrcKind)
EmitAggFinalDestCopy - Emit copy of the specified aggregate into destination address.
void AddAMDGPUAvailableVisibleMMRA(llvm::Instruction *Inst)
Attach the AMDGPU availability/visibility MMRA to Inst when the amdgpu_av attribute is active on the ...
void EmitARCDestroyWeak(Address addr)
void @objc_destroyWeak(i8** addr) Essentially objc_storeWeak(addr, nil).
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 ...
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 EmitOMPFlushDirective(const OMPFlushDirective &S)
void EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst)
llvm::Value * EmitVAStartEnd(llvm::Value *ArgValue, bool IsStart)
Emits a call to an LLVM variable-argument intrinsic, either llvm.va_start or llvm....
RValue EmitBlockCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)
static void EmitOMPTargetDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetDirective &S)
Emit device code for the target directive.
llvm::Value * EmitSVEMaskedStore(const CallExpr *, SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID)
LValue EmitObjCEncodeExprLValue(const ObjCEncodeExpr *E)
void EmitSehTryScopeEnd()
bool EmitOMPFirstprivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
void EmitObjCRelease(llvm::Value *value, ARCPreciseLifetime_t precise)
Release the given object.
void EmitOMPTaskgroupDirective(const OMPTaskgroupDirective &S)
JumpDest getJumpDestForLabel(const LabelDecl *S)
getBasicBlockForLabel - Return the LLVM basicblock that the specified label maps to.
void EmitCoreturnStmt(const CoreturnStmt &S)
void EmitOMPTargetTeamsDistributeParallelForSimdDirective(const OMPTargetTeamsDistributeParallelForSimdDirective &S)
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...
void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint=true)
SmallVector< llvm::ConvergenceControlInst *, 4 > ConvergenceTokenStack
Stack to track the controlled convergence tokens.
RValue emitStdcBitWidthMinus(const CallExpr *E, llvm::Intrinsic::ID IntID, bool IsPop)
static void EmitOMPTargetTeamsDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDirective &S)
Emit device code for the target teams directive.
llvm::Value * EmitAMDGPUBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
LValue EmitCompoundLiteralLValue(const CompoundLiteralExpr *E)
bool isSEHTryScope() const
Returns true inside SEH __try blocks.
void registerGlobalDtorWithAtExit(const VarDecl &D, llvm::FunctionCallee fn, llvm::Constant *addr)
Call atexit() with a function that passes the given argument to the given function.
llvm::Value * EmitObjCAllocInit(llvm::Value *value, llvm::Type *resultType)
void unprotectFromPeepholes(PeepholeProtection protection)
void EmitOMPReductionClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope, bool ForInscan=false)
Emit initial code for reduction variables.
void EmitObjCAtThrowStmt(const ObjCAtThrowStmt &S)
void EmitOMPDistributeSimdDirective(const OMPDistributeSimdDirective &S)
void EmitSynthesizedCXXCopyCtor(Address Dest, Address Src, const Expr *Exp)
RValue convertTempToRValue(Address addr, QualType type, SourceLocation Loc)
Given the address of a temporary variable, produce an r-value of its type.
LValue EmitObjCIsaExpr(const ObjCIsaExpr *E)
void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, llvm::Value **Result=nullptr)
EmitStoreThroughBitfieldLValue - Store Src into Dst with same constraints as EmitStoreThroughLValue.
llvm::Value * EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void EmitAutoVarDecl(const VarDecl &D)
EmitAutoVarDecl - Emit an auto variable declaration.
llvm::Constant * EmitCheckSourceLocation(SourceLocation Loc)
Emit a description of a source location in a format suitable for passing to a runtime sanitizer handl...
void EmitObjCAutoreleasePoolCleanup(llvm::Value *Ptr)
LValue EmitCXXUuidofLValue(const CXXUuidofExpr *E)
bool hasVolatileMember(QualType T)
hasVolatileMember - returns true if aggregate type has a volatile member.
void enterByrefCleanup(CleanupKind Kind, Address Addr, BlockFieldFlags Flags, bool LoadBlockVarAddr, bool CanThrow)
Enter a cleanup to destroy a __block variable.
void EmitAutoVarInit(const AutoVarEmission &emission)
llvm::Value * EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
void SetSqrtFPAccuracy(llvm::Value *Val)
Set the minimum required accuracy of the given sqrt operation based on CodeGenOpts.
static void EmitOMPTargetTeamsDistributeDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeDirective &S)
Emit device code for the target teams distribute directive.
RValue EmitSimpleCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke=nullptr)
Emit a CallExpr without considering whether it might be a subclass.
llvm::SmallVector< DeferredDeactivateCleanup > DeferredDeactivationCleanupStack
RValue EmitVAArg(VAArgExpr *VE, Address &VAListAddr, AggValueSlot Slot=AggValueSlot::ignored())
Generate code to get an argument from the passed in pointer and update it accordingly.
static bool isNullPointerAllowed(TypeCheckKind TCK)
Determine whether the pointer type check TCK permits null pointers.
void EmitForwardingCallToLambda(const CXXMethodDecl *LambdaCallOperator, CallArgList &CallArgs, const CGFunctionInfo *CallOpFnInfo=nullptr, llvm::Constant *CallOpFn=nullptr)
void EmitReturnValueCheck(llvm::Value *RV)
Emit a test that checks if the return value RV is nonnull.
llvm::Value * getAsNaturalPointerTo(Address Addr, QualType PointeeType)
bool EmitSimpleStmt(const Stmt *S, ArrayRef< const Attr * > Attrs)
EmitSimpleStmt - Try to emit a "simple" statement which does not necessarily require an insertion poi...
RValue emitBuiltinOSLogFormat(const CallExpr &E)
Emit IR for __builtin_os_log_format.
llvm::Function * GenerateOpenMPCapturedStmtFunctionAggregate(const CapturedStmt &S, const OMPExecutableDirective &D)
llvm::Value * emitPointerAuthResignCall(llvm::Value *Pointer, const CGPointerAuthInfo &CurInfo, const CGPointerAuthInfo &NewInfo)
void EmitOMPTaskwaitDirective(const OMPTaskwaitDirective &S)
RValue EmitPseudoObjectRValue(const PseudoObjectExpr *e, AggValueSlot slot=AggValueSlot::ignored())
void EmitDelegateCallArg(CallArgList &args, const VarDecl *param, SourceLocation loc)
EmitDelegateCallArg - We are performing a delegate call; that is, the current function is delegating ...
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
void FinishObjCDirectPreconditionThunk()
Finish an Objective-C direct method thunk.
void EmitOMPTargetParallelForDirective(const OMPTargetParallelForDirective &S)
void maybeUpdateMCDCTestVectorBitmap(const Expr *E)
Increment the profiler's counter for the given expression by StepV.
void addInstToCurrentSourceAtom(llvm::Instruction *KeyInstruction, llvm::Value *Backup)
See CGDebugInfo::addInstToCurrentSourceAtom.
unsigned getDebugInfoFIndex(const RecordDecl *Rec, unsigned FieldIndex)
Get the record field index as represented in debug info.
AggValueSlot::Overlap_t getOverlapForBaseInit(const CXXRecordDecl *RD, const CXXRecordDecl *BaseRD, bool IsVirtual)
Determine whether a base class initialization may overlap some other object.
void EmitCXXDeleteExpr(const CXXDeleteExpr *E)
llvm::Value * EmitObjCArrayLiteral(const ObjCArrayLiteral *E)
llvm::Function * generateBuiltinOSLogHelperFunction(const analyze_os_log::OSLogBufferLayout &Layout, CharUnits BufferAlignment)
llvm::Value * EmitPromotedScalarExpr(const Expr *E, QualType PromotionType)
const LangOptions & getLangOpts() const
void addInstToSpecificSourceAtom(llvm::Instruction *KeyInstruction, llvm::Value *Backup, uint64_t Atom)
See CGDebugInfo::addInstToSpecificSourceAtom.
void EmitCfiCheckFail()
Emit a cross-DSO CFI failure handling function.
RValue EmitReferenceBindingToExpr(const Expr *E)
Emits a reference binding to the passed in expression.
llvm::Value * EmitARCRetainAutorelease(QualType type, llvm::Value *value)
Do a fused retain/autorelease of the given object.
llvm::Value * EmitARCStoreStrong(LValue lvalue, llvm::Value *value, bool resultIgnored)
Store into a strong object.
llvm::Value * EmitARCRetainAutoreleasedReturnValue(llvm::Value *value)
Retain the given object which is the result of a function call.
bool isPointerKnownNonNull(const Expr *E)
void StartObjCMethod(const ObjCMethodDecl *MD, const ObjCContainerDecl *CD)
StartObjCMethod - Begin emission of an ObjCMethod.
LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)
AutoVarEmission EmitAutoVarAlloca(const VarDecl &var)
EmitAutoVarAlloca - Emit the alloca and debug information for a local variable.
LValue EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E)
llvm::Value * EmitARCUnsafeClaimAutoreleasedReturnValue(llvm::Value *value)
Claim a possibly-autoreleased return value at +0.
llvm::Value * EmitObjCMRRAutoreleasePoolPush()
Produce the code to do an MRR version objc_autoreleasepool_push.
void EmitVarAnnotations(const VarDecl *D, llvm::Value *V)
Emit local annotations for the local variable V, declared by D.
llvm::BasicBlock * EHResumeBlock
EHResumeBlock - Unified block containing a call to llvm.eh.resume.
void EmitOpenACCShutdownConstruct(const OpenACCShutdownConstruct &S)
LValue EmitLValueForIvar(QualType ObjectTy, llvm::Value *Base, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers)
void EmitAtomicUpdate(LValue LVal, llvm::AtomicOrdering AO, const llvm::function_ref< RValue(RValue)> &UpdateOp, bool IsVolatile)
bool InNoConvergentAttributedStmt
True if the current statement has noconvergent attribute.
static bool IsConstructorDelegationValid(const CXXConstructorDecl *Ctor)
Checks whether the given constructor is a valid subject for the complete-to-base constructor delegati...
void GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, ObjCMethodDecl *MD, bool ctor)
void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, Address Addr, QualType Type, CharUnits Alignment=CharUnits::Zero(), SanitizerSet SkippedChecks=SanitizerSet(), llvm::Value *ArraySize=nullptr)
Address GetAddressOfDerivedClass(Address Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue)
llvm::Value * EmitObjCAllocWithZone(llvm::Value *value, llvm::Type *returnType)
Allocate the given objc object.
void EmitIgnoredConditionalOperator(const AbstractConditionalOperator *E)
void GetAArch64SVEProcessedOperands(unsigned BuiltinID, const CallExpr *E, SmallVectorImpl< llvm::Value * > &Ops, SVETypeFlags TypeFlags)
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....
llvm::Value * EmitSVEGatherLoad(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
llvm::Function * GenerateBlockFunction(GlobalDecl GD, const CGBlockInfo &Info, const DeclMapTy &ldm, bool IsLambdaConversionToBlock, bool BuildGlobalBlock)
void EmitCountedByBoundsChecking(const Expr *ArrayExpr, QualType ArrayType, Address ArrayInst, QualType IndexType, llvm::Value *IndexVal, bool Accessed, bool FlexibleArray)
EmitCountedByBoundsChecking - If the array being accessed has a "counted_by" attribute,...
Address EmitFieldAnnotations(const FieldDecl *D, Address V)
Emit field annotations for the given field & value.
llvm::Function * LookupNeonLLVMIntrinsic(unsigned IntrinsicID, unsigned Modifier, llvm::Type *ArgTy, const CallExpr *E)
void pushDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)
pushDestroy - Push the standard destructor for the given type as at least a normal cleanup.
void EmitScalarInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
void EmitNullabilityCheck(LValue LHS, llvm::Value *RHS, SourceLocation Loc)
Given an assignment *LHS = RHS, emit a test that checks if RHS is nonnull, if LHS is marked _Nonnull.
void EmitConstructorBody(FunctionArgList &Args)
EmitConstructorBody - Emits the body of the current constructor.
const CodeGen::CGBlockInfo * BlockInfo
void EmitKCFIOperandBundle(const CGCallee &Callee, SmallVectorImpl< llvm::OperandBundleDef > &Bundles)
llvm::Value * EmitPointerAuthUnqualify(PointerAuthQualifier Qualifier, llvm::Value *Pointer, QualType PointerType, Address StorageAddress, bool IsKnownNonNull)
void EmitAggregateCopyCtor(LValue Dest, LValue Src, AggValueSlot::Overlap_t MayOverlap)
void EmitDeclRefExprDbgValue(const DeclRefExpr *E, const APValue &Init)
Address makeNaturalAddressForPointer(llvm::Value *Ptr, QualType T, CharUnits Alignment=CharUnits::Zero(), bool ForPointeeType=false, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)
Construct an address with the natural alignment of T.
void EmitOpenACCWaitConstruct(const OpenACCWaitConstruct &S)
static Destroyer destroyCXXObject
llvm::AllocaInst * EHSelectorSlot
The selector slot.
Address EmitLoadOfPointer(Address Ptr, const PointerType *PtrTy, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)
Load a pointer with type PtrTy stored at address Ptr.
LValue MakeNaturalAlignPointeeRawAddrLValue(llvm::Value *V, QualType T)
Same as MakeNaturalAlignPointeeAddrLValue except that the pointer is known to be unsigned.
llvm::BasicBlock * EmitLandingPad()
Emits a landing pad for the current EH stack.
void EmitLambdaInAllocaImplFn(const CXXMethodDecl *CallOp, const CGFunctionInfo **ImplFnInfo, llvm::Function **ImplFn)
llvm::Constant * GenerateCopyHelperFunction(const CGBlockInfo &blockInfo)
Generate the copy-helper function for a block closure object: static void block_copy_helper(block_t *...
void EmitCXXAggrConstructorCall(const CXXConstructorDecl *D, const ArrayType *ArrayTy, Address ArrayPtr, const CXXConstructExpr *E, bool NewPointerIsChecked, bool ZeroInitialization=false)
EmitCXXAggrConstructorCall - Emit a loop to call a particular constructor for each of several members...
std::pair< RValue, llvm::Value * > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, llvm::AtomicOrdering Success=llvm::AtomicOrdering::SequentiallyConsistent, llvm::AtomicOrdering Failure=llvm::AtomicOrdering::SequentiallyConsistent, bool IsWeak=false, AggValueSlot Slot=AggValueSlot::ignored())
Emit a compare-and-exchange op for atomic type.
CurrentSourceLocExprScope::SourceLocExprScopeGuard SourceLocExprScopeGuard
void EmitBlockAfterUses(llvm::BasicBlock *BB)
EmitBlockAfterUses - Emit the given block somewhere hopefully near its uses, and leave the insertion ...
RValue EmitLoadOfGlobalRegLValue(LValue LV)
Load of global named registers are always calls to intrinsics.
VPtrsVector getVTablePointers(const CXXRecordDecl *VTableClass)
void EmitSehCppScopeEnd()
void EmitVTablePtrCheckForCast(QualType T, Address Derived, bool MayBeNull, CFITypeCheckKind TCK, SourceLocation Loc)
Derived is the presumed address of an object of type T after a cast.
TypeCheckKind
Situations in which we might emit a check for the suitability of a pointer or glvalue.
@ TCK_DowncastPointer
Checking the operand of a static_cast to a derived pointer type.
@ TCK_DowncastReference
Checking the operand of a static_cast to a derived reference type.
@ TCK_MemberAccess
Checking the object expression in a non-static data member access.
@ TCK_ConstructorCall
Checking the 'this' pointer for a constructor call.
@ TCK_Store
Checking the destination of a store. Must be suitably sized and aligned.
@ TCK_NonnullAssign
Checking the value assigned to a _Nonnull pointer. Must not be null.
@ TCK_UpcastToVirtualBase
Checking the operand of a cast to a virtual base object.
@ TCK_MemberCall
Checking the 'this' pointer for a call to a non-static member function.
@ TCK_DynamicOperation
Checking the operand of a dynamic_cast or a typeid expression.
@ TCK_ReferenceBinding
Checking the bound value in a reference binding.
@ TCK_Load
Checking the operand of a load. Must be suitably sized and aligned.
@ TCK_Upcast
Checking the operand of a cast to a base object.
llvm::Type * getEltType(const SVETypeFlags &TypeFlags)
void SimplifyForwardingBlocks(llvm::BasicBlock *BB)
SimplifyForwardingBlocks - If the given basic block is only a branch to another basic block,...
static std::string getNonTrivialDestructorStr(QualType QT, CharUnits Alignment, bool IsVolatile, ASTContext &Ctx)
llvm::Value * EmitCXXNewExpr(const CXXNewExpr *E)
llvm::Value * EmitObjCThrowOperand(const Expr *expr)
void EmitOMPSplitDirective(const OMPSplitDirective &S)
void EmitCXXDestructorCall(const CXXDestructorDecl *D, CXXDtorType Type, bool ForVirtualBase, bool Delegating, Address This, QualType ThisTy)
LValue MakeAddrLValue(Address Addr, QualType T, LValueBaseInfo BaseInfo, TBAAAccessInfo TBAAInfo)
const BlockByrefInfo & getBlockByrefInfo(const VarDecl *var)
BuildByrefInfo - This routine changes a __block variable declared as T x into:
void EmitBranchThroughCleanup(JumpDest Dest)
EmitBranchThroughCleanup - Emit a branch from the current insert block through the normal cleanup han...
void EmitOMPReductionClauseFinal(const OMPExecutableDirective &D, const OpenMPDirectiveKind ReductionKind)
Emit final update of reduction values to original variables at the end of the directive.
llvm::Value * EmitCommonNeonBuiltinExpr(unsigned BuiltinID, unsigned LLVMIntrinsic, unsigned AltLLVMIntrinsic, const char *NameHint, unsigned Modifier, const CallExpr *E, SmallVectorImpl< llvm::Value * > &Ops, Address PtrOp0, Address PtrOp1, llvm::Triple::ArchType Arch)
llvm::Value * EmitRISCVBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)
LValue EmitBinaryOperatorLValue(const BinaryOperator *E)
bool InNoMergeAttributedStmt
True if the current statement has nomerge attribute.
void StartObjCDirectPreconditionThunk(const ObjCMethodDecl *OMD, llvm::Function *Fn, const CGFunctionInfo &FI)
Start an Objective-C direct method thunk.
llvm::Value * EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx, const llvm::ElementCount &Count)
LValue EmitComplexCompoundAssignmentLValue(const CompoundAssignOperator *E)
void pushIrregularPartialArrayCleanup(llvm::Value *arrayBegin, Address arrayEndPointer, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)
pushIrregularPartialArrayCleanup - Push a NormalAndEHCleanup to destroy already-constructed elements ...
llvm::Value * EmitCheckedArgForBuiltin(const Expr *E, BuiltinCheckKind Kind)
Emits an argument for a call to a builtin.
void EmitOMPLoopBody(const OMPLoopDirective &D, JumpDest LoopExit)
Helper for the OpenMP loop directives.
Address EmitCheckedInBoundsGEP(Address Addr, ArrayRef< llvm::Value * > IdxList, llvm::Type *elementType, bool SignedIndices, bool IsSubtraction, SourceLocation Loc, CharUnits Align, const Twine &Name="")
void EmitOMPScopeDirective(const OMPScopeDirective &S)
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
LValue MakeAddrLValueWithoutTBAA(Address Addr, QualType T, AlignmentSource Source=AlignmentSource::Type)
bool hasSkipCounter(const Stmt *S) const
llvm::BasicBlock * getUnreachableBlock()
Destroyer * getDestroyer(QualType::DestructionKind destructionKind)
llvm::AssertingVH< llvm::Instruction > AllocaInsertPt
AllocaInsertPoint - This is an instruction in the entry block before which we prefer to insert alloca...
void EmitAggregateAssign(LValue Dest, LValue Src, QualType EltTy)
Emit an aggregate assignment.
void EmitARCRelease(llvm::Value *value, ARCPreciseLifetime_t precise)
Release the given object.
void maybeAttachRangeForLoad(llvm::LoadInst *Load, QualType Ty, SourceLocation Loc)
void EmitCXXGlobalVarDeclInit(const VarDecl &D, llvm::GlobalVariable *GV, bool PerformInit)
EmitCXXGlobalVarDeclInit - Create the initializer for a C++ variable with global storage.
void EmitBitfieldConversionCheck(llvm::Value *Src, QualType SrcType, llvm::Value *Dst, QualType DstType, const CGBitFieldInfo &Info, SourceLocation Loc)
Emit a check that an [implicit] conversion of a bitfield.
bool currentFunctionUsesSEHTry() const
void PushDestructorCleanup(QualType T, Address Addr)
PushDestructorCleanup - Push a cleanup to call the complete-object destructor of an object of the giv...
llvm::SmallVector< const JumpDest *, 2 > SEHTryEpilogueStack
CodeGenFunction * ParentCGF
void pushCallObjectDeleteCleanup(const FunctionDecl *OperatorDelete, llvm::Value *CompletePtr, QualType ElementType)
void EmitFunctionBody(const Stmt *Body)
JumpDest ReturnBlock
ReturnBlock - Unified return block.
void EmitOMPTargetTeamsDistributeSimdDirective(const OMPTargetTeamsDistributeSimdDirective &S)
RValue EmitCXXMemberOrOperatorCall(const CXXMethodDecl *Method, const CGCallee &Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E, CallArgList *RtlArgs, llvm::CallBase **CallOrInvoke)
DominatingValue< T >::saved_type saveValueInCond(T value)
void EmitSEHExceptionCodeSave(CodeGenFunction &ParentCGF, llvm::Value *ParentFP, llvm::Value *EntryEBP)
const llvm::function_ref< void(CodeGenFunction &, llvm::Function *, const OMPTaskDataTy &)> TaskGenTy
std::pair< LValue, llvm::Value * > EmitARCStoreUnsafeUnretained(const BinaryOperator *e, bool ignored)
llvm::DebugLoc SourceLocToDebugLoc(SourceLocation Location)
Converts Location to a DebugLoc, if debug information is enabled.
static bool cxxDestructorCanThrow(QualType T)
Check if T is a C++ class that has a destructor that can throw.
llvm::Value * ExceptionSlot
The exception slot.
LValue EmitPseudoObjectLValue(const PseudoObjectExpr *e)
ComplexPairTy EmitPromotedComplexExpr(const Expr *E, QualType PromotionType)
llvm::Constant * EmitCheckTypeDescriptor(QualType T)
Emit a description of a type in a format suitable for passing to a runtime sanitizer handler.
void CreateCoercedStore(llvm::Value *Src, QualType SrcFETy, Address Dst, llvm::TypeSize DstSize, bool DstIsVolatile)
Create a store to.
void EmitCallAndReturnForThunk(llvm::FunctionCallee Callee, const ThunkInfo *Thunk, bool IsUnprototyped)
bool EmitOMPCopyinClause(const OMPExecutableDirective &D)
Emit code for copyin clause in D directive.
llvm::Value * EmitSVEDupX(llvm::Value *Scalar)
LValue EmitOpaqueValueLValue(const OpaqueValueExpr *e)
void EmitOMPLinearClause(const OMPLoopDirective &D, CodeGenFunction::OMPPrivateScope &PrivateScope)
Emit initial code for linear clauses.
llvm::Value * LoadPassedObjectSize(const Expr *E, QualType EltTy)
If E references a parameter with pass_object_size info or a constant array size modifier,...
void EmitAnyExprToExn(const Expr *E, Address Addr)
@ ForceLeftToRight
! Language semantics require left-to-right evaluation.
@ Default
! No language constraints on evaluation order.
@ ForceRightToLeft
! Language semantics require right-to-left evaluation.
LValue EmitScalarCompoundAssignWithComplex(const CompoundAssignOperator *E, llvm::Value *&Result)
llvm::BasicBlock * OMPBeforeScanBlock
void EmitOMPInterchangeDirective(const OMPInterchangeDirective &S)
void EmitOMPPrivateLoopCounters(const OMPLoopDirective &S, OMPPrivateScope &LoopScope)
Emit initial code for loop counters of loop-based directives.
llvm::ConvergenceControlInst * emitConvergenceLoopToken(llvm::BasicBlock *BB)
llvm::SmallPtrSet< const CXXRecordDecl *, 4 > VisitedVirtualBasesSetTy
void GenerateObjCGetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
GenerateObjCGetter - Synthesize an Objective-C property getter function.
llvm::Value * EmitIvarOffsetAsPointerDiff(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)
void initFullExprCleanupWithFlag(RawAddress ActiveFlag)
RValue EmitCUDAKernelCallExpr(const CUDAKernelCallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)
void pushCleanupAndDeferDeactivation(CleanupKind Kind, As... A)
llvm::DebugLoc EmitReturnBlock()
Emit the unified return block, trying to avoid its emission when possible.
void EmitNonNullArgCheck(RValue RV, QualType ArgType, SourceLocation ArgLoc, AbstractCallee AC, unsigned ParmNum)
Create a check for a function parameter that may potentially be declared as non-null.
RValue EmitLoadOfAnyValue(LValue V, AggValueSlot Slot=AggValueSlot::ignored(), SourceLocation Loc={})
Like EmitLoadOfLValue but also handles complex and aggregate types.
llvm::BasicBlock * getEHResumeBlock(bool isCleanup)
void EmitAggregateCopy(LValue Dest, LValue Src, QualType EltTy, AggValueSlot::Overlap_t MayOverlap, bool isVolatile=false)
EmitAggregateCopy - Emit an aggregate copy.
llvm::DenseMap< const Decl *, Address > DeclMapTy
LValue EmitLValueForField(LValue Base, const FieldDecl *Field, bool IsInBounds=true)
RawAddress CreateDefaultAlignTempAlloca(llvm::Type *Ty, const Twine &Name="tmp")
CreateDefaultAlignedTempAlloca - This creates an alloca with the default ABI alignment of the given L...
const TargetInfo & getTarget() const
RValue emitRotate(const CallExpr *E, bool IsRotateRight)
void initFullExprCleanup()
Set up the last cleanup that was pushed as a conditional full-expression cleanup.
void defaultInitNonTrivialCStructVar(LValue Dst)
llvm::Value * EmitAArch64SVEBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::Function * getSpecConstantFunction(const clang::QualType &SpecConstantType)
LValue EmitCompoundAssignmentLValue(const CompoundAssignOperator *E)
llvm::Value * EmitAnnotationCall(llvm::Function *AnnotationFn, llvm::Value *AnnotatedVal, StringRef AnnotationStr, SourceLocation Location, const AnnotateAttr *Attr)
Emit an annotation call (intrinsic).
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
bool isInConditionalBranch() const
isInConditionalBranch - Return true if we're currently emitting one branch or the other of a conditio...
llvm::Value * EmitFP8NeonCvtCall(unsigned IID, llvm::Type *Ty0, llvm::Type *Ty1, bool Extract, SmallVectorImpl< llvm::Value * > &Ops, const CallExpr *E, const char *name)
Address EmitCompoundStmtWithoutScope(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
void pushKmpcAllocFree(CleanupKind Kind, std::pair< llvm::Value *, llvm::Value * > AddrSizePair)
void GenerateOpenMPCapturedVars(const CapturedStmt &S, SmallVectorImpl< llvm::Value * > &CapturedVars)
llvm::Value * EmitBlockCopyAndAutorelease(llvm::Value *Block, QualType Ty)
Address EmitCXXMemberDataPointerAddress(const Expr *E, Address base, llvm::Value *memberPtr, const MemberPointerType *memberPtrType, bool IsInBounds, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)
Emit the address of a field using a member data pointer.
void EmitGotoStmt(const GotoStmt &S)
llvm::BasicBlock * getTerminateHandler()
getTerminateHandler - Return a handler (not a landing pad, just a catch handler) that just calls term...
void PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize, std::initializer_list< llvm::Value ** > ValuesToReload={})
Takes the old cleanup stack size and emits the cleanup blocks that have been added.
void EmitOMPDepobjDirective(const OMPDepobjDirective &S)
void maybeCreateMCDCCondBitmap()
Allocate a temp value on the stack that MCDC can use to track condition results.
void EmitOMPMetaDirective(const OMPMetaDirective &S)
llvm::Value * EmitARMBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue, llvm::Triple::ArchType Arch)
LValue EmitHLSLOutArgExpr(const HLSLOutArgExpr *E, CallArgList &Args, QualType Ty)
static bool isVptrCheckRequired(TypeCheckKind TCK, QualType Ty)
Determine whether the pointer type check TCK requires a vptr check.
CGCallee EmitCallee(const Expr *E)
void EmitWritebacks(const CallArgList &Args)
EmitWriteback - Emit callbacks for function.
void EmitOMPCriticalDirective(const OMPCriticalDirective &S)
void EmitIgnoredExpr(const Expr *E)
EmitIgnoredExpr - Emit an expression in a context which ignores the result.
void EnterSEHTryStmt(const SEHTryStmt &S)
llvm::Value * EmitRISCVCpuIs(const CallExpr *E)
RValue EmitCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue=ReturnValueSlot(), llvm::CallBase **CallOrInvoke=nullptr)
llvm::ScalableVectorType * getSVEType(const SVETypeFlags &TypeFlags)
void callCStructDefaultConstructor(LValue Dst)
void EmitOMPTaskLoopDirective(const OMPTaskLoopDirective &S)
RValue EmitLoadOfLValue(LValue V, SourceLocation Loc)
EmitLoadOfLValue - Given an expression that represents a value lvalue, this method emits the address ...
void EmitOMPCancelDirective(const OMPCancelDirective &S)
void pushDestroyAndDeferDeactivation(QualType::DestructionKind dtorKind, Address addr, QualType type)
LValue EmitMatrixSingleSubscriptExpr(const MatrixSingleSubscriptExpr *E)
LValue EmitArraySectionExpr(const ArraySectionExpr *E, bool IsLowerBound=true)
const Expr * RetExpr
If a return statement is being visited, this holds the return statment's result expression.
Address GetAddrOfBlockDecl(const VarDecl *var)
void EmitOMPBarrierDirective(const OMPBarrierDirective &S)
llvm::Value * EmitComplexToScalarConversion(ComplexPairTy Src, QualType SrcTy, QualType DstTy, SourceLocation Loc)
Emit a conversion from the specified complex type to the specified destination type,...
static bool isInstrumentedCondition(const Expr *C)
isInstrumentedCondition - Determine whether the given condition is an instrumentable condition (i....
void EmitARCDestroyStrong(Address addr, ARCPreciseLifetime_t precise)
Destroy a __strong variable.
void pushCleanupAfterFullExpr(CleanupKind Kind, As... A)
Queue a cleanup to be pushed after finishing the current full-expression, potentially with an active ...
void DeactivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
DeactivateCleanupBlock - Deactivates the given cleanup block.
void EmitCfiCheckStub()
Emit a stub for the cross-DSO CFI check function.
void callCStructCopyAssignmentOperator(LValue Dst, LValue Src)
VlaSizePair getVLAElements1D(const VariableArrayType *vla)
Return the number of elements for a single dimension for the given array type.
llvm::Value * EmitBPFBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
RawAddress CreateIRTempWithoutCast(QualType T, const Twine &Name="tmp")
CreateIRTempWithoutCast - Create a temporary IR object of the given type, with appropriate alignment.
bool EmitOMPWorksharingLoop(const OMPLoopDirective &S, Expr *EUB, const CodeGenLoopBoundsTy &CodeGenLoopBounds, const CodeGenDispatchBoundsTy &CGDispatchBounds)
Emit code for the worksharing loop-based directive.
void EmitForStmt(const ForStmt &S, ArrayRef< const Attr * > Attrs={})
CGCallee BuildAppleKextVirtualDestructorCall(const CXXDestructorDecl *DD, CXXDtorType Type, const CXXRecordDecl *RD)
BuildVirtualCall - This routine makes indirect vtable call for call to virtual destructors.
void pushFullExprCleanup(CleanupKind kind, As... A)
pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression.
bool AlwaysEmitXRayCustomEvents() const
AlwaysEmitXRayCustomEvents - Return true if we must unconditionally emit XRay custom event handling c...
void EnterDtorCleanups(const CXXDestructorDecl *Dtor, CXXDtorType Type)
EnterDtorCleanups - Enter the cleanups necessary to complete the given phase of destruction for a des...
llvm::Value * EmitSMELdrStr(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
LValue EmitOMPSharedLValue(const Expr *E)
Emits the lvalue for the expression with possibly captured variable.
QualType TypeOfSelfObject()
TypeOfSelfObject - Return type of object that this self represents.
static Destroyer destroyARCStrongImprecise
llvm::CanonicalLoopInfo * EmitOMPCollapsedCanonicalLoopNest(const Stmt *S, int Depth)
Emit the Stmt S and return its topmost canonical loop, if any.
void EmitOMPSectionsDirective(const OMPSectionsDirective &S)
void EmitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt &S)
llvm::BasicBlock * getInvokeDest()
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.
LValue EmitAggExprToLValue(const Expr *E)
EmitAggExprToLValue - Emit the computation of the specified expression of aggregate type into a tempo...
void EmitCXXExpansionStmtInstantiation(const CXXExpansionStmtInstantiation &S)
void EmitOMPInteropDirective(const OMPInteropDirective &S)
void SetFPAccuracy(llvm::Value *Val, float Accuracy)
SetFPAccuracy - Set the minimum required accuracy of the given floating point operation,...
Address mergeAddressesInConditionalExpr(Address LHS, Address RHS, llvm::BasicBlock *LHSBlock, llvm::BasicBlock *RHSBlock, llvm::BasicBlock *MergeBlock, QualType MergedType)
Address emitAddrOfImagComponent(Address complex, QualType complexType)
llvm::Value * EmitPointerAuthSign(const CGPointerAuthInfo &Info, llvm::Value *Pointer)
llvm::Value * EmitSVETupleCreate(const SVETypeFlags &TypeFlags, llvm::Type *ReturnType, ArrayRef< llvm::Value * > Ops)
void EmitOMPParallelSectionsDirective(const OMPParallelSectionsDirective &S)
void EmitCXXConstructorCall(const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, AggValueSlot ThisAVS, const CXXConstructExpr *E)
llvm::Value * EmitSVEPMull(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID)
llvm::Value * EmitObjCBoxedExpr(const ObjCBoxedExpr *E)
EmitObjCBoxedExpr - This routine generates code to call the appropriate expression boxing method.
void EmitOMPTargetParallelDirective(const OMPTargetParallelDirective &S)
void EmitBoundsCheck(const Expr *ArrayExpr, const Expr *ArrayExprBase, llvm::Value *Index, QualType IndexType, bool Accessed)
Emit a check that Base points into an array object, which we can access at index Index.
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.
void markAsIgnoreThreadCheckingAtRuntime(llvm::Function *Fn)
Annotate the function with an attribute that disables TSan checking at runtime.
llvm::Value * EvaluateExprAsBool(const Expr *E)
EvaluateExprAsBool - Perform the usual unary conversions on the specified expression and compare the ...
void EmitCallArg(CallArgList &args, const Expr *E, QualType ArgType)
EmitCallArg - Emit a single call argument.
void maybeResetMCDCCondBitmap(const Expr *E)
Zero-init the MCDC temp value.
RValue EmitCoyieldExpr(const CoyieldExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
void EmitWhileStmt(const WhileStmt &S, ArrayRef< const Attr * > Attrs={})
JumpDest getOMPCancelDestination(OpenMPDirectiveKind Kind)
void generateObjCSetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, llvm::Constant *AtomicHelperFn)
void GenerateCXXGlobalInitFunc(llvm::Function *Fn, ArrayRef< llvm::Function * > CXXThreadLocals, ConstantAddress Guard=ConstantAddress::invalid())
GenerateCXXGlobalInitFunc - Generates code for initializing global variables.
llvm::Value * EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
LValue EmitPredefinedLValue(const PredefinedExpr *E)
void EmitPointerAuthOperandBundle(const CGPointerAuthInfo &Info, SmallVectorImpl< llvm::OperandBundleDef > &Bundles)
void EmitOMPTargetParallelForSimdDirective(const OMPTargetParallelForSimdDirective &S)
void EmitOMPTargetParallelGenericLoopDirective(const OMPTargetParallelGenericLoopDirective &S)
Emit combined directive 'target parallel loop' as if its constituent constructs are 'target',...
void EmitOpenACCCombinedConstruct(const OpenACCCombinedConstruct &S)
void EmitOMPUseDeviceAddrClause(const OMPUseDeviceAddrClause &C, OMPPrivateScope &PrivateScope, const llvm::DenseMap< const ValueDecl *, llvm::Value * > CaptureDeviceAddrMap)
void EmitCheck(ArrayRef< std::pair< llvm::Value *, SanitizerKind::SanitizerOrdinal > > Checked, SanitizerHandler Check, ArrayRef< llvm::Constant * > StaticArgs, ArrayRef< llvm::Value * > DynamicArgs, const TrapReason *TR=nullptr)
Create a basic block that will either trap or call a handler function in the UBSan runtime with the p...
llvm::Value * BlockPointer
void GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn, const VarDecl *D, llvm::GlobalVariable *Addr, bool PerformInit)
Emit the code necessary to initialize the given global variable.
llvm::Value * EmitSVEDupX(llvm::Value *Scalar, llvm::Type *Ty)
void EmitExtendGCLifetime(llvm::Value *object)
EmitExtendGCLifetime - Given a pointer to an Objective-C object, make sure it survives garbage collec...
void ResolveBranchFixups(llvm::BasicBlock *Target)
LValue EmitDeclRefLValue(const DeclRefExpr *E)
void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock::iterator InsertPt) const
CGBuilder insert helper.
void EmitOMPTeamsDistributeParallelForSimdDirective(const OMPTeamsDistributeParallelForSimdDirective &S)
LValue EmitStringLiteralLValue(const StringLiteral *E)
llvm::Value * EmitARMMVEBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue, llvm::Triple::ArchType Arch)
void EmitOMPMaskedDirective(const OMPMaskedDirective &S)
Address getAsNaturalAddressOf(Address Addr, QualType PointeeTy)
AggValueSlot CreateAggTemp(QualType T, const Twine &Name="tmp", RawAddress *Alloca=nullptr)
CreateAggTemp - Create a temporary memory object for the given aggregate type.
llvm::CallInst * EmitIntrinsicCall(llvm::Intrinsic::ID ID, const Twine &Name="")
bool checkIfLoopMustProgress(const Expr *, bool HasEmptyBody)
Returns true if a loop must make progress, which means the mustprogress attribute can be added.
RValue getOrCreateOpaqueRValueMapping(const OpaqueValueExpr *e)
Given an opaque value expression, return its RValue mapping if it exists, otherwise create one.
RValue EmitCall(const CGFunctionInfo &CallInfo, const CGCallee &Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, llvm::CallBase **CallOrInvoke=nullptr, bool IsMustTail=false)
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...
void callCStructCopyConstructor(LValue Dst, LValue Src)
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...
Address getExceptionSlot()
Returns a pointer to the function's exception object and selector slot, which is assigned in every la...
void EmitCXXGuardedInitBranch(llvm::Value *NeedsInit, llvm::BasicBlock *InitBlock, llvm::BasicBlock *NoInitBlock, GuardKind Kind, const VarDecl *D)
Emit a branch to select whether or not to perform guarded initialization.
bool isMCDCCoverageEnabled() const
bool HaveInsertPoint() const
HaveInsertPoint - True if an insertion point is defined.
void EmitOMPTeamsDistributeSimdDirective(const OMPTeamsDistributeSimdDirective &S)
llvm::Function * GenerateVarArgsThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk)
RValue EmitAtomicLoad(LValue LV, SourceLocation SL, AggValueSlot Slot=AggValueSlot::ignored())
bool AlwaysEmitXRayTypedEvents() const
AlwaysEmitXRayTypedEvents - Return true if clang must unconditionally emit XRay typed event handling ...
void EmitOMPOrderedBlockAssocDirective(const OMPOrderedBlockAssocDirective &S)
void EmitVTableAssumptionLoads(const CXXRecordDecl *ClassDecl, Address This)
Emit assumption load for all bases.
llvm::Value * EmitARCRetainBlock(llvm::Value *value, bool mandatory)
Retain the given block, with _Block_copy semantics.
llvm::Value * EmitObjCCollectionLiteral(const Expr *E, const ObjCMethodDecl *MethodWithObjects)
llvm::BasicBlock * getTerminateFunclet()
getTerminateLandingPad - Return a cleanup funclet that just calls terminate.
void EmitInvariantStart(llvm::Constant *Addr, CharUnits Size)
llvm::Value * EmitNeonRShiftImm(llvm::Value *Vec, llvm::Value *Amt, llvm::Type *Ty, bool usgn, const char *name)
llvm::BasicBlock * getTerminateLandingPad()
getTerminateLandingPad - Return a landing pad that just calls terminate.
CGDebugInfo * getDebugInfo()
void EmitOMPDistributeLoop(const OMPLoopDirective &S, const CodeGenLoopTy &CodeGenLoop, Expr *IncExpr)
Emit code for the distribute loop-based directive.
llvm::Function * GenerateSEHFinallyFunction(CodeGenFunction &ParentCGF, const SEHFinallyStmt &Finally)
llvm::Value * emitScalarConstant(const ConstantEmission &Constant, Expr *E)
void AddAMDGPUFenceAddressSpaceMMRA(llvm::Instruction *Inst, const CallExpr *E)
void EmitOMPMasterTaskLoopDirective(const OMPMasterTaskLoopDirective &S)
llvm::Value * EmitARCRetainScalarExpr(const Expr *expr)
EmitARCRetainScalarExpr - Semantically equivalent to EmitARCRetainObject(e->getType(),...
void EmitOMPReverseDirective(const OMPReverseDirective &S)
llvm::Value * getTypeSize(QualType Ty)
Returns calculated size of the specified type.
bool EmitLifetimeStart(llvm::Value *Addr)
Emit a lifetime.begin marker if some criteria are satisfied.
void EmitStartEHSpec(const Decl *D)
EmitStartEHSpec - Emit the start of the exception spec.
void popCatchScope()
popCatchScope - Pops the catch scope at the top of the EHScope stack, emitting any required code (oth...
LValue EmitUnsupportedLValue(const Expr *E, const char *Name)
EmitUnsupportedLValue - Emit a dummy l-value using the type of E and issue an ErrorUnsupported style ...
void EmitOMPCancellationPointDirective(const OMPCancellationPointDirective &S)
void EmitDestructorBody(FunctionArgList &Args)
EmitDestructorBody - Emits the body of the current destructor.
void EmitOpenACCDataConstruct(const OpenACCDataConstruct &S)
LValue MakeRawAddrLValue(llvm::Value *V, QualType T, CharUnits Alignment, AlignmentSource Source=AlignmentSource::Type)
Same as MakeAddrLValue above except that the pointer is known to be unsigned.
llvm::MDNode * buildAllocToken(QualType AllocType)
Build metadata used by the AllocToken instrumentation.
RValue EmitCXXMemberCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke=nullptr)
void EmitX86MultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)
LValue EmitLValueForFieldInitialization(LValue Base, const FieldDecl *Field)
EmitLValueForFieldInitialization - Like EmitLValueForField, except that if the Field is a reference,...
llvm::Value * EmitSEHExceptionCode()
llvm::Value * EmitBlockLiteral(const BlockExpr *)
Emit block literal.
void EmitOMPTargetTeamsDistributeParallelForDirective(const OMPTargetTeamsDistributeParallelForDirective &S)
llvm::Value * EmitToMemory(llvm::Value *Value, QualType Ty)
EmitToMemory - Change a scalar value from its value representation to its in-memory representation.
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 EmitOMPMaskedTaskLoopDirective(const OMPMaskedTaskLoopDirective &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...
llvm::BasicBlock * OMPScanDispatch
llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr)
CreateTempAlloca - This creates an alloca and inserts it into the entry block if ArraySize is nullptr...
void EmitObjCAtTryStmt(const ObjCAtTryStmt &S)
SmallVector< llvm::Type *, 2 > getSVEOverloadTypes(const SVETypeFlags &TypeFlags, llvm::Type *ReturnType, ArrayRef< llvm::Value * > Ops)
bool ShouldInstrumentFunction()
ShouldInstrumentFunction - Return true if the current function should be instrumented with __cyg_prof...
void startOutlinedSEHHelper(CodeGenFunction &ParentCGF, bool IsFilter, const Stmt *OutlinedStmt)
Arrange a function prototype that can be called by Windows exception handling personalities.
void maybeUpdateMCDCCondBitmap(const Expr *E, llvm::Value *Val)
Update the MCDC temp value with the condition's evaluated result.
LValue getOrCreateOpaqueLValueMapping(const OpaqueValueExpr *e)
Given an opaque value expression, return its LValue mapping if it exists, otherwise create one.
void EmitSehTryScopeBegin()
llvm::function_ref< std::pair< LValue, LValue >(CodeGenFunction &, const OMPExecutableDirective &S)> CodeGenLoopBoundsTy
llvm::Function * generateAwaitSuspendWrapper(Twine const &CoroName, Twine const &SuspendPointName, CoroutineSuspendExpr const &S)
bool EmitScalarRangeCheck(llvm::Value *Value, QualType Ty, SourceLocation Loc)
Check if the scalar Value is within the valid range for the given type Ty.
ComplexPairTy EmitComplexExpr(const Expr *E, bool IgnoreReal=false, bool IgnoreImag=false)
EmitComplexExpr - Emit the computation of the specified expression of complex type,...
void emitAlignmentAssumptionCheck(llvm::Value *Ptr, QualType Ty, SourceLocation Loc, SourceLocation AssumptionLoc, llvm::Value *Alignment, llvm::Value *OffsetValue, llvm::Value *TheCheck, llvm::Instruction *Assumption)
RValue EmitCall(const CGFunctionInfo &CallInfo, const CGCallee &Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, llvm::CallBase **CallOrInvoke, bool IsMustTail, SourceLocation Loc, bool IsVirtualFunctionPointerThunk=false)
EmitCall - Generate a call of the given function, expecting the given result type,...
const TargetCodeGenInfo & getTargetHooks() const
void setBeforeOutermostConditional(llvm::Value *value, Address addr, CodeGenFunction &CGF)
void EmitOMPTargetExitDataDirective(const OMPTargetExitDataDirective &S)
void EmitCtorPrologue(const CXXConstructorDecl *CD, CXXCtorType Type, FunctionArgList &Args)
EmitCtorPrologue - This routine generates necessary code to initialize base classes and non-static da...
llvm::ConstantInt * getUBSanFunctionTypeHash(QualType T) const
Return a type hash constant for a function instrumented by -fsanitize=function.
RValue EmitBuiltinAlignTo(const CallExpr *E, bool AlignUp)
Emit IR for __builtin_align_up/__builtin_align_down.
LValue EmitHLSLArrayAssignLValue(const BinaryOperator *E)
void EmitSEHLeaveStmt(const SEHLeaveStmt &S)
void EmitLifetimeEnd(llvm::Value *Addr)
RawAddress CreateMemTempWithoutCast(QualType T, const Twine &Name="tmp")
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignmen without...
void EmitBranchToCounterBlock(const Expr *Cond, BinaryOperator::Opcode LOp, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount=0, Stmt::Likelihood LH=Stmt::LH_None, const Expr *CntrIdx=nullptr)
EmitBranchToCounterBlock - Emit a conditional branch to a new block that increments a profile counter...
void EmitPointerAuthCopy(PointerAuthQualifier Qualifier, QualType Type, Address DestField, Address SrcField)
void EmitOMPTargetEnterDataDirective(const OMPTargetEnterDataDirective &S)
LValue EmitVAArgExprLValue(const VAArgExpr *E)
bool InNoInlineAttributedStmt
True if the current statement has noinline attribute.
SmallVector< llvm::OperandBundleDef, 1 > getBundlesForFunclet(llvm::Value *Callee)
void EmitOMPMaskedTaskLoopSimdDirective(const OMPMaskedTaskLoopSimdDirective &S)
llvm::Value * EmitWebAssemblyBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::Value * EmitNeonShiftVector(llvm::Value *V, llvm::Type *Ty, bool negateForRightShift)
void EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, llvm::Value *VTable, SourceLocation Loc)
If whole-program virtual table optimization is enabled, emit an assumption that VTable is a member of...
void EmitCapturedLocals(CodeGenFunction &ParentCGF, const Stmt *OutlinedStmt, bool IsFilter)
Scan the outlined statement for captures from the parent function.
llvm::Value * EmitObjCAlloc(llvm::Value *value, llvm::Type *returnType)
Allocate the given objc object.
llvm::Value * LoadObjCSelf()
LoadObjCSelf - Load the value of self.
void GenerateObjCMethod(const ObjCMethodDecl *OMD)
Generate an Objective-C method.
void callCStructMoveAssignmentOperator(LValue Dst, LValue Src)
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.
bool IsInPreservedAIRegion
True if CodeGen currently emits code inside presereved access index region.
RValue EmitAnyExprToTemp(const Expr *E)
EmitAnyExprToTemp - Similarly to EmitAnyExpr(), however, the result will always be accessible even if...
llvm::FenceInst * emitAtomicFence(llvm::AtomicOrdering Order, llvm::SyncScope::ID SSID=llvm::SyncScope::System)
Emit a fence instruction, applying relevant target-specific metadata when applicable.
void EmitCoroutineBody(const CoroutineBodyStmt &S)
void pushCleanupAfterFullExprWithActiveFlag(CleanupKind Kind, RawAddress ActiveFlag, As... A)
VlaSizePair getVLASize(const VariableArrayType *vla)
Returns an LLVM value that corresponds to the size, in non-variably-sized elements,...
LValue EmitStmtExprLValue(const StmtExpr *E)
void EmitOMPParallelDirective(const OMPParallelDirective &S)
void EmitOMPTaskDirective(const OMPTaskDirective &S)
llvm::Value * unregisterGlobalDtorWithUnAtExit(llvm::Constant *dtorStub)
Call unatexit() with function dtorStub.
void EmitOMPMasterTaskLoopSimdDirective(const OMPMasterTaskLoopSimdDirective &S)
void pushSEHCleanup(CleanupKind kind, llvm::Function *FinallyFunc)
llvm::Value * EmitARCLoadWeakRetained(Address addr)
i8* @objc_loadWeakRetained(i8** addr)
void EmitOMPDistributeParallelForDirective(const OMPDistributeParallelForDirective &S)
void EmitOMPAssumeDirective(const OMPAssumeDirective &S)
llvm::Value * emitPointerAuthResign(llvm::Value *Pointer, QualType PointerType, const CGPointerAuthInfo &CurAuthInfo, const CGPointerAuthInfo &NewAuthInfo, bool IsKnownNonNull)
int ExpectedOMPLoopDepth
Number of nested loop to be consumed by the last surrounding loop-associated directive.
void EmitOMPPrivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
llvm::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")
void EmitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective &S)
ASTContext & getContext() const
llvm::Value * EmitDirectXBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::Value * EmitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E, llvm::Triple::ArchType Arch)
void EmitStopPoint(const Stmt *S)
EmitStopPoint - Emit a debug stoppoint if we are emitting debug info.
RawAddress CreateTempAllocaWithoutCast(llvm::Type *Ty, CharUnits align, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr)
CreateTempAlloca - This creates a alloca and inserts it into the entry block.
void EmitOMPTargetUpdateDirective(const OMPTargetUpdateDirective &S)
llvm::Value * EmitWithOriginalRHSBitfieldAssignment(const BinaryOperator *E, llvm::Value **Previous, QualType *SrcType)
Retrieve the implicit cast expression of the rhs in a binary operator expression by passing pointers ...
llvm::Value * EmitMSVCBuiltinExpr(MSVCIntrin BuiltinID, const CallExpr *E)
llvm::Value * EmitLoadOfScalar(Address Addr, bool Volatile, QualType Ty, SourceLocation Loc, AlignmentSource Source=AlignmentSource::Type, bool isNontemporal=false)
EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the...
void EmitOMPTargetTeamsGenericLoopDirective(const OMPTargetTeamsGenericLoopDirective &S)
bool isMCDCBranchExpr(const Expr *E) const
llvm::Value * EmitFP8NeonFDOTCall(unsigned IID, bool ExtendLaneArg, llvm::Type *RetTy, SmallVectorImpl< llvm::Value * > &Ops, const CallExpr *E, const char *name)
void EmitMultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)
void EmitIfStmt(const IfStmt &S)
void emitAutoVarTypeCleanup(const AutoVarEmission &emission, QualType::DestructionKind dtorKind)
Enter a destroy cleanup for the given local variable.
void emitARCMoveAssignWeak(QualType Ty, Address DstAddr, Address SrcAddr)
llvm::Value * vectorWrapScalar16(llvm::Value *Op)
void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty)
void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit)
EmitStoreOfComplex - Store a complex number into the specified l-value.
const Decl * CurFuncDecl
CurFuncDecl - Holds the Decl for the current outermost non-closure context.
llvm::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args, const Twine &name="")
void EmitAutoVarCleanups(const AutoVarEmission &emission)
LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E)
llvm::Value * EmitARMCDEBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue, llvm::Triple::ArchType Arch)
void EmitAndRegisterVariableArrayDimensions(CGDebugInfo *DI, const VarDecl &D, bool EmitDebugInfo)
Emits the alloca and debug information for the size expressions for each dimension of an array.
static const Expr * stripCond(const Expr *C)
Ignore parentheses and logical-NOT to track conditions consistently.
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.
void EmitDeferStmt(const DeferStmt &S)
void registerGlobalDtorWithLLVM(const VarDecl &D, llvm::FunctionCallee fn, llvm::Constant *addr)
Registers the dtor using 'llvm.global_dtors' for platforms that do not support an 'atexit()' function...
Address EmitAddressOfPFPField(Address RecordPtr, const PFPField &Field)
void EmitStoreThroughLValue(RValue Src, LValue Dst, bool isInit=false)
EmitStoreThroughLValue - Store the specified rvalue into the specified lvalue, where both are guarant...
SmallVector< llvm::CanonicalLoopInfo *, 4 > OMPLoopNestStack
List of recently emitted OMPCanonicalLoops.
Address EmitArrayToPointerDecay(const Expr *Array, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)
void SetFastMathFlags(FPOptions FPFeatures)
Set the codegen fast-math flags.
void pushLifetimeExtendedDestroy(CleanupKind kind, Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
llvm::Value * EmitAArch64CompareBuiltinExpr(llvm::Value *Op, llvm::Type *Ty, const llvm::CmpInst::Predicate Pred, const llvm::Twine &Name="")
llvm::SmallVector< char, 256 > LifetimeExtendedCleanupStack
llvm::Constant * GenerateObjCAtomicSetterCopyHelperFunction(const ObjCPropertyImplDecl *PID)
GenerateObjCAtomicSetterCopyHelperFunction - Given a c++ object type with non-trivial copy assignment...
llvm::Value * EmitSPIRVBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
void EmitOpenACCAtomicConstruct(const OpenACCAtomicConstruct &S)
void EmitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt &S)
Address EmitCompoundStmt(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
EmitCompoundStmt - Emit a compound statement {..} node.
llvm::Value * LoadCXXVTT()
LoadCXXVTT - Load the VTT parameter to base constructors/destructors have virtual bases.
RValue EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)
void EmitOpenACCCacheConstruct(const OpenACCCacheConstruct &S)
Address EmitVAListRef(const Expr *E)
void EmitOpenACCLoopConstruct(const OpenACCLoopConstruct &S)
void EmitOMPTeamsDistributeParallelForDirective(const OMPTeamsDistributeParallelForDirective &S)
RValue GetUndefRValue(QualType Ty)
GetUndefRValue - Get an appropriate 'undef' rvalue for the given type.
void EmitParmDecl(const VarDecl &D, ParamValue Arg, unsigned ArgNo)
EmitParmDecl - Emit a ParmVarDecl or an ImplicitParamDecl.
llvm::Instruction * getPostAllocaInsertPoint()
Return PostAllocaInsertPt.
RValue EmitBuiltinIsAligned(const CallExpr *E)
Emit IR for __builtin_is_aligned.
void EmitAllocToken(llvm::CallBase *CB, QualType AllocType)
Emit and set additional metadata used by the AllocToken instrumentation.
void EmitARCNoopIntrinsicUse(ArrayRef< llvm::Value * > values)
Emit a call to "clang.arc.noop.use", which consumes the result of a call that has operand bundle "cla...
llvm::AtomicRMWInst * emitAtomicRMWInst(llvm::AtomicRMWInst::BinOp Op, Address Addr, llvm::Value *Val, llvm::AtomicOrdering Order=llvm::AtomicOrdering::SequentiallyConsistent, llvm::SyncScope::ID SSID=llvm::SyncScope::System, const AtomicExpr *AE=nullptr)
Emit an atomicrmw instruction, and applying relevant metadata when applicable.
LValue EmitComplexAssignmentLValue(const BinaryOperator *E)
Emit an l-value for an assignment (simple or compound) of complex type.
LValue EmitCastLValue(const CastExpr *E)
EmitCastLValue - Casts are never lvalues unless that cast is to a reference type.
void EmitOMPFuseDirective(const OMPFuseDirective &S)
llvm::Value * EmitPointerArithmetic(const BinaryOperator *BO, Expr *pointerOperand, llvm::Value *pointer, Expr *indexOperand, llvm::Value *index, bool isSubtraction)
Emit pointer + index arithmetic.
void EmitInitializerForField(FieldDecl *Field, LValue LHS, Expr *Init)
LValue EmitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *E)
LValue EmitLoadOfPointerLValue(Address Ptr, const PointerType *PtrTy)
void EmitAsmStmt(const AsmStmt &S)
void EmitDefaultStmt(const DefaultStmt &S, ArrayRef< const Attr * > Attrs)
void EmitOMPTargetTeamsDistributeDirective(const OMPTargetTeamsDistributeDirective &S)
void EmitLambdaInAllocaCallOpBody(const CXXMethodDecl *MD)
void EmitSwitchStmt(const SwitchStmt &S)
Address ReturnValuePointer
ReturnValuePointer - The temporary alloca to hold a pointer to sret.
void EmitOMPUseDevicePtrClause(const OMPUseDevicePtrClause &C, OMPPrivateScope &PrivateScope, const llvm::DenseMap< const ValueDecl *, llvm::Value * > CaptureDeviceAddrMap)
llvm::Value * SEHInfo
Value returned by __exception_info intrinsic.
static bool mightAddDeclToScope(const Stmt *S)
Determine if the given statement might introduce a declaration into the current scope,...
RawAddress getNormalCleanupDestSlot()
llvm::Value * EmitCheckValue(llvm::Value *V)
Convert a value into a format suitable for passing to a runtime sanitizer handler.
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...
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.
bool needsEHCleanup(QualType::DestructionKind kind)
Determines whether an EH cleanup is required to destroy a type with the given destruction kind.
LValue EmitExtVectorElementExpr(const ExtVectorElementExpr *E)
void EmitStmt(const Stmt *S, ArrayRef< const Attr * > Attrs={})
EmitStmt - Emit the code for the statement.
llvm::GlobalVariable * AddInitializerToStaticVarDecl(const VarDecl &D, llvm::GlobalVariable *GV)
AddInitializerToStaticVarDecl - Add the initializer for 'D' to the global variable that has already b...
llvm::DenseMap< const ValueDecl *, FieldDecl * > LambdaCaptureFields
RValue EmitBuiltinNewDeleteCall(const FunctionProtoType *Type, const CallExpr *TheCallExpr, bool IsDelete)
RValue EmitUnsupportedRValue(const Expr *E, const char *Name)
EmitUnsupportedRValue - Emit a dummy r-value using the type of E and issue an ErrorUnsupported style ...
void EmitOMPParallelForSimdDirective(const OMPParallelForSimdDirective &S)
bool AutoreleaseResult
In ARC, whether we should autorelease the return value.
CleanupKind getCleanupKind(QualType::DestructionKind kind)
llvm::CallInst * EmitRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")
uint64_t getCurrentProfileCount()
Get the profiler's current count.
std::pair< LValue, LValue > EmitHLSLOutArgLValues(const HLSLOutArgExpr *E, QualType Ty)
LValue EmitObjCSelectorLValue(const ObjCSelectorExpr *E)
llvm::Value * EmitARCRetainNonBlock(llvm::Value *value)
Retain the given object, with normal retain semantics.
llvm::Type * ConvertTypeForMem(QualType T)
static std::string getNonTrivialCopyConstructorStr(QualType QT, CharUnits Alignment, bool IsVolatile, ASTContext &Ctx)
void generateObjCGetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, const ObjCMethodDecl *GetterMothodDecl, llvm::Constant *AtomicHelperFn)
LValue EmitCallExprLValue(const CallExpr *E, llvm::CallBase **CallOrInvoke=nullptr)
llvm::Value * EmitARCRetainAutoreleaseNonBlock(llvm::Value *value)
Do a fused retain/autorelease of the given object.
llvm::Value * EmitSVEMovl(const SVETypeFlags &TypeFlags, llvm::ArrayRef< llvm::Value * > Ops, unsigned BuiltinID)
void EmitOMPInnerLoop(const OMPExecutableDirective &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.
void EmitEndEHSpec(const Decl *D)
EmitEndEHSpec - Emit the end of the exception spec.
void EmitSynthesizedCXXCopyCtorCall(const CXXConstructorDecl *D, Address This, Address Src, const CXXConstructExpr *E)
void GenerateCXXGlobalCleanUpFunc(llvm::Function *Fn, ArrayRef< std::tuple< llvm::FunctionType *, llvm::WeakTrackingVH, llvm::Constant * > > DtorsOrStermFinalizers)
GenerateCXXGlobalCleanUpFunc - Generates code for cleaning up global variables.
void EmitOMPTaskLoopSimdDirective(const OMPTaskLoopSimdDirective &S)
static void EmitOMPTargetTeamsDistributeParallelForDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeParallelForDirective &S)
llvm::Value * EmitObjCAutoreleasePoolPush()
Produce the code to do a objc_autoreleasepool_push.
RValue EmitLoadOfBitfieldLValue(LValue LV, SourceLocation Loc)
void EmitSYCLKernelCallStmt(const SYCLKernelCallStmt &S)
RValue EmitAtomicExpr(AtomicExpr *E)
void GenerateObjCSetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
GenerateObjCSetter - Synthesize an Objective-C property setter function for the given property.
llvm::Value * EmitARCLoadWeak(Address addr)
i8* @objc_loadWeak(i8** addr) Essentially objc_autorelease(objc_loadWeakRetained(addr)).
void EmitOMPTargetDirective(const OMPTargetDirective &S)
void ExitSEHTryStmt(const SEHTryStmt &S)
void EmitOpenACCEnterDataConstruct(const OpenACCEnterDataConstruct &S)
LValue EmitLValueForLambdaField(const FieldDecl *Field)
static void EmitOMPTargetParallelForSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelForSimdDirective &S)
Emit device code for the target parallel for simd directive.
llvm::Value * EmitSVEPredicateTupleCast(llvm::Value *PredTuple, llvm::StructType *Ty)
void markStmtMaybeUsed(const Stmt *S)
void emitPFPPostCopyUpdates(Address DestPtr, Address SrcPtr, QualType Ty)
Copy all PFP fields from SrcPtr to DestPtr while updating signatures, assuming that DestPtr was alrea...
llvm::Value * EmitHexagonBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
Address EmitZOSVAListRef(const Expr *E)
Emit a "reference" to a __builtin_zos_va_list; this is always the address of the expression,...
CodeGenTypes & getTypes() const
RValue emitStdcCountIntrinsic(const CallExpr *E, llvm::Intrinsic::ID IntID, bool InvertArg, bool IsPop=false)
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...
llvm::Value * EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E)
static TypeEvaluationKind getEvaluationKind(QualType T)
getEvaluationKind - Return the TypeEvaluationKind of QualType T.
void generateThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk, bool IsUnprototyped)
Generate a thunk for the given method.
void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
llvm::Value * EmitIvarOffset(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)
llvm::BasicBlock * OMPScanExitBlock
llvm::Value * EmitSVEPrefetchLoad(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID)
bool IsSanitizerScope
True if CodeGen currently emits code implementing sanitizer checks.
void FlattenAccessAndTypeLValue(LValue LVal, SmallVectorImpl< LValue > &AccessList)
void EmitOMPTeamsDirective(const OMPTeamsDirective &S)
static bool containsBreak(const Stmt *S)
containsBreak - Return true if the statement contains a break out of it.
void emitImplicitAssignmentOperatorBody(FunctionArgList &Args)
void EmitSimpleOMPExecutableDirective(const OMPExecutableDirective &D)
Emit simple code for OpenMP directives in Simd-only mode.
HLSLControlFlowHintAttr::Spelling HLSLControlFlowAttr
HLSL Branch attribute.
LValue EmitCoyieldLValue(const CoyieldExpr *E)
bool InAlwaysInlineAttributedStmt
True if the current statement has always_inline attribute.
void EmitCaseStmt(const CaseStmt &S, ArrayRef< const Attr * > Attrs)
RawAddress CreateTempAlloca(llvm::Type *Ty, CharUnits align, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr, RawAddress *Alloca=nullptr)
CreateTempAlloca - This creates a alloca and inserts it into the entry block.
llvm::Constant * GenerateObjCAtomicGetterCopyHelperFunction(const ObjCPropertyImplDecl *PID)
void EmitOMPErrorDirective(const OMPErrorDirective &S)
void EmitOMPTargetTaskBasedDirective(const OMPExecutableDirective &S, const RegionCodeGenTy &BodyGen, OMPTargetDataInfo &InputInfo)
void EmitBreakStmt(const BreakStmt &S)
void EmitOMPParallelMaskedTaskLoopSimdDirective(const OMPParallelMaskedTaskLoopSimdDirective &S)
void EmitOMPTargetTeamsDirective(const OMPTargetTeamsDirective &S)
void EmitOpenACCComputeConstruct(const OpenACCComputeConstruct &S)
void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, LValue LV, QualType Type, SanitizerSet SkippedChecks=SanitizerSet(), llvm::Value *ArraySize=nullptr)
void EmitLambdaBlockInvokeBody()
void EmitCfiSlowPathCheck(SanitizerKind::SanitizerOrdinal Ordinal, llvm::Value *Cond, llvm::ConstantInt *TypeId, llvm::Value *Ptr, ArrayRef< llvm::Constant * > StaticArgs)
Emit a slow path cross-DSO CFI check which calls __cfi_slowpath if Cond if false.
RValue EmitCoawaitExpr(const CoawaitExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)
llvm::SmallVector< const ParmVarDecl *, 4 > FnArgs
Save Parameter Decl for coroutine.
void EmitDoStmt(const DoStmt &S, ArrayRef< const Attr * > Attrs={})
void EmitOMPTargetDataDirective(const OMPTargetDataDirective &S)
llvm::Value * EmitSMEZero(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
const TargetInfo & Target
void EmitCXXTemporary(const CXXTemporary *Temporary, QualType TempType, Address Ptr)
Emits all the code to cause the given temporary to be cleaned up.
llvm::Value * authPointerToPointerCast(llvm::Value *ResultPtr, QualType SourceType, QualType DestType)
Address GenerateCapturedStmtArgument(const CapturedStmt &S)
LValue EmitUnaryOpLValue(const UnaryOperator *E)
bool EmitOMPLastprivateClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)
Emit initial code for lastprivate variables.
void StartThunk(llvm::Function *Fn, GlobalDecl GD, const CGFunctionInfo &FnInfo, bool IsUnprototyped)
void EmitFunctionEpilog(const CGFunctionInfo &FI, bool EmitRetDbgLoc, SourceLocation EndLoc, uint64_t RetKeyInstructionsSourceAtom)
EmitFunctionEpilog - Emit the target specific LLVM code to return the given temporary.
Address EmitPointerWithAlignment(const Expr *Addr, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)
EmitPointerWithAlignment - Given an expression with a pointer type, emit the value and compute our be...
static void EmitOMPTargetTeamsDistributeParallelForSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeParallelForSimdDirective &S)
Emit device code for the target teams distribute parallel for simd directive.
llvm::BasicBlock * getEHDispatchBlock(EHScopeStack::stable_iterator scope)
void EmitBranch(llvm::BasicBlock *Block)
EmitBranch - Emit a branch to the specified basic block from the current insert block,...
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::Function * GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S, const OMPExecutableDirective &D)
void EmitOMPSimdDirective(const OMPSimdDirective &S)
llvm::Value * EmitSVEStructStore(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
LValue EmitCheckedLValue(const Expr *E, TypeCheckKind TCK)
Same as EmitLValue but additionally we generate checking code to guard against undefined behavior.
void EmitInheritedCXXConstructorCall(const CXXConstructorDecl *D, bool ForVirtualBase, Address This, bool InheritedFromVBase, const CXXInheritedCtorInitExpr *E)
Emit a call to a constructor inherited from a base class, passing the current constructor's arguments...
RawAddress CreateMemTemp(QualType T, const Twine &Name="tmp", RawAddress *Alloca=nullptr)
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignmen and cas...
Address EmitLoadOfReference(LValue RefLVal, LValueBaseInfo *PointeeBaseInfo=nullptr, TBAAAccessInfo *PointeeTBAAInfo=nullptr)
CGCallee BuildAppleKextVirtualCall(const CXXMethodDecl *MD, NestedNameSpecifier Qual, llvm::Type *Ty)
BuildAppleKextVirtualCall - This routine is to support gcc's kext ABI making indirect call to virtual...
RValue EmitRValueForField(LValue LV, const FieldDecl *FD, SourceLocation Loc)
void EmitOMPParallelGenericLoopDirective(const OMPLoopDirective &S)
void EmitOMPTargetSimdDirective(const OMPTargetSimdDirective &S)
RawAddress NormalCleanupDest
i32s containing the indexes of the cleanup destinations.
llvm::Value * EmitObjCExtendObjectLifetime(QualType T, llvm::Value *Ptr)
SmallVector< llvm::Value *, 8 > ObjCEHValueStack
ObjCEHValueStack - Stack of Objective-C exception values, used for rethrows.
void WasmEmitFallthroughRethrow(llvm::BasicBlock *WasmCatchStartBlock)
void EmitOMPTeamsGenericLoopDirective(const OMPTeamsGenericLoopDirective &S)
void setBlockContextParameter(const ImplicitParamDecl *D, unsigned argNum, llvm::Value *ptr)
LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E)
RValue EmitCXXMemberPointerCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)
llvm::Type * convertTypeForLoadStore(QualType ASTTy, llvm::Type *LLVMTy=nullptr)
llvm::Value * EmitSMELd1St1(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)
void EmitOMPOrderedStandaloneDirective(const OMPOrderedStandaloneDirective &S)
llvm::Value * EmitPointerAuthBlendDiscriminator(llvm::Value *StorageAddress, llvm::Value *Discriminator)
Create the discriminator from the storage address and the entity hash.
void EmitVarDecl(const VarDecl &D)
EmitVarDecl - Emit a local variable declaration.
unsigned NextCleanupDestIndex
AggValueSlot::Overlap_t getOverlapForReturnValue()
Determine whether a return value slot may overlap some other object.
bool sanitizePerformTypeCheck() const
Whether any type-checking sanitizers are enabled.
const BreakContinue * GetDestForLoopControlStmt(const LoopControlStmt &S)
Address EmitExtVectorElementLValue(LValue V)
Generates lvalue for partial ext_vector access.
bool EmitOMPLinearClauseInit(const OMPLoopDirective &D)
Emit initial code for linear variables.
void SpecialInitFn(CodeGenFunction &Init, const VarDecl &D, llvm::Value *Address)
llvm::Value * EmitCheckedInBoundsGEP(llvm::Type *ElemTy, llvm::Value *Ptr, ArrayRef< llvm::Value * > IdxList, bool SignedIndices, bool IsSubtraction, SourceLocation Loc, const Twine &Name="")
Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to detect undefined behavior whe...
void EmitInitializationToLValue(const Expr *E, LValue LV, AggValueSlot::IsZeroed_t IsZeroed=AggValueSlot::IsNotZeroed)
EmitInitializationToLValue - Emit an initializer to an LValue.
void EmitAggExpr(const Expr *E, AggValueSlot AS)
EmitAggExpr - Emit the computation of the specified expression of aggregate type.
VarBypassDetector Bypasses
llvm::BasicBlock * GetIndirectGotoBlock()
static void EmitOMPTargetParallelGenericLoopDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelGenericLoopDirective &S)
Emit device code for the target parallel loop directive.
llvm::Value * EmitBuiltinAvailable(const VersionTuple &Version)
void EmitOpenACCHostDataConstruct(const OpenACCHostDataConstruct &S)
Address emitAddrOfRealComponent(Address complex, QualType complexType)
llvm::DILocation * SanitizerAnnotateDebugInfo(ArrayRef< SanitizerKind::SanitizerOrdinal > Ordinals, SanitizerHandler Handler)
Returns debug info, with additional annotation if CGM.getCodeGenOpts().SanitizeAnnotateDebugInfo[Ordi...
EHScopeStack::stable_iterator PrologueCleanupDepth
PrologueCleanupDepth - The cleanup depth enclosing all the cleanups associated with the parameters.
void EmitOpenACCUpdateConstruct(const OpenACCUpdateConstruct &S)
llvm::Value * GetVTTParameter(GlobalDecl GD, bool ForVirtualBase, bool Delegating)
GetVTTParameter - Return the VTT parameter that should be passed to a base constructor/destructor wit...
void EmitOMPUnrollDirective(const OMPUnrollDirective &S)
void EmitOMPStripeDirective(const OMPStripeDirective &S)
Address EmitMSVAListRef(const Expr *E)
Emit a "reference" to a __builtin_ms_va_list; this is always the value of the expression,...
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type,...
const FunctionDecl * getCurrentFunctionDecl() const
RValue EmitLoadOfExtVectorElementLValue(LValue V)
static bool hasAggregateEvaluationKind(QualType T)
static bool IsWrappedCXXThis(const Expr *E)
Check if E is a C++ "this" pointer wrapped in value-preserving casts.
void EmitDeleteCall(const FunctionDecl *DeleteFD, llvm::Value *Ptr, QualType DeleteTy, llvm::Value *NumElements=nullptr, CharUnits CookieSize=CharUnits(), llvm::Constant *CalleeOverride=nullptr)
void EmitCallArgs(CallArgList &Args, PrototypeWrapper Prototype, llvm::iterator_range< CallExpr::const_arg_iterator > ArgRange, AbstractCallee AC=AbstractCallee(), unsigned ParamsToSkip=0, EvaluationOrder Order=EvaluationOrder::Default)
EmitCallArgs - Emit call arguments for a function.
llvm::Value * EmitMatrixIndexExpr(const Expr *E)
void EmitCaseStmtRange(const CaseStmt &S, ArrayRef< const Attr * > Attrs)
EmitCaseStmtRange - If case statement range is not too big then add multiple cases to switch instruct...
ComplexPairTy EmitUnPromotedValue(ComplexPairTy result, QualType PromotionType)
LValue MakeAddrLValue(Address Addr, QualType T, AlignmentSource Source=AlignmentSource::Type)
void EmitOMPSingleDirective(const OMPSingleDirective &S)
void EmitTrapCheck(llvm::Value *Checked, SanitizerHandler CheckHandlerID, bool NoMerge=false, const TrapReason *TR=nullptr)
Create a basic block that will call the trap intrinsic, and emit a conditional branch to it,...
void EmitReturnStmt(const ReturnStmt &S)
EmitReturnStmt - Note that due to GCC extensions, this can have an operand if the function returns vo...
void EmitTrapCallAndMakeUnreachable()
Emit a call to '@llvm.trap()' and clear the current insert point.
void EmitLambdaVLACapture(const VariableArrayType *VAT, LValue LV)
void FinishFunction(SourceLocation EndLoc=SourceLocation())
FinishFunction - Complete IR generation of the current function.
llvm::Value * LoadCXXThis()
LoadCXXThis - Load the value of 'this'.
llvm::function_ref< void(CodeGenFunction &, SourceLocation, const unsigned, const bool)> CodeGenOrderedTy
void EmitAtomicStore(RValue rvalue, LValue lvalue, bool isInit)
llvm::Value * EmitFromMemory(llvm::Value *Value, QualType Ty)
EmitFromMemory - Change a scalar value from its memory representation to its value representation.
llvm::Value * EmitCheckedArgForAssume(const Expr *E)
Emits an argument for a call to a __builtin_assume.
llvm::Value * EmitARCStoreStrongCall(Address addr, llvm::Value *value, bool resultIgnored)
Store into a strong object.
static void EmitOMPTargetSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetSimdDirective &S)
Emit device code for the target simd directive.
RawAddress createCleanupActiveFlag()
llvm::Function * GenerateCapturedStmtFunction(const CapturedStmt &S)
Creates the outlined function for a CapturedStmt.
const CallExpr * MustTailCall
static void EmitOMPTargetParallelForDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelForDirective &S)
Emit device code for the target parallel for directive.
void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)
const CGFunctionInfo * CurFnInfo
uint64_t getProfileCount(const Stmt *S)
Get the profiler's count for the given statement.
llvm::Value * EmitLoadOfCountedByField(const Expr *Base, const FieldDecl *FD, const FieldDecl *CountDecl)
Build an expression accessing the "counted_by" field.
Address GetAddrOfLocalVar(const VarDecl *VD)
GetAddrOfLocalVar - Return the address of a local variable.
llvm::Value * EmitNVPTXBuiltinExpr(unsigned BuiltinID, const CallExpr *E)
llvm::Value * getArrayInitIndex()
Get the index of the current ArrayInitLoopExpr, if any.
void EmitDeclStmt(const DeclStmt &S)
void InitializeVTablePointer(const VPtr &vptr)
Initialize the vtable pointer of the given subobject.
void EmitLabelStmt(const LabelStmt &S)
llvm::Value * EmitVTableTypeCheckedLoad(const CXXRecordDecl *RD, llvm::Value *VTable, llvm::Type *VTableTy, uint64_t VTableByteOffset)
Emit a type checked load from the given vtable.
void EmitUnreachable(SourceLocation Loc)
Emit a reached-unreachable diagnostic if Loc is valid and runtime checking is enabled.
bool ConstantFoldsToSimpleInteger(const Expr *Cond, bool &Result, bool AllowLabels=false)
ConstantFoldsToSimpleInteger - If the specified expression does not fold to a constant,...
static void EmitOMPTargetTeamsGenericLoopDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsGenericLoopDirective &S)
Emit device code for the target teams loop directive.
llvm::Value * EmitObjCStringLiteral(const ObjCStringLiteral *E)
Emits an instance of NSConstantString representing the object.
void ErrorUnsupported(const Stmt *S, const char *Type)
ErrorUnsupported - Print out an error that codegen doesn't support the specified stmt yet.
llvm::Value * EmitSVEReinterpret(llvm::Value *Val, llvm::Type *Ty)
void EmitOMPTileDirective(const OMPTileDirective &S)
void EmitDecl(const Decl &D, bool EvaluateConditionDecl=false)
EmitDecl - Emit a declaration.
LValue EmitCXXTypeidLValue(const CXXTypeidExpr *E)
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.
void EmitOMPAtomicDirective(const OMPAtomicDirective &S)
LValue EmitMemberExpr(const MemberExpr *E)
void EmitOpenACCSetConstruct(const OpenACCSetConstruct &S)
llvm::BasicBlock * OMPAfterScanBlock
std::pair< llvm::Value *, llvm::Value * > ComplexPairTy
Address ReturnValue
ReturnValue - The temporary alloca to hold the return value.
ConstantEmission tryEmitAsConstant(const DeclRefExpr *RefExpr)
Try to emit a reference to the given value without producing it as an l-value.
void EmitObjCMRRAutoreleasePoolPop(llvm::Value *Ptr)
Produce the code to do a primitive release.
LValue EmitLValue(const Expr *E, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)
EmitLValue - Emit code to compute a designator that specifies the location of the expression.
void EmitStoreThroughGlobalRegLValue(RValue Src, LValue Dst)
Store of global named registers are always calls to intrinsics.
void EmitAttributedStmt(const AttributedStmt &S)
llvm::Value * EmitARCExtendBlockObject(const Expr *expr)
bool ShouldXRayInstrumentFunction() const
ShouldXRayInstrument - Return true if the current function should be instrumented with XRay nop sleds...
bool isOpaqueValueEmitted(const OpaqueValueExpr *E)
isOpaqueValueEmitted - Return true if the opaque value expression has already been emitted.
std::pair< llvm::Value *, CGPointerAuthInfo > EmitOrigPointerRValue(const Expr *E)
Retrieve a pointer rvalue and its ptrauth info.
void EmitOMPParallelMasterTaskLoopDirective(const OMPParallelMasterTaskLoopDirective &S)
void EmitOMPDistributeParallelForSimdDirective(const OMPDistributeParallelForSimdDirective &S)
void markStmtAsUsed(bool Skipped, const Stmt *S)
llvm::Instruction * CurrentFuncletPad
llvm::Value * EmitARCStoreWeak(Address addr, llvm::Value *value, bool ignored)
i8* @objc_storeWeak(i8** addr, i8* value) Returns value.
bool ShouldEmitVTableTypeCheckedLoad(const CXXRecordDecl *RD)
Returns whether we should perform a type checked load when loading a virtual function for virtual cal...
void EmitOMPSectionDirective(const OMPSectionDirective &S)
llvm::Constant * GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo)
Generate the destroy-helper function for a block closure object: static void block_destroy_helper(blo...
void EnsureInsertPoint()
EnsureInsertPoint - Ensure that an insertion point is defined so that emitted IR has a place to go.
void EmitOMPForSimdDirective(const OMPForSimdDirective &S)
llvm::LLVMContext & getLLVMContext()
bool SawAsmBlock
Whether we processed a Microsoft-style asm block during CodeGen.
void EmitNewArrayInitializer(const CXXNewExpr *E, QualType elementType, llvm::Type *ElementTy, Address NewPtr, llvm::Value *NumElements, llvm::Value *AllocSizeWithoutCookie)
RValue EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)
static Destroyer destroyARCStrongPrecise
ComplexPairTy EmitPromotedValue(ComplexPairTy result, QualType PromotionType)
bool checkIfFunctionMustProgress()
Returns true if a function must make progress, which means the mustprogress attribute can be added.
LValue EmitMatrixElementExpr(const MatrixElementExpr *E)
void incrementProfileCounter(const Stmt *S, llvm::Value *StepV=nullptr)
Increment the profiler's counter for the given statement by StepV.
void EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S)
llvm::SmallVector< VPtr, 4 > VPtrsVector
static unsigned getAccessedFieldNo(unsigned Idx, const llvm::Constant *Elts)
getAccessedFieldNo - Given an encoded value and a result number, return the input field number being ...
llvm::Value * EmitTargetBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)
EmitTargetBuiltinExpr - Emit the given builtin call.
void emitAlignmentAssumption(llvm::Value *PtrValue, QualType Ty, SourceLocation Loc, SourceLocation AssumptionLoc, llvm::Value *Alignment, llvm::Value *OffsetValue=nullptr)
static void EmitOMPTargetTeamsDistributeSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeSimdDirective &S)
Emit device code for the target teams distribute simd directive.
void EmitObjCAutoreleasePoolPop(llvm::Value *Ptr)
Produce the code to do a primitive release.
void InitializeVTablePointers(const CXXRecordDecl *ClassDecl)
llvm::Value * EmitObjCRetainNonBlock(llvm::Value *value, llvm::Type *returnType)
Retain the given object, with normal retain semantics.
void EmitARCCopyWeak(Address dst, Address src)
void @objc_copyWeak(i8** dest, i8** src) Disregards the current value in dest.
bool isMCDCDecisionExpr(const Expr *E) const
llvm::Value * EmitSEHExceptionInfo()
llvm::function_ref< void(CodeGenFunction &, const OMPLoopDirective &, JumpDest)> CodeGenLoopTy
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...
void EmitIndirectGotoStmt(const IndirectGotoStmt &S)
void EmitVariablyModifiedType(QualType Ty)
EmitVLASize - Capture all the sizes for the VLA expressions in the given variably-modified type and s...
static bool ShouldNullCheckClassCastValue(const CastExpr *Cast)
void EmitVTableAssumptionLoad(const VPtr &vptr, Address This)
Emit assumption that vptr load == global vtable.
llvm::Value * EmitHLSLBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)
void MaybeEmitDeferredVarDeclInit(const VarDecl *var)
void ProcessOrderScopeAMDGCN(llvm::Value *Order, llvm::Value *Scope, llvm::AtomicOrdering &AO, llvm::SyncScope::ID &SSID)
bool isObviouslyBranchWithoutCleanups(JumpDest Dest) const
isObviouslyBranchWithoutCleanups - Return true if a branch to the specified destination obviously has...
void EmitSEHTryStmt(const SEHTryStmt &S)
bool isTrivialInitializer(const Expr *Init)
Determine whether the given initializer is trivial in the sense that it requires no code to be genera...
void EmitOMPParallelMasterDirective(const OMPParallelMasterDirective &S)
llvm::ScalableVectorType * getSVEPredType(const SVETypeFlags &TypeFlags)
void emitARCCopyAssignWeak(QualType Ty, Address DstAddr, Address SrcAddr)
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::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, ArrayRef< Address > args, const Twine &name="")
llvm::Value * EmitNonNullRValueCheck(RValue RV, QualType T)
Create a check that a scalar RValue is non-null.
static Destroyer emitARCIntrinsicUse
void EmitARCIntrinsicUse(ArrayRef< llvm::Value * > values)
Given a number of pointers, inform the optimizer that they're being intrinsically used up until this ...
llvm::Value * EmitCMSEClearRecord(llvm::Value *V, llvm::IntegerType *ITy, QualType RTy)
void EmitOMPTaskBasedDirective(const OMPExecutableDirective &S, const OpenMPDirectiveKind CapturedRegion, const RegionCodeGenTy &BodyGen, const TaskGenTy &TaskGen, OMPTaskDataTy &Data)
llvm::Value * EmitNeonCall(llvm::Function *F, SmallVectorImpl< llvm::Value * > &O, const char *name, unsigned shift=0, bool rightshift=false)
void PopCleanupBlock(bool FallThroughIsBranchThrough=false, bool ForDeactivation=false)
PopCleanupBlock - Will pop the cleanup entry on the stack and process all branch fixups.
void EmitStoreOfScalar(llvm::Value *Value, Address Addr, bool Volatile, QualType Ty, AlignmentSource Source=AlignmentSource::Type, bool isInit=false, bool isNontemporal=false)
EmitStoreOfScalar - Store a scalar value to an address, taking care to appropriately convert from the...
Address getEHSelectorSlot()
void EmitOMPForDirective(const OMPForDirective &S)
bool hasLabelBeenSeenInCurrentScope() const
Return true if a label was seen in the current scope.
llvm::Function * GenerateSEHFilterFunction(CodeGenFunction &ParentCGF, const SEHExceptStmt &Except)
Create a stub filter function that will ultimately hold the code of the filter expression.
void EmitLabel(const LabelDecl *D)
EmitLabel - Emit the block for the given label.
llvm::Value * EmitDynamicCast(Address V, const CXXDynamicCastExpr *DCE)
void EmitOMPLinearClauseFinal(const OMPLoopDirective &D, const llvm::function_ref< llvm::Value *(CodeGenFunction &)> CondGen)
Emit final code for linear clauses.
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
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...
LValue MakeNaturalAlignRawAddrLValue(llvm::Value *V, QualType T)
LValue EmitLoadOfReferenceLValue(Address RefAddr, QualType RefTy, AlignmentSource Source=AlignmentSource::Type)
llvm::Value * EmitSVETupleSetOrGet(const SVETypeFlags &TypeFlags, ArrayRef< llvm::Value * > Ops)
QualType BuildFunctionArgList(GlobalDecl GD, FunctionArgList &Args)
llvm::Value * EmitPointerAuthAuth(const CGPointerAuthInfo &Info, llvm::Value *Pointer)
void EmitContinueStmt(const ContinueStmt &S)
llvm::CallInst * EmitIntrinsicCall(llvm::Intrinsic::ID ID, ArrayRef< llvm::Type * > Types, ArrayRef< llvm::Value * > Args, const Twine &Name="")
llvm::Value * EmitCXXTypeidExpr(const CXXTypeidExpr *E)
void EmitOMPSimdFinal(const OMPLoopDirective &D, const llvm::function_ref< llvm::Value *(CodeGenFunction &)> CondGen)
llvm::Type * ConvertType(const TypeDecl *T)
This class organizes the cross-function state that is used while generating LLVM code.
const llvm::DataLayout & getDataLayout() const
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
A specialization of Address that requires the address to be an LLVM Constant.
static ConstantAddress invalid()
static bool needsSaving(RValue value)
DominatingLLVMValue::saved_type second
DominatingLLVMValue::saved_type first
DominatingValue< Address >::saved_type AggregateAddr
static saved_type save(CodeGenFunction &CGF, RValue value)
RValue restore(CodeGenFunction &CGF)
ConditionalCleanup stores the saved form of its parameters, then restores them and performs the clean...
A saved depth on the scope stack.
A stack of scopes which respond to exceptions, including cleanups and catch blocks.
static stable_iterator stable_end()
Create a stable reference to the bottom of the EH stack.
FunctionArgList - Type for representing both the decl and type of parameters to a function.
LValue - This represents an lvalue references.
CharUnits getAlignment() const
static LValue MakeAddr(Address Addr, QualType type, ASTContext &Context, LValueBaseInfo BaseInfo, TBAAAccessInfo TBAAInfo)
llvm::Value * emitRawPointer(CodeGenFunction &CGF) const
A stack of loop information corresponding to loop nesting levels.
RValue - This trivial value class is used to represent the result of an expression that is evaluated.
static RValue get(llvm::Value *V)
An abstract representation of an aligned address.
static RawAddress invalid()
Class provides a way to call simple version of codegen for OpenMP region, or an advanced with possibl...
ReturnValueSlot - Contains the address where the return value of a function can be stored,...
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
The class detects jumps which bypass local variables declaration: goto L; int a; L:
CompoundAssignOperator - For compound assignments (e.g.
CompoundLiteralExpr - [C99 6.5.2.5].
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
SourceLocExprScopeGuard(const Expr *DefaultExpr, CurrentSourceLocExprScope &Current)
Represents the current source location and context used to determine the value of the source location...
A reference to a declared variable, function, enum, etc.
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Represents a member of a struct/union/class.
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
GlobalDecl - represents a global declaration.
const Decl * getDecl() const
GotoStmt - This represents a direct goto.
This class represents temporary values used to represent inout and out arguments in HLSL.
IfStmt - This represents an if/then/else.
IndirectGotoStmt - This represents an indirect goto.
Describes an C or C++ initializer list.
Represents the declaration of a label.
LabelStmt - Represents a label, which has a substatement.
FPExceptionModeKind
Possible floating point exception behavior.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Represents a point when we exit a loop.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
A pointer to member type per C++ 8.3.3 - Pointers to members.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Represents Objective-C's @synchronized statement.
Represents Objective-C's @throw statement.
Represents Objective-C's @try ... @catch ... @finally statement.
Represents Objective-C's @autoreleasepool Statement.
ObjCBoxedExpr - used for generalized expression boxing.
ObjCContainerDecl - Represents a container for method declarations.
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
ObjCEncodeExpr, used for @encode in Objective-C.
Represents Objective-C's collection statement.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Represents an ObjC class declaration.
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
An expression that sends a message to the given Objective-C object or class.
ObjCMethodDecl - Represents an instance or class method declaration.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCProtocolExpr used for protocol expression in Objective-C.
ObjCSelectorExpr used for @selector in Objective-C.
ObjCStringLiteral, used for Objective-C string literals i.e.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Represents a parameter to a function.
Pointer-authentication qualifiers.
PointerType - C99 6.7.5.1 - Pointer Declarators.
[C99 6.4.2.2] - A predefined identifier such as func.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
A (possibly-)qualified type.
@ DK_objc_strong_lifetime
The collection of all-type qualifiers we support.
Represents a struct/union/class.
specific_decl_iterator< FieldDecl > field_iterator
Flags to identify the types for overloaded SVE builtins.
Scope - A scope is a transient data structure that is used while parsing the program.
Encodes a location in the source.
A trivial tuple used to represent a source range.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Stmt - This represents one statement.
Likelihood
The likelihood of a branch being taken.
@ LH_None
No attribute set or branches of the IfStmt have the same attribute.
StringLiteral - This represents a string literal expression, e.g.
Exposes information about the current target.
Represents a declaration of a type.
bool isReferenceType() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Represents a call to the builtin function __builtin_va_arg.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
VarDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isLocalVarDeclOrParm() const
Similar to isLocalVarDecl but also includes parameters.
Represents a C array with a specified size that is not an integer-constant-expression.
Expr * getSizeExpr() const
WhileStmt - This represents a 'while' stmt.
Defines the clang::TargetInfo interface.
AlignmentSource
The source of the alignment of an l-value; an expression of confidence in the alignment actually matc...
@ Type
The l-value was considered opaque, so the alignment was determined from a type.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
TypeEvaluationKind
The kind of evaluation to perform on values of a particular type.
@ NormalCleanup
Denotes a cleanup that should run when a scope is exited using normal control flow (falling off the e...
ARCPreciseLifetime_t
Does an ARC strong l-value have precise lifetime?
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const AstTypeMatcher< ArrayType > arrayType
const AstTypeMatcher< ComplexType > complexType
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
@ Address
A pointer to a ValueDecl.
Top level wrappers for InstallAPI frontend operations.
CXXCtorType
C++ constructor types.
bool isa(CodeGen::Address addr)
@ Success
Annotation was successful.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
CapturedRegionKind
The different kinds of captured statement.
OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ Result
The result type of a method or function.
const FunctionProtoType * T
CXXDtorType
C++ destructor types.
LangAS
Defines the address space values used by the address space qualifier of QualType.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
llvm::fp::ExceptionBehavior ToConstrainedExceptMD(LangOptions::FPExceptionModeKind Kind)
U cast(CodeGen::Address addr)
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
Diagnostic wrappers for TextAPI types for error reporting.
Structure with information about how a bitfield should be accessed.
llvm::SmallVector< llvm::AllocaInst * > Take()
AllocaTrackerRAII(CodeGenFunction &CGF)
std::unique_ptr< CGCoroData > Data
CXXDefaultArgExprScope(CodeGenFunction &CGF, const CXXDefaultArgExpr *E)
size_t OldDeactivateCleanupStackSize
CleanupDeactivationScope(CodeGenFunction &CGF)
~CleanupDeactivationScope()
llvm::Instruction * DominatingIP
EHScopeStack::stable_iterator Cleanup
std::optional< StringRef > Architecture
FMVResolverOption(llvm::Function *F, ArrayRef< StringRef > Feats, std::optional< StringRef > Arch=std::nullopt)
llvm::SmallVector< StringRef, 8 > Features
llvm::Function * Function
A jump destination is an abstract label, branching to which may require a jump out through normal cle...
void setScopeDepth(EHScopeStack::stable_iterator depth)
llvm::BasicBlock * getBlock() const
EHScopeStack::stable_iterator getScopeDepth() const
unsigned getDestIndex() const
JumpDest(llvm::BasicBlock *Block, EHScopeStack::stable_iterator Depth, unsigned Index)
static Address getAddrOfThreadPrivate(CodeGenFunction &CGF, const VarDecl *VD, Address VDAddr, SourceLocation Loc)
Returns address of the threadprivate variable for the current thread.
OMPBuilderCBHelpers()=delete
llvm::OpenMPIRBuilder::InsertPointTy InsertPointTy
static void EmitOMPOutlinedRegionBody(CodeGenFunction &CGF, const Stmt *RegionBodyStmt, InsertPointTy AllocaIP, InsertPointTy CodeGenIP, Twine RegionName)
Emit the body of an OMP region that will be outlined in OpenMPIRBuilder::finalize().
static Address getAddressOfLocalVariable(CodeGenFunction &CGF, const VarDecl *VD)
Gets the OpenMP-specific address of the local variable /p VD.
static void EmitCaptureStmt(CodeGenFunction &CGF, InsertPointTy CodeGenIP, llvm::BasicBlock &FiniBB, llvm::Function *Fn, ArrayRef< llvm::Value * > Args)
static std::string getNameWithSeparators(ArrayRef< StringRef > Parts, StringRef FirstSeparator=".", StringRef Separator=".")
Get the platform-specific name separator.
static void FinalizeOMPRegion(CodeGenFunction &CGF, InsertPointTy IP)
Emit the Finalization for an OMP region.
static void EmitOMPInlinedRegionBody(CodeGenFunction &CGF, const Stmt *RegionBodyStmt, InsertPointTy AllocaIP, InsertPointTy CodeGenIP, Twine RegionName)
Emit the body of an OMP region.
OMPBuilderCBHelpers & operator=(const OMPBuilderCBHelpers &)=delete
OMPBuilderCBHelpers(const OMPBuilderCBHelpers &)=delete
unsigned NumberOfTargetItems
OMPTargetDataInfo(Address BasePointersArray, Address PointersArray, Address SizesArray, Address MappersArray, unsigned NumberOfTargetItems)
OMPTargetDataInfo()=default
Address BasePointersArray
PrototypeWrapper(const FunctionProtoType *FT)
llvm::PointerUnion< const FunctionProtoType *, const ObjCMethodDecl * > P
PrototypeWrapper(const ObjCMethodDecl *MD)
Struct with all information about dynamic [sub]class needed to set vptr.
const CXXRecordDecl * NearestVBase
const CXXRecordDecl * VTableClass
CharUnits OffsetFromNearestVBase
VlaSizePair(llvm::Value *NE, QualType T)
This structure provides a set of types that are commonly used during IR emission.
llvm::PointerType * Int8PtrTy
saved_type(llvm::Value *V)
saved_type(llvm::AllocaInst *Alloca, llvm::Type *Ty)
Helper class with most of the code for saving a value for a conditional expression cleanup.
static llvm::Value * restore(CodeGenFunction &CGF, saved_type value)
static saved_type save(CodeGenFunction &CGF, llvm::Value *value)
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)
DominatingLLVMValue::saved_type Offset
llvm::PointerType * EffectiveType
DominatingLLVMValue::saved_type BasePtr
static type restore(CodeGenFunction &CGF, saved_type value)
static bool needsSaving(type value)
static saved_type save(CodeGenFunction &CGF, type value)
static bool needsSaving(type value)
static saved_type save(CodeGenFunction &CGF, type value)
static type restore(CodeGenFunction &CGF, saved_type value)
A metaprogramming class for ensuring that a value will dominate an arbitrary position in a function.
static bool needsSaving(type value)
static saved_type save(CodeGenFunction &CGF, type value)
The this pointer adjustment as well as an optional return adjustment for a thunk.