30 #include "llvm/IR/DataLayout.h"
31 #include "llvm/IR/GlobalVariable.h"
32 #include "llvm/IR/Intrinsics.h"
33 #include "llvm/IR/Type.h"
35 using namespace clang;
36 using namespace CodeGen;
39 switch (D.getKind()) {
40 case Decl::BuiltinTemplate:
41 case Decl::TranslationUnit:
42 case Decl::ExternCContext:
44 case Decl::UnresolvedUsingTypename:
45 case Decl::ClassTemplateSpecialization:
46 case Decl::ClassTemplatePartialSpecialization:
47 case Decl::VarTemplateSpecialization:
48 case Decl::VarTemplatePartialSpecialization:
49 case Decl::TemplateTypeParm:
50 case Decl::UnresolvedUsingValue:
51 case Decl::NonTypeTemplateParm:
53 case Decl::CXXConstructor:
54 case Decl::CXXDestructor:
55 case Decl::CXXConversion:
57 case Decl::MSProperty:
58 case Decl::IndirectField:
60 case Decl::ObjCAtDefsField:
62 case Decl::ImplicitParam:
63 case Decl::ClassTemplate:
64 case Decl::VarTemplate:
65 case Decl::FunctionTemplate:
66 case Decl::TypeAliasTemplate:
67 case Decl::TemplateTemplateParm:
68 case Decl::ObjCMethod:
69 case Decl::ObjCCategory:
70 case Decl::ObjCProtocol:
71 case Decl::ObjCInterface:
72 case Decl::ObjCCategoryImpl:
73 case Decl::ObjCImplementation:
74 case Decl::ObjCProperty:
75 case Decl::ObjCCompatibleAlias:
76 case Decl::PragmaComment:
77 case Decl::PragmaDetectMismatch:
78 case Decl::AccessSpec:
79 case Decl::LinkageSpec:
80 case Decl::ObjCPropertyImpl:
81 case Decl::FileScopeAsm:
83 case Decl::FriendTemplate:
86 case Decl::ClassScopeFunctionSpecialization:
87 case Decl::UsingShadow:
88 case Decl::ConstructorUsingShadow:
89 case Decl::ObjCTypeParam:
90 llvm_unreachable(
"Declaration should not be in declstmts!");
94 case Decl::EnumConstant:
96 case Decl::StaticAssert:
99 case Decl::OMPThreadPrivate:
100 case Decl::OMPCapturedExpr:
105 case Decl::NamespaceAlias:
107 DI->EmitNamespaceAlias(cast<NamespaceAliasDecl>(D));
111 DI->EmitUsingDecl(cast<UsingDecl>(D));
113 case Decl::UsingDirective:
115 DI->EmitUsingDirective(cast<UsingDirectiveDecl>(D));
118 const VarDecl &VD = cast<VarDecl>(D);
120 "Should not see file-scope variables inside a function!");
124 case Decl::OMPDeclareReduction:
132 if (Ty->isVariablyModifiedType())
142 llvm::GlobalValue::LinkageTypes
Linkage =
169 std::string ContextName;
171 if (
auto *CD = dyn_cast<CapturedDecl>(DC))
172 DC = cast<DeclContext>(CD->getNonClosureContext());
173 if (
const auto *FD = dyn_cast<FunctionDecl>(DC))
175 else if (
const auto *BD = dyn_cast<BlockDecl>(DC))
177 else if (
const auto *OMD = dyn_cast<ObjCMethodDecl>(DC))
178 ContextName = OMD->getSelector().getAsString();
180 llvm_unreachable(
"Unknown context for static var decl");
192 if (llvm::Constant *ExistingGV = StaticLocalDeclMap[&D])
200 if (D.hasAttr<AsmLabelAttr>())
210 llvm::Constant *Init =
nullptr;
214 Init = llvm::UndefValue::get(LTy);
216 llvm::GlobalVariable *GV =
217 new llvm::GlobalVariable(
getModule(), LTy,
220 llvm::GlobalVariable::NotThreadLocal,
222 GV->setAlignment(
getContext().getDeclAlign(&D).getQuantity());
226 GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
231 if (D.isExternallyVisible()) {
232 if (D.hasAttr<DLLImportAttr>())
233 GV->setDLLStorageClass(llvm::GlobalVariable::DLLImportStorageClass);
234 else if (D.hasAttr<DLLExportAttr>())
235 GV->setDLLStorageClass(llvm::GlobalVariable::DLLExportStorageClass);
240 llvm::Constant *Addr = GV;
241 if (AddrSpace != ExpectedAddrSpace) {
242 llvm::PointerType *PTy = llvm::PointerType::get(LTy, ExpectedAddrSpace);
243 Addr = llvm::ConstantExpr::getAddrSpaceCast(GV, PTy);
250 const Decl *DC = cast<Decl>(D.getDeclContext());
254 if (isa<BlockDecl>(DC) || isa<CapturedDecl>(DC)) {
255 DC = DC->getNonClosureContext();
262 if (
const auto *CD = dyn_cast<CXXConstructorDecl>(DC))
264 else if (
const auto *DD = dyn_cast<CXXDestructorDecl>(DC))
266 else if (
const auto *FD = dyn_cast<FunctionDecl>(DC))
271 assert(isa<ObjCMethodDecl>(DC) &&
"unexpected parent code decl");
291 llvm::GlobalVariable *
293 llvm::GlobalVariable *GV) {
301 else if (
Builder.GetInsertBlock()) {
304 GV->setConstant(
false);
315 if (GV->getType()->getElementType() != Init->getType()) {
316 llvm::GlobalVariable *OldGV = GV;
318 GV =
new llvm::GlobalVariable(
CGM.
getModule(), Init->getType(),
320 OldGV->getLinkage(), Init,
"",
322 OldGV->getThreadLocalMode(),
324 GV->setVisibility(OldGV->getVisibility());
325 GV->setComdat(OldGV->getComdat());
331 llvm::Constant *NewPtrForOldDecl =
332 llvm::ConstantExpr::getBitCast(GV, OldGV->getType());
333 OldGV->replaceAllUsesWith(NewPtrForOldDecl);
336 OldGV->eraseFromParent();
340 GV->setInitializer(Init);
353 llvm::GlobalValue::LinkageTypes
Linkage) {
362 setAddrOfLocalVar(&D,
Address(addr, alignment));
373 llvm::GlobalVariable *var =
374 cast<llvm::GlobalVariable>(addr->stripPointerCasts());
381 D.hasAttr<CUDASharedAttr>();
383 if (D.
getInit() && !isCudaSharedVar)
388 if (D.hasAttr<AnnotateAttr>())
391 if (
const SectionAttr *SA = D.getAttr<SectionAttr>())
392 var->setSection(SA->getName());
394 if (D.hasAttr<UsedAttr>())
402 llvm::Constant *castedAddr =
403 llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(var, expectedType);
404 if (var != castedAddr)
405 LocalDeclMap.find(&D)->second =
Address(castedAddr, alignment);
423 bool useEHCleanupForArray)
424 : addr(addr), type(type), destroyer(destroyer),
425 useEHCleanupForArray(useEHCleanupForArray) {}
430 bool useEHCleanupForArray;
434 bool useEHCleanupForArray =
435 flags.isForNormalCleanup() && this->useEHCleanupForArray;
442 DestroyNRVOVariable(
Address addr,
445 : Dtor(Dtor), NRVOFlag(NRVOFlag), Loc(addr) {}
453 bool NRVO = flags.isForNormalCleanup() && NRVOFlag;
455 llvm::BasicBlock *SkipDtorBB =
nullptr;
462 CGF.
Builder.CreateCondBr(DidNRVO, SkipDtorBB, RunDtorBB);
487 ExtendGCLifetime(
const VarDecl *var) : Var(*var) {}
501 llvm::Constant *CleanupFn;
505 CallCleanupFunction(llvm::Constant *CleanupFn,
const CGFunctionInfo *Info,
507 : CleanupFn(CleanupFn), FnInfo(*Info), Var(*Var) {}
522 QualType ArgTy = FnInfo.arg_begin()->type;
541 llvm_unreachable(
"present but none");
549 (var.hasAttr<ObjCPreciseLifetimeAttr>()
573 if (
const Expr *e = dyn_cast<Expr>(s)) {
576 s = e = e->IgnoreParenCasts();
578 if (
const DeclRefExpr *ref = dyn_cast<DeclRefExpr>(e))
579 return (ref->getDecl() == &var);
580 if (
const BlockExpr *be = dyn_cast<BlockExpr>(e)) {
581 const BlockDecl *block = be->getBlockDecl();
582 for (
const auto &
I : block->
captures()) {
583 if (
I.getVariable() == &var)
589 for (
const Stmt *SubStmt : s->children())
598 if (!decl)
return false;
599 if (!isa<VarDecl>(decl))
return false;
606 bool needsCast =
false;
613 case CK_BlockPointerToObjCPointerCast:
619 case CK_LValueToRValue: {
661 LValue lvalue,
bool capturedByInit) {
672 init = DIE->getExpr();
678 init = ewc->getSubExpr();
686 bool accessedByInit =
false;
688 accessedByInit = (capturedByInit ||
isAccessedBy(D, init));
689 if (accessedByInit) {
692 if (capturedByInit) {
701 llvm::Value *zero = llvm::ConstantPointerNull::get(ty);
717 llvm_unreachable(
"present but none");
776 llvm_unreachable(
"present but none");
805 if (isa<llvm::ConstantAggregateZero>(Init) ||
806 isa<llvm::ConstantPointerNull>(Init) ||
807 isa<llvm::UndefValue>(Init))
809 if (isa<llvm::ConstantInt>(Init) || isa<llvm::ConstantFP>(Init) ||
810 isa<llvm::ConstantVector>(Init) || isa<llvm::BlockAddress>(Init) ||
811 isa<llvm::ConstantExpr>(Init))
812 return Init->isNullValue() || NumStores--;
815 if (isa<llvm::ConstantArray>(Init) || isa<llvm::ConstantStruct>(Init)) {
816 for (
unsigned i = 0, e = Init->getNumOperands(); i != e; ++i) {
817 llvm::Constant *Elt = cast<llvm::Constant>(Init->getOperand(i));
824 if (llvm::ConstantDataSequential *CDS =
825 dyn_cast<llvm::ConstantDataSequential>(Init)) {
826 for (
unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
827 llvm::Constant *Elt = CDS->getElementAsConstant(i);
843 assert(!Init->isNullValue() && !isa<llvm::UndefValue>(Init) &&
844 "called emitStoresForInitAfterMemset for zero or undef value.");
846 if (isa<llvm::ConstantInt>(Init) || isa<llvm::ConstantFP>(Init) ||
847 isa<llvm::ConstantVector>(Init) || isa<llvm::BlockAddress>(Init) ||
848 isa<llvm::ConstantExpr>(Init)) {
853 if (llvm::ConstantDataSequential *CDS =
854 dyn_cast<llvm::ConstantDataSequential>(Init)) {
855 for (
unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
856 llvm::Constant *Elt = CDS->getElementAsConstant(i);
859 if (!Elt->isNullValue() && !isa<llvm::UndefValue>(Elt))
861 Elt, Builder.CreateConstGEP2_32(Init->getType(), Loc, 0, i),
862 isVolatile, Builder);
867 assert((isa<llvm::ConstantStruct>(Init) || isa<llvm::ConstantArray>(Init)) &&
868 "Unknown value type!");
870 for (
unsigned i = 0, e = Init->getNumOperands(); i != e; ++i) {
871 llvm::Constant *Elt = cast<llvm::Constant>(Init->getOperand(i));
874 if (!Elt->isNullValue() && !isa<llvm::UndefValue>(Elt))
876 Elt, Builder.CreateConstGEP2_32(Init->getType(), Loc, 0, i),
877 isVolatile, Builder);
886 uint64_t GlobalSize) {
888 if (isa<llvm::ConstantAggregateZero>(Init))
return true;
894 unsigned StoreBudget = 6;
895 uint64_t SizeLimit = 32;
897 return GlobalSize > SizeLimit &&
915 if (CGOpts.SanitizeAddressUseAfterScope)
924 return CGOpts.OptimizationLevel != 0;
939 C->setDoesNotThrow();
947 C->setDoesNotThrow();
958 bool isByRef = D.hasAttr<BlocksAttr>();
959 emission.IsByRef = isByRef;
995 assert(emission.wasEmittedAsGlobal());
1000 emission.IsConstantAggregate =
true;
1013 if (!cast<CXXRecordDecl>(RecordTy->getDecl())->hasTrivialDestructor()) {
1033 allocaTy = byrefInfo.Type;
1034 allocaAlignment = byrefInfo.ByrefAlignment;
1037 allocaAlignment = alignment;
1049 bool IsMSCatchParam =
1056 emission.SizeForLifetimeMarkers =
1065 if (!DidCallStackSave) {
1074 DidCallStackSave =
true;
1083 std::tie(elementCount, elementType) =
getVLASize(Ty);
1088 llvm::AllocaInst *vla =
Builder.CreateAlloca(llvmTy, elementCount,
"vla");
1091 address =
Address(vla, alignment);
1094 setAddrOfLocalVar(&D, address);
1095 emission.Addr = address;
1102 DI->setLocation(D.getLocation());
1107 if (D.hasAttr<AnnotateAttr>())
1120 if (
const BlockExpr *be = dyn_cast<BlockExpr>(e)) {
1121 const BlockDecl *block = be->getBlockDecl();
1122 for (
const auto &
I : block->
captures()) {
1123 if (
I.getVariable() == &var)
1131 if (
const StmtExpr *SE = dyn_cast<StmtExpr>(e)) {
1133 for (
const auto *BI : CS->
body())
1134 if (
const auto *
E = dyn_cast<Expr>(BI)) {
1138 else if (
const auto *DS = dyn_cast<DeclStmt>(BI)) {
1140 for (
const auto *
I : DS->decls()) {
1141 if (
const auto *VD = dyn_cast<VarDecl>((
I))) {
1142 const Expr *Init = VD->getInit();
1155 for (
const Stmt *SubStmt : e->children())
1170 if (Constructor->isTrivial() &&
1171 Constructor->isDefaultConstructor() &&
1172 !Construct->requiresZeroInitialization())
1179 assert(emission.Variable &&
"emission was not valid!");
1182 if (emission.wasEmittedAsGlobal())
return;
1184 const VarDecl &D = *emission.Variable;
1199 if (emission.IsByRef)
1208 bool capturedByInit = emission.IsByRef &&
isCapturedBy(D, Init);
1213 llvm::Constant *constant =
nullptr;
1214 if (emission.IsConstantAggregate || D.
isConstexpr()) {
1215 assert(!capturedByInit &&
"constant init contains a capturing block?");
1225 if (!emission.IsConstantAggregate) {
1234 bool isVolatile = type.isVolatileQualified();
1238 getContext().getTypeSizeInChars(type).getQuantity());
1251 if (!constant->isNullValue() && !isa<llvm::UndefValue>(constant)) {
1260 llvm::GlobalVariable *GV =
1261 new llvm::GlobalVariable(
CGM.
getModule(), constant->getType(),
true,
1262 llvm::GlobalValue::PrivateLinkage,
1265 GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
1288 LValue lvalue,
bool capturedByInit) {
1321 llvm_unreachable(
"bad evaluation kind");
1334 const VarDecl *var = emission.Variable;
1342 llvm_unreachable(
"no cleanup for trivially-destructible variable");
1347 if (emission.NRVOFlag) {
1350 EHStack.pushCleanup<DestroyNRVOVariable>(cleanupKind, addr,
1351 dtor, emission.NRVOFlag);
1364 if (!var->hasAttr<ObjCPreciseLifetimeAttr>())
1377 bool useEHCleanup = (cleanupKind &
EHCleanup);
1378 EHStack.pushCleanup<DestroyObject>(cleanupKind, addr,
type, destroyer,
1383 assert(emission.Variable &&
"emission was not valid!");
1386 if (emission.wasEmittedAsGlobal())
return;
1392 const VarDecl &D = *emission.Variable;
1407 D.hasAttr<ObjCPreciseLifetimeAttr>()) {
1412 if (
const CleanupAttr *CA = D.getAttr<CleanupAttr>()) {
1416 assert(F &&
"Could not find function!");
1424 if (emission.IsByRef)
1439 llvm_unreachable(
"Unknown DestructionKind");
1446 assert(dtorKind &&
"cannot push destructor for trivial type");
1456 assert(dtorKind &&
"cannot push destructor for trivial type");
1465 bool useEHCleanupForArray) {
1466 pushFullExprCleanup<DestroyObject>(cleanupKind, addr,
type,
1467 destroyer, useEHCleanupForArray);
1471 EHStack.pushCleanup<CallStackRestore>(
Kind, SPMem);
1476 Destroyer *destroyer,
bool useEHCleanupForArray) {
1478 "performing lifetime extension from within conditional");
1484 EHStack.pushCleanup<DestroyObject>(
1486 destroyer, useEHCleanupForArray);
1490 pushCleanupAfterFullExpr<DestroyObject>(
1491 cleanupKind, addr,
type, destroyer, useEHCleanupForArray);
1506 Destroyer *destroyer,
1507 bool useEHCleanupForArray) {
1510 return destroyer(*
this, addr, type);
1519 bool checkZeroLength =
true;
1522 if (llvm::ConstantInt *constLength = dyn_cast<llvm::ConstantInt>(length)) {
1524 if (constLength->isZero())
return;
1525 checkZeroLength =
false;
1531 checkZeroLength, useEHCleanupForArray);
1548 Destroyer *destroyer,
1549 bool checkZeroLength,
1550 bool useEHCleanup) {
1558 if (checkZeroLength) {
1560 "arraydestroy.isempty");
1561 Builder.CreateCondBr(isEmpty, doneBB, bodyBB);
1565 llvm::BasicBlock *entryBB =
Builder.GetInsertBlock();
1567 llvm::PHINode *elementPast =
1568 Builder.CreatePHI(begin->getType(), 2,
"arraydestroy.elementPast");
1569 elementPast->addIncoming(end, entryBB);
1574 "arraydestroy.element");
1581 destroyer(*
this,
Address(element, elementAlign), elementType);
1588 Builder.CreateCondBr(done, doneBB, bodyBB);
1589 elementPast->addIncoming(element,
Builder.GetInsertBlock());
1602 unsigned arrayDepth = 0;
1605 if (!isa<VariableArrayType>(arrayType))
1607 type = arrayType->getElementType();
1614 begin = CGF.
Builder.CreateInBoundsGEP(begin, gepIndices,
"pad.arraybegin");
1615 end = CGF.
Builder.CreateInBoundsGEP(end, gepIndices,
"pad.arrayend");
1639 : ArrayBegin(arrayBegin), ArrayEnd(arrayEnd),
1640 ElementType(elementType), Destroyer(destroyer),
1641 ElementAlign(elementAlign) {}
1645 ElementType, ElementAlign, Destroyer);
1659 IrregularPartialArrayDestroy(
llvm::Value *arrayBegin,
1664 : ArrayBegin(arrayBegin), ArrayEndPointer(arrayEndPointer),
1665 ElementType(elementType), Destroyer(destroyer),
1666 ElementAlign(elementAlign) {}
1671 ElementType, ElementAlign, Destroyer);
1686 Destroyer *destroyer) {
1687 pushFullExprCleanup<IrregularPartialArrayDestroy>(
EHCleanup,
1688 arrayBegin, arrayEndPointer,
1689 elementType, elementAlign,
1703 Destroyer *destroyer) {
1704 pushFullExprCleanup<RegularPartialArrayDestroy>(
EHCleanup,
1705 arrayBegin, arrayEnd,
1706 elementType, elementAlign,
1712 if (LifetimeStartFn)
return LifetimeStartFn;
1713 LifetimeStartFn = llvm::Intrinsic::getDeclaration(&
getModule(),
1714 llvm::Intrinsic::lifetime_start);
1715 return LifetimeStartFn;
1720 if (LifetimeEndFn)
return LifetimeEndFn;
1721 LifetimeEndFn = llvm::Intrinsic::getDeclaration(&
getModule(),
1722 llvm::Intrinsic::lifetime_end);
1723 return LifetimeEndFn;
1734 : Param(param), Precise(precise) {}
1750 assert((isa<ParmVarDecl>(D) || isa<ImplicitParamDecl>(D)) &&
1751 "Invalid argument to EmitParmDecl");
1758 if (
auto IPD = dyn_cast<ImplicitParamDecl>(&D)) {
1768 bool DoStore =
false;
1774 unsigned AS = DeclPtr.
getType()->getAddressSpace();
1776 if (DeclPtr.
getType() != IRTy)
1805 bool isConsumed = D.hasAttr<NSConsumedAttr>();
1860 setAddrOfLocalVar(&D, DeclPtr);
1870 if (D.hasAttr<AnnotateAttr>())
1876 if (!LangOpts.OpenMP || (!LangOpts.EmitAllDecls && !D->isUsed()))
unsigned getAddressSpace() const
Return the address space of this type.
CGOpenCLRuntime & getOpenCLRuntime()
Return a reference to the configured OpenCL runtime.
ReturnValueSlot - Contains the address where the return value of a function can be stored...
Defines the clang::ASTContext interface.
llvm::StoreInst * CreateDefaultAlignedStore(llvm::Value *Val, llvm::Value *Addr, bool IsVolatile=false)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
llvm::Value * EmitARCRetainAutoreleaseScalarExpr(const Expr *expr)
Destroyer * getDestroyer(QualType::DestructionKind destructionKind)
A (possibly-)qualified type.
ArrayRef< Capture > captures() const
bool isPODType(const ASTContext &Context) const
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
void EmitExtendGCLifetime(llvm::Value *object)
EmitExtendGCLifetime - Given a pointer to an Objective-C object, make sure it survives garbage collec...
llvm::Value * getPointer() const
CodeGenTypes & getTypes()
llvm::Type * ConvertTypeForMem(QualType T)
void EmitVarDecl(const VarDecl &D)
EmitVarDecl - Emit a local variable declaration.
CharUnits getDeclAlign(const Decl *D, bool ForAlignof=false) const
Return a conservative estimate of the alignment of the specified decl D.
Address getAllocatedAddress() const
Returns the raw, allocated address, which is not necessarily the address of the object itself...
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after...
llvm::Module & getModule() const
static AggValueSlot forLValue(const LValue &LV, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, IsZeroed_t isZeroed=IsNotZeroed)
bool isInConditionalBranch() const
isInConditionalBranch - Return true if we're currently emitting one branch or the other of a conditio...
const TargetInfo & getTarget() const
SanitizerSet Sanitize
Set of enabled sanitizers.
llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp")
CreateTempAlloca - This creates a alloca and inserts it into the entry block.
Defines the SourceManager interface.
static bool canEmitInitWithFewStoresAfterMemset(llvm::Constant *Init, unsigned &NumStores)
canEmitInitWithFewStoresAfterMemset - Decide whether we can emit the non-zero parts of the specified ...
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
bool isRecordType() const
void emitAutoVarTypeCleanup(const AutoVarEmission &emission, QualType::DestructionKind dtorKind)
Enter a destroy cleanup for the given local variable.
QualType getUnderlyingType() const
Address getAddress() const
const Decl * CurCodeDecl
CurCodeDecl - This is the inner-most code context, which includes blocks.
bool hasNonTrivialDestructor() const
Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)
void EmitAutoVarDecl(const VarDecl &D)
EmitAutoVarDecl - Emit an auto variable declaration.
const llvm::DataLayout & getDataLayout() const
static Destroyer destroyARCStrongPrecise
void pushLifetimeExtendedDestroy(CleanupKind kind, Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
void EmitStoreThroughLValue(RValue Src, LValue Dst, bool isInit=false)
EmitStoreThroughLValue - Store the specified rvalue into the specified lvalue, where both are guarant...
Represents an array type, per C99 6.7.5.2 - Array Declarators.
const Expr * getInit() const
Represents a call to a C++ constructor.
void EmitARCCopyWeak(Address dst, Address src)
void @objc_copyWeak(i8** dest, i8** src) Disregards the current value in dest.
const LangOptions & getLangOpts() const
llvm::Value * EmitARCRetainNonBlock(llvm::Value *value)
Retain the given object, with normal retain semantics.
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64
Represents a C++ constructor within a class.
static Destroyer destroyARCWeak
VarDecl - An instance of this class is created to represent a variable declaration or definition...
llvm::Type * getElementType() const
Return the type of the values stored in this address.
bool areArgsDestroyedLeftToRightInCallee() const
Are arguments to a call destroyed left to right in the callee? This is a fundamental language change...
ObjCLifetime getObjCLifetime() const
This class gathers all debug information during compilation and is responsible for emitting to llvm g...
ObjCMethodDecl - Represents an instance or class method declaration.
void EmitVariablyModifiedType(QualType Ty)
EmitVLASize - Capture all the sizes for the VLA expressions in the given variably-modified type and s...
llvm::Type * ConvertTypeForMem(QualType T)
ConvertTypeForMem - Convert type T into a llvm::Type.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
The collection of all-type qualifiers we support.
void emitDestroy(Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
emitDestroy - Immediately perform the destruction of the given object.
void emitByrefStructureInit(const AutoVarEmission &emission)
Initialize the structural components of a __block variable, i.e.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
CGDebugInfo * getDebugInfo()
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
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...
llvm::IntegerType * Int64Ty
RValue EmitReferenceBindingToExpr(const Expr *E)
Emits a reference binding to the passed in expression.
bool isReferenceType() const
llvm::IntegerType * SizeTy
static bool shouldEmitLifetimeMarkers(const CodeGenOptions &CGOpts, const LangOptions &LangOpts)
shouldEmitLifetimeMarkers - Decide whether we need emit the life-time markers.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
void pushEHDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)
pushEHDestroy - Push the standard destructor for the given type as an EH-only cleanup.
Denotes a cleanup that should run when a scope is exited using exceptional control flow (a throw stat...
RValue EmitCall(const CGFunctionInfo &FnInfo, llvm::Value *Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, CGCalleeInfo CalleeInfo=CGCalleeInfo(), llvm::Instruction **callOrInvoke=nullptr)
EmitCall - Generate a call of the given function, expecting the given result type, and using the given argument list which specifies both the LLVM arguments and the types they were derived from.
CleanupKind getCleanupKind(QualType::DestructionKind kind)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
const Decl * getDecl() const
bool hasExternalStorage() const
Returns true if a variable has extern or private_extern storage.
void setNonGC(bool Value)
llvm::Constant * getLLVMLifetimeStartFn()
Lazily declare the .lifetime.start intrinsic.
llvm::Value * EmitARCStoreStrongCall(Address addr, llvm::Value *value, bool resultIgnored)
Store into a strong object.
void pushRegularPartialArrayCleanup(llvm::Value *arrayBegin, llvm::Value *arrayEnd, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)
pushRegularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the gi...
static bool hasScalarEvaluationKind(QualType T)
static void drillIntoBlockVariable(CodeGenFunction &CGF, LValue &lvalue, const VarDecl *var)
Address CreateElementBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Cast the element type of the given address to a different type, preserving information like the align...
CharUnits - This is an opaque type for sizes expressed in character units.
static bool shouldUseMemSetPlusStoresToInitialize(llvm::Constant *Init, uint64_t GlobalSize)
shouldUseMemSetPlusStoresToInitialize - Decide whether we should use memset plus some stores to initi...
Qualifiers::ObjCLifetime getObjCLifetime() const
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
void EmitOMPDeclareReduction(const OMPDeclareReductionDecl *D, CodeGenFunction *CGF=nullptr)
Emit a code for declare reduction construct.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl)
Emit information about a global variable.
void setStaticLocalDeclAddress(const VarDecl *D, llvm::Constant *C)
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
bool needsEHCleanup(QualType::DestructionKind kind)
Determines whether an EH cleanup is required to destroy a type with the given destruction kind...
llvm::Value * EmitARCUnsafeUnretainedScalarExpr(const Expr *expr)
EmitARCUnsafeUnretainedScalarExpr - Semantically equivalent to immediately releasing the resut of Emi...
llvm::CallInst * CreateMemCpy(Address Dest, Address Src, llvm::Value *Size, bool IsVolatile=false)
std::string getNameAsString() const
getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kin...
Expr * IgnoreParenCasts() LLVM_READONLY
IgnoreParenCasts - Ignore parentheses and casts.
Scope - A scope is a transient data structure that is used while parsing the program.
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
llvm::Value * EmitARCRetainScalarExpr(const Expr *expr)
EmitARCRetainScalarExpr - Semantically equivalent to EmitARCRetainObject(e->getType(), EmitScalarExpr(e)), but making a best-effort attempt to peephole expressions that naturally produce retained objects.
Denotes a cleanup that should run when a scope is exited using normal control flow (falling off the e...
void EmitAtomicInit(Expr *E, LValue lvalue)
llvm::Constant * GetAddrOfGlobal(GlobalDecl GD, bool IsForDefinition=false)
bool isStaticLocal() const
isStaticLocal - Returns true if a variable with function scope is a static local variable.
static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts=false)
ContainsLabel - Return true if the statement contains a label in it.
void setGlobalVisibility(llvm::GlobalValue *GV, const NamedDecl *D) const
Set the visibility for the given LLVM GlobalValue.
detail::InMemoryDirectory::const_iterator I
This object can be modified without requiring retains or releases.
bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor)
isTypeConstant - Determine whether an object of this type can be emitted as a constant.
LValue MakeAddrLValue(Address Addr, QualType T, AlignmentSource AlignSource=AlignmentSource::Type)
static CharUnits One()
One - Construct a CharUnits quantity of one.
CompoundStmt - This represents a group of statements like { stmt stmt }.
std::pair< llvm::Value *, llvm::Value * > ComplexPairTy
AutoVarEmission EmitAutoVarAlloca(const VarDecl &var)
EmitAutoVarAlloca - Emit the alloca and debug information for a local variable.
const CodeGen::CGBlockInfo * BlockInfo
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
RValue - This trivial value class is used to represent the result of an expression that is evaluated...
void setAddress(Address address)
CleanupKind getARCCleanupKind()
Retrieves the default cleanup kind for an ARC cleanup.
llvm::Value * getSizeForLifetimeMarkers() const
StringRef getBlockMangledName(GlobalDecl GD, const BlockDecl *BD)
std::vector< bool > & Stack
llvm::Value * EmitARCStoreWeak(Address addr, llvm::Value *value, bool ignored)
i8* @objc_storeWeak(i8** addr, i8* value) Returns value.
void EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)
Emit code in this function to perform a guarded variable initialization.
static TypeEvaluationKind getEvaluationKind(QualType T)
hasAggregateLLVMType - Return true if the specified AST type will map into an aggregate LLVM type or ...
llvm::Value * getPointer() const
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
void EmitARCMoveWeak(Address dst, Address src)
void @objc_moveWeak(i8** dest, i8** src) Disregards the current value in dest.
Emit only debug info necessary for generating line number tables (-gline-tables-only).
void EmitAutoVarInit(const AutoVarEmission &emission)
void AddGlobalAnnotations(const ValueDecl *D, llvm::GlobalValue *GV)
Add global annotations that are set on D, for the global GV.
Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited...
void EmitStoreOfScalar(llvm::Value *Value, Address Addr, bool Volatile, QualType Ty, AlignmentSource AlignSource=AlignmentSource::Type, llvm::MDNode *TBAAInfo=nullptr, bool isInit=false, QualType TBAABaseTy=QualType(), uint64_t TBAAOffset=0, bool isNontemporal=false)
EmitStoreOfScalar - Store a scalar value to an address, taking care to appropriately convert from the...
bool isAtomicType() const
virtual void EmitWorkGroupLocalVarDecl(CodeGenFunction &CGF, const VarDecl &D)
Emit the IR required for a work-group-local variable declaration, and add an entry to CGF's LocalDecl...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a C++ destructor within a class.
ASTContext & getContext() const
llvm::Value * getAnyValue() const
ImplicitParamDecl * getSelfDecl() const
void add(RValue rvalue, QualType type, bool needscopy=false)
llvm::GlobalValue::LinkageTypes getLLVMLinkageVarDefinition(const VarDecl *VD, bool IsConstant)
Returns LLVM linkage for a declarator.
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
bool isExternallyVisible() const
llvm::CallInst * CreateMemSet(Address Dest, llvm::Value *Value, llvm::Value *Size, bool IsVolatile=false)
llvm::Function * getIntrinsic(unsigned IID, ArrayRef< llvm::Type * > Tys=None)
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...
static bool hasNontrivialDestruction(QualType T)
hasNontrivialDestruction - Determine whether a type's destruction is non-trivial. ...
float __ovld __cnfn length(float p)
Return the length of vector p, i.e., sqrt(p.x2 + p.y 2 + ...)
static bool isCapturedBy(const VarDecl &var, const Expr *e)
Determines whether the given __block variable is potentially captured by the given expression...
GlobalDecl - represents a global declaration.
The l-value was considered opaque, so the alignment was determined from a type.
void setBlockContextParameter(const ImplicitParamDecl *D, unsigned argNum, llvm::Value *ptr)
void enterByrefCleanup(const AutoVarEmission &emission)
Enter a cleanup to destroy a __block variable.
llvm::Constant * getOrCreateStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
bool HaveInsertPoint() const
HaveInsertPoint - True if an insertion point is defined.
There is no lifetime qualification on this type.
Address CreateBitCast(Address Addr, llvm::Type *Ty, const llvm::Twine &Name="")
Assigning into this object requires the old value to be released and the new value to be retained...
llvm::GlobalVariable * AddInitializerToStaticVarDecl(const VarDecl &D, llvm::GlobalVariable *GV)
AddInitializerToStaticVarDecl - Add the initializer for 'D' to the global variable that has already b...
ASTContext & getContext() const
void pushDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)
pushDestroy - Push the standard destructor for the given type as at least a normal cleanup...
Encodes a location in the source.
CharUnits getPointerAlign() const
void EnsureInsertPoint()
EnsureInsertPoint - Ensure that an insertion point is defined so that emitted IR has a place to go...
void EmitARCRelease(llvm::Value *value, ARCPreciseLifetime_t precise)
Release the given object.
LValue EmitDeclRefLValue(const DeclRefExpr *E)
This represents '#pragma omp declare reduction ...' directive.
bool isConstant(const ASTContext &Ctx) const
static std::string getStaticDeclName(CodeGenModule &CGM, const VarDecl &D)
llvm::Value * EmitLoadOfScalar(Address Addr, bool Volatile, QualType Ty, SourceLocation Loc, AlignmentSource AlignSource=AlignmentSource::Type, llvm::MDNode *TBAAInfo=nullptr, QualType TBAABaseTy=QualType(), uint64_t TBAAOffset=0, bool isNontemporal=false)
EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the...
bool isConstantSizeType() const
Return true if this is not a variable sized type, according to the rules of C99 6.7.5p3.
bool isLocalVarDecl() const
isLocalVarDecl - Returns true for local variable declarations other than parameters.
static void emitPartialArrayDestroy(CodeGenFunction &CGF, llvm::Value *begin, llvm::Value *end, QualType type, CharUnits elementAlign, CodeGenFunction::Destroyer *destroyer)
Perform partial array destruction as if in an EH cleanup.
const BlockByrefInfo & getBlockByrefInfo(const VarDecl *var)
BuildByrefInfo - This routine changes a __block variable declared as T x into:
llvm::Value * EmitLifetimeStart(uint64_t Size, llvm::Value *Addr)
Emit a lifetime.begin marker if some criteria are satisfied.
static bool isAccessedBy(const VarDecl &var, const Stmt *s)
This file defines OpenMP nodes for declarative directives.
bool isTrivialInitializer(const Expr *Init)
Determine whether the given initializer is trivial in the sense that it requires no code to be genera...
CharUnits alignmentOfArrayElement(CharUnits elementSize) const
Given that this is the alignment of the first element of an array, return the minimum alignment of an...
const CodeGenOptions & getCodeGenOpts() const
const Type * getBaseElementTypeUnsafe() const
Get the base element type of this type, potentially discarding type qualifiers.
const LangOptions & getLangOpts() const
static void EmitAutoVarWithLifetime(CodeGenFunction &CGF, const VarDecl &var, Address addr, Qualifiers::ObjCLifetime lifetime)
EmitAutoVarWithLifetime - Does the setup required for an automatic variable with lifetime.
void EmitParmDecl(const VarDecl &D, ParamValue Arg, unsigned ArgNo)
EmitParmDecl - Emit a ParmVarDecl or an ImplicitParamDecl.
Assigning into this object requires a lifetime extension.
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
llvm::Value * EmitARCRetain(QualType type, llvm::Value *value)
Produce the code to do a retain.
unsigned TypeAlias
Whether this template specialization type is a substituted type alias.
llvm::Constant * getLLVMLifetimeEndFn()
Lazily declare the .lifetime.end intrinsic.
void enterFullExpression(const ExprWithCleanups *E)
void EmitDecl(const Decl &D)
EmitDecl - Emit a declaration.
static Destroyer destroyARCStrongImprecise
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type, returning the result.
void addUsedGlobal(llvm::GlobalValue *GV)
Add a global to a list to be added to the llvm.used metadata.
Base class for declarations which introduce a typedef-name.
void ErrorUnsupported(const Stmt *S, const char *Type)
Print out an error that codegen doesn't support the specified stmt yet.
CGFunctionInfo - Class to encapsulate the information about a function definition.
CharUnits getAlignment() const
Return the alignment of this pointer.
This class organizes the cross-function state that is used while generating LLVM code.
CGOpenMPRuntime & getOpenMPRuntime()
Return a reference to the configured OpenMP runtime.
static ApplyDebugLocation CreateDefaultArtificial(CodeGenFunction &CGF, SourceLocation TemporaryLocation)
Apply TemporaryLocation if it is valid.
Address getObjectAddress(CodeGenFunction &CGF) const
Returns the address of the object within this declaration.
void EmitCXXDestructorCall(const CXXDestructorDecl *D, CXXDtorType Type, bool ForVirtualBase, bool Delegating, Address This)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
llvm::Value * getDirectValue() const
Address CreateMemTemp(QualType T, const Twine &Name="tmp")
CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignment...
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const CGFunctionInfo & arrangeFunctionDeclaration(const FunctionDecl *FD)
Free functions are functions that are compatible with an ordinary C function pointer type...
void setTLSMode(llvm::GlobalValue *GV, const VarDecl &D) const
Set the TLS mode for the given LLVM GlobalValue for the thread-local variable declaration D...
llvm::LoadInst * CreateLoad(Address Addr, const llvm::Twine &Name="")
llvm::IntegerType * IntPtrTy
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
Address getIndirectAddress() const
llvm::Constant * EmitNullConstant(QualType T)
Return the result of value-initializing the given type, i.e.
detail::InMemoryDirectory::const_iterator E
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
unsigned GetGlobalVarAddressSpace(const VarDecl *D, unsigned AddrSpace)
Return the address space of the underlying global variable for D, as determined by its declaration...
static bool tryEmitARCCopyWeakInit(CodeGenFunction &CGF, const LValue &destLV, const Expr *init)
void EmitAggExpr(const Expr *E, AggValueSlot AS)
EmitAggExpr - Emit the computation of the specified expression of aggregate type. ...
bool isConstantInitializer(ASTContext &Ctx, bool ForRef, const Expr **Culprit=nullptr) const
isConstantInitializer - Returns true if this expression can be emitted to IR as a constant...
void EmitAutoVarCleanups(const AutoVarEmission &emission)
llvm::PointerType * getType() const
Return the type of the pointer value.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
const T * getAs() const
Member-template getAs<specific type>'.
void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit)
EmitStoreOfComplex - Store a complex number into the specified l-value.
llvm::PointerType * Int8PtrTy
llvm::LoadInst * CreateFlagLoad(llvm::Value *Addr, const llvm::Twine &Name="")
Emit a load from an i1 flag variable.
bool has(SanitizerMask K) const
Check if a certain (single) sanitizer is enabled.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
void EmitScalarInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
llvm::Value * EmitARCRetainAutorelease(QualType type, llvm::Value *value)
Do a fused retain/autorelease of the given object.
StringRef getMangledName(GlobalDecl GD)
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
void EmitARCInitWeak(Address addr, llvm::Value *value)
i8* @objc_initWeak(i8** addr, i8* value) Returns value.
ARCPreciseLifetime_t
Does an ARC strong l-value have precise lifetime?
ComplexPairTy EmitComplexExpr(const Expr *E, bool IgnoreReal=false, bool IgnoreImag=false)
EmitComplexExpr - Emit the computation of the specified expression of complex type, returning the result.
llvm::Constant * EmitConstantInit(const VarDecl &D, CodeGenFunction *CGF=nullptr)
Try to emit the initializer for the given declaration as a constant; returns 0 if the expression cann...
A use of a default initializer in a constructor or in aggregate initialization.
Reading or writing from this object requires a barrier call.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
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...
static void emitStoresForInitAfterMemset(llvm::Constant *Init, llvm::Value *Loc, bool isVolatile, CGBuilderTy &Builder)
emitStoresForInitAfterMemset - For inits that canEmitInitWithFewStoresAfterMemset returned true for...
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
Represents a C++ struct/union/class.
BoundNodesTreeBuilder *const Builder
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
bool isObjCObjectPointerType() const
llvm::Type * ConvertType(QualType T)
static Destroyer destroyCXXObject
LValue EmitLValue(const Expr *E)
EmitLValue - Emit code to compute a designator that specifies the location of the expression...
Address ReturnValue
ReturnValue - The temporary alloca to hold the return value.
void pushStackRestore(CleanupKind kind, Address SPMem)
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
std::pair< llvm::Value *, QualType > getVLASize(const VariableArrayType *vla)
getVLASize - Returns an LLVM value that corresponds to the size, in non-variably-sized elements...
Defines the clang::TargetInfo interface.
void setLocation(SourceLocation Loc)
Update the current source location.
bool useLifetimeMarkers() const
unsigned getTargetAddressSpace(QualType T) const
A reference to a declared variable, function, enum, etc.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
static RValue get(llvm::Value *V)
void EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr)
An l-value expression is a reference to an object with independent storage.
LValue - This represents an lvalue references.
Information for lazily generating a cleanup.
void EmitVarAnnotations(const VarDecl *D, llvm::Value *V)
Emit local annotations for the local variable V, declared by D.
SanitizerMetadata * getSanitizerMetadata()
bool CurFuncIsThunk
In C++, whether we are code generating a thunk.
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...
llvm::Constant * GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty=nullptr, bool ForVTable=false, bool DontDefer=false, bool IsForDefinition=false)
Return the address of the given function.
CallArgList - Type for representing both the value and type of arguments in a call.
void PopCleanupBlock(bool FallThroughIsBranchThrough=false)
PopCleanupBlock - Will pop the cleanup entry on the stack and process all branch fixups.
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
Address emitBlockByrefAddress(Address baseAddr, const VarDecl *V, bool followForward=true)
BuildBlockByrefAddress - Computes the location of the data in a variable which is declared as __block...
void pushIrregularPartialArrayCleanup(llvm::Value *arrayBegin, Address arrayEndPointer, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)
pushIrregularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the ...
bool supportsCOMDAT() const
bool hasLocalStorage() const
hasLocalStorage - Returns true if a variable with function scope is a non-static local variable...
Expr * IgnoreParens() LLVM_READONLY
IgnoreParens - Ignore parentheses.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty)