28 #include "llvm/IR/DataLayout.h"
29 #include "llvm/IR/GlobalVariable.h"
30 #include "llvm/IR/Intrinsics.h"
31 #include "llvm/IR/Type.h"
32 using namespace clang;
33 using namespace CodeGen;
38 case Decl::BuiltinTemplate:
39 case Decl::TranslationUnit:
40 case Decl::ExternCContext:
42 case Decl::UnresolvedUsingTypename:
43 case Decl::ClassTemplateSpecialization:
44 case Decl::ClassTemplatePartialSpecialization:
45 case Decl::VarTemplateSpecialization:
46 case Decl::VarTemplatePartialSpecialization:
47 case Decl::TemplateTypeParm:
48 case Decl::UnresolvedUsingValue:
49 case Decl::NonTypeTemplateParm:
51 case Decl::CXXConstructor:
52 case Decl::CXXDestructor:
53 case Decl::CXXConversion:
55 case Decl::MSProperty:
56 case Decl::IndirectField:
58 case Decl::ObjCAtDefsField:
60 case Decl::ImplicitParam:
61 case Decl::ClassTemplate:
62 case Decl::VarTemplate:
63 case Decl::FunctionTemplate:
64 case Decl::TypeAliasTemplate:
65 case Decl::TemplateTemplateParm:
66 case Decl::ObjCMethod:
67 case Decl::ObjCCategory:
68 case Decl::ObjCProtocol:
69 case Decl::ObjCInterface:
70 case Decl::ObjCCategoryImpl:
71 case Decl::ObjCImplementation:
72 case Decl::ObjCProperty:
73 case Decl::ObjCCompatibleAlias:
74 case Decl::AccessSpec:
75 case Decl::LinkageSpec:
76 case Decl::ObjCPropertyImpl:
77 case Decl::FileScopeAsm:
79 case Decl::FriendTemplate:
82 case Decl::ClassScopeFunctionSpecialization:
83 case Decl::UsingShadow:
84 case Decl::ObjCTypeParam:
85 llvm_unreachable(
"Declaration should not be in declstmts!");
89 case Decl::EnumConstant:
91 case Decl::StaticAssert:
94 case Decl::OMPThreadPrivate:
99 case Decl::NamespaceAlias:
101 DI->EmitNamespaceAlias(cast<NamespaceAliasDecl>(D));
105 DI->EmitUsingDecl(cast<UsingDecl>(D));
107 case Decl::UsingDirective:
109 DI->EmitUsingDirective(cast<UsingDirectiveDecl>(D));
112 const VarDecl &VD = cast<VarDecl>(D);
114 "Should not see file-scope variables inside a function!");
123 if (Ty->isVariablyModifiedType())
133 llvm::GlobalValue::LinkageTypes
Linkage =
160 std::string ContextName;
162 if (
auto *CD = dyn_cast<CapturedDecl>(DC))
163 DC = cast<DeclContext>(CD->getNonClosureContext());
164 if (
const auto *FD = dyn_cast<FunctionDecl>(DC))
166 else if (
const auto *BD = dyn_cast<BlockDecl>(DC))
168 else if (
const auto *OMD = dyn_cast<ObjCMethodDecl>(DC))
169 ContextName = OMD->getSelector().getAsString();
171 llvm_unreachable(
"Unknown context for static var decl");
183 if (llvm::Constant *ExistingGV = StaticLocalDeclMap[&D])
191 if (D.hasAttr<AsmLabelAttr>())
201 llvm::Constant *Init =
nullptr;
205 Init = llvm::UndefValue::get(LTy);
207 llvm::GlobalVariable *GV =
208 new llvm::GlobalVariable(
getModule(), LTy,
211 llvm::GlobalVariable::NotThreadLocal,
213 GV->setAlignment(
getContext().getDeclAlign(&D).getQuantity());
217 GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
222 if (D.isExternallyVisible()) {
223 if (D.hasAttr<DLLImportAttr>())
224 GV->setDLLStorageClass(llvm::GlobalVariable::DLLImportStorageClass);
225 else if (D.hasAttr<DLLExportAttr>())
226 GV->setDLLStorageClass(llvm::GlobalVariable::DLLExportStorageClass);
231 llvm::Constant *Addr = GV;
232 if (AddrSpace != ExpectedAddrSpace) {
233 llvm::PointerType *PTy = llvm::PointerType::get(LTy, ExpectedAddrSpace);
234 Addr = llvm::ConstantExpr::getAddrSpaceCast(GV, PTy);
241 const Decl *DC = cast<Decl>(D.getDeclContext());
245 if (isa<BlockDecl>(DC) || isa<CapturedDecl>(DC)) {
253 if (
const auto *CD = dyn_cast<CXXConstructorDecl>(DC))
255 else if (
const auto *DD = dyn_cast<CXXDestructorDecl>(DC))
257 else if (
const auto *FD = dyn_cast<FunctionDecl>(DC))
262 assert(isa<ObjCMethodDecl>(DC) &&
"unexpected parent code decl");
282 llvm::GlobalVariable *
284 llvm::GlobalVariable *GV) {
292 else if (
Builder.GetInsertBlock()) {
295 GV->setConstant(
false);
306 if (GV->getType()->getElementType() != Init->getType()) {
307 llvm::GlobalVariable *OldGV = GV;
309 GV =
new llvm::GlobalVariable(
CGM.
getModule(), Init->getType(),
311 OldGV->getLinkage(), Init,
"",
313 OldGV->getThreadLocalMode(),
315 GV->setVisibility(OldGV->getVisibility());
316 GV->setComdat(OldGV->getComdat());
322 llvm::Constant *NewPtrForOldDecl =
323 llvm::ConstantExpr::getBitCast(GV, OldGV->getType());
324 OldGV->replaceAllUsesWith(NewPtrForOldDecl);
327 OldGV->eraseFromParent();
331 GV->setInitializer(Init);
344 llvm::GlobalValue::LinkageTypes
Linkage) {
353 setAddrOfLocalVar(&D,
Address(addr, alignment));
364 llvm::GlobalVariable *var =
365 cast<llvm::GlobalVariable>(addr->stripPointerCasts());
375 if (
const SectionAttr *SA = D.
getAttr<SectionAttr>())
376 var->setSection(SA->getName());
386 llvm::Constant *castedAddr =
387 llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(var, expectedType);
388 if (var != castedAddr)
389 LocalDeclMap.find(&D)->second =
Address(castedAddr, alignment);
407 bool useEHCleanupForArray)
408 : addr(addr), type(type), destroyer(destroyer),
409 useEHCleanupForArray(useEHCleanupForArray) {}
414 bool useEHCleanupForArray;
418 bool useEHCleanupForArray =
419 flags.isForNormalCleanup() && this->useEHCleanupForArray;
426 DestroyNRVOVariable(
Address addr,
429 : Dtor(Dtor), NRVOFlag(NRVOFlag), Loc(addr) {}
437 bool NRVO = flags.isForNormalCleanup() && NRVOFlag;
439 llvm::BasicBlock *SkipDtorBB =
nullptr;
446 CGF.
Builder.CreateCondBr(DidNRVO, SkipDtorBB, RunDtorBB);
471 ExtendGCLifetime(
const VarDecl *var) : Var(*var) {}
485 llvm::Constant *CleanupFn;
489 CallCleanupFunction(llvm::Constant *CleanupFn,
const CGFunctionInfo *Info,
491 : CleanupFn(CleanupFn), FnInfo(*Info), Var(*Var) {}
506 QualType ArgTy = FnInfo.arg_begin()->type;
523 : Addr(addr.getPointer()), Size(size) {}
538 llvm_unreachable(
"present but none");
546 (var.
hasAttr<ObjCPreciseLifetimeAttr>()
570 if (
const Expr *e = dyn_cast<Expr>(s)) {
573 s = e = e->IgnoreParenCasts();
575 if (
const DeclRefExpr *ref = dyn_cast<DeclRefExpr>(e))
576 return (ref->getDecl() == &var);
577 if (
const BlockExpr *be = dyn_cast<BlockExpr>(e)) {
578 const BlockDecl *block = be->getBlockDecl();
579 for (
const auto &
I : block->
captures()) {
580 if (
I.getVariable() == &var)
586 for (
const Stmt *SubStmt : s->children())
595 if (!decl)
return false;
596 if (!isa<VarDecl>(decl))
return false;
603 bool needsCast =
false;
659 LValue lvalue,
bool capturedByInit) {
670 init = DIE->getExpr();
676 init = ewc->getSubExpr();
684 bool accessedByInit =
false;
686 accessedByInit = (capturedByInit ||
isAccessedBy(D, init));
687 if (accessedByInit) {
690 if (capturedByInit) {
699 llvm::Value *zero = llvm::ConstantPointerNull::get(ty);
715 llvm_unreachable(
"present but none");
775 llvm_unreachable(
"present but none");
804 if (isa<llvm::ConstantAggregateZero>(Init) ||
805 isa<llvm::ConstantPointerNull>(Init) ||
806 isa<llvm::UndefValue>(Init))
808 if (isa<llvm::ConstantInt>(Init) || isa<llvm::ConstantFP>(Init) ||
809 isa<llvm::ConstantVector>(Init) || isa<llvm::BlockAddress>(Init) ||
810 isa<llvm::ConstantExpr>(Init))
811 return Init->isNullValue() || NumStores--;
814 if (isa<llvm::ConstantArray>(Init) || isa<llvm::ConstantStruct>(Init)) {
815 for (
unsigned i = 0, e = Init->getNumOperands(); i != e; ++i) {
816 llvm::Constant *Elt = cast<llvm::Constant>(Init->getOperand(i));
823 if (llvm::ConstantDataSequential *CDS =
824 dyn_cast<llvm::ConstantDataSequential>(Init)) {
825 for (
unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
826 llvm::Constant *Elt = CDS->getElementAsConstant(i);
842 assert(!Init->isNullValue() && !isa<llvm::UndefValue>(Init) &&
843 "called emitStoresForInitAfterMemset for zero or undef value.");
845 if (isa<llvm::ConstantInt>(Init) || isa<llvm::ConstantFP>(Init) ||
846 isa<llvm::ConstantVector>(Init) || isa<llvm::BlockAddress>(Init) ||
847 isa<llvm::ConstantExpr>(Init)) {
852 if (llvm::ConstantDataSequential *CDS =
853 dyn_cast<llvm::ConstantDataSequential>(Init)) {
854 for (
unsigned i = 0, e = CDS->getNumElements(); i != e; ++i) {
855 llvm::Constant *Elt = CDS->getElementAsConstant(i);
858 if (!Elt->isNullValue() && !isa<llvm::UndefValue>(Elt))
860 Elt, Builder.CreateConstGEP2_32(Init->getType(), Loc, 0, i),
861 isVolatile, Builder);
866 assert((isa<llvm::ConstantStruct>(Init) || isa<llvm::ConstantArray>(Init)) &&
867 "Unknown value type!");
869 for (
unsigned i = 0, e = Init->getNumOperands(); i != e; ++i) {
870 llvm::Constant *Elt = cast<llvm::Constant>(Init->getOperand(i));
873 if (!Elt->isNullValue() && !isa<llvm::UndefValue>(Elt))
875 Elt, Builder.CreateConstGEP2_32(Init->getType(), Loc, 0, i),
876 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 &&
928 C->setDoesNotThrow();
936 C->setDoesNotThrow();
947 bool isByRef = D.
hasAttr<BlocksAttr>();
948 emission.IsByRef = isByRef;
984 assert(emission.wasEmittedAsGlobal());
989 emission.IsConstantAggregate =
true;
1002 if (!cast<CXXRecordDecl>(RecordTy->getDecl())->hasTrivialDestructor()) {
1022 allocaTy = byrefInfo.Type;
1023 allocaAlignment = byrefInfo.ByrefAlignment;
1026 allocaAlignment = alignment;
1038 bool IsMSCatchParam =
1045 emission.SizeForLifetimeMarkers =
1054 if (!DidCallStackSave) {
1063 DidCallStackSave =
true;
1072 std::tie(elementCount, elementType) =
getVLASize(Ty);
1077 llvm::AllocaInst *vla =
Builder.CreateAlloca(llvmTy, elementCount,
"vla");
1080 address =
Address(vla, alignment);
1083 setAddrOfLocalVar(&D, address);
1084 emission.Addr = address;
1096 if (D.
hasAttr<AnnotateAttr>())
1109 if (
const BlockExpr *be = dyn_cast<BlockExpr>(e)) {
1110 const BlockDecl *block = be->getBlockDecl();
1111 for (
const auto &
I : block->
captures()) {
1112 if (
I.getVariable() == &var)
1120 if (
const StmtExpr *SE = dyn_cast<StmtExpr>(e)) {
1122 for (
const auto *BI : CS->
body())
1123 if (
const auto *
E = dyn_cast<Expr>(BI)) {
1127 else if (
const auto *DS = dyn_cast<DeclStmt>(BI)) {
1129 for (
const auto *
I : DS->decls()) {
1130 if (
const auto *VD = dyn_cast<VarDecl>((
I))) {
1131 const Expr *Init = VD->getInit();
1144 for (
const Stmt *SubStmt : e->children())
1159 if (Constructor->isTrivial() &&
1160 Constructor->isDefaultConstructor() &&
1161 !Construct->requiresZeroInitialization())
1167 assert(emission.Variable &&
"emission was not valid!");
1170 if (emission.wasEmittedAsGlobal())
return;
1172 const VarDecl &D = *emission.Variable;
1187 if (emission.IsByRef)
1196 bool capturedByInit = emission.IsByRef &&
isCapturedBy(D, Init);
1201 llvm::Constant *constant =
nullptr;
1202 if (emission.IsConstantAggregate || D.
isConstexpr()) {
1203 assert(!capturedByInit &&
"constant init contains a capturing block?");
1213 if (!emission.IsConstantAggregate) {
1222 bool isVolatile = type.isVolatileQualified();
1226 getContext().getTypeSizeInChars(type).getQuantity());
1239 if (!constant->isNullValue() && !isa<llvm::UndefValue>(constant)) {
1248 llvm::GlobalVariable *GV =
1249 new llvm::GlobalVariable(
CGM.
getModule(), constant->getType(),
true,
1250 llvm::GlobalValue::PrivateLinkage,
1253 GV->setUnnamedAddr(
true);
1276 LValue lvalue,
bool capturedByInit) {
1309 llvm_unreachable(
"bad evaluation kind");
1322 const VarDecl *var = emission.Variable;
1330 llvm_unreachable(
"no cleanup for trivially-destructible variable");
1335 if (emission.NRVOFlag) {
1338 EHStack.pushCleanup<DestroyNRVOVariable>(cleanupKind, addr,
1339 dtor, emission.NRVOFlag);
1352 if (!var->
hasAttr<ObjCPreciseLifetimeAttr>())
1365 bool useEHCleanup = (cleanupKind &
EHCleanup);
1366 EHStack.pushCleanup<DestroyObject>(cleanupKind, addr,
type, destroyer,
1371 assert(emission.Variable &&
"emission was not valid!");
1374 if (emission.wasEmittedAsGlobal())
return;
1380 const VarDecl &D = *emission.Variable;
1389 cleanup.setLifetimeMarker();
1398 D.
hasAttr<ObjCPreciseLifetimeAttr>()) {
1403 if (
const CleanupAttr *CA = D.
getAttr<CleanupAttr>()) {
1407 assert(F &&
"Could not find function!");
1415 if (emission.IsByRef)
1430 llvm_unreachable(
"Unknown DestructionKind");
1437 assert(dtorKind &&
"cannot push destructor for trivial type");
1447 assert(dtorKind &&
"cannot push destructor for trivial type");
1456 bool useEHCleanupForArray) {
1457 pushFullExprCleanup<DestroyObject>(cleanupKind, addr,
type,
1458 destroyer, useEHCleanupForArray);
1462 EHStack.pushCleanup<CallStackRestore>(
Kind, SPMem);
1467 Destroyer *destroyer,
bool useEHCleanupForArray) {
1469 "performing lifetime extension from within conditional");
1475 EHStack.pushCleanup<DestroyObject>(
1477 destroyer, useEHCleanupForArray);
1481 pushCleanupAfterFullExpr<DestroyObject>(
1482 cleanupKind, addr,
type, destroyer, useEHCleanupForArray);
1497 Destroyer *destroyer,
1498 bool useEHCleanupForArray) {
1501 return destroyer(*
this, addr, type);
1510 bool checkZeroLength =
true;
1513 if (llvm::ConstantInt *constLength = dyn_cast<llvm::ConstantInt>(length)) {
1515 if (constLength->isZero())
return;
1516 checkZeroLength =
false;
1522 checkZeroLength, useEHCleanupForArray);
1539 Destroyer *destroyer,
1540 bool checkZeroLength,
1541 bool useEHCleanup) {
1549 if (checkZeroLength) {
1551 "arraydestroy.isempty");
1552 Builder.CreateCondBr(isEmpty, doneBB, bodyBB);
1556 llvm::BasicBlock *entryBB =
Builder.GetInsertBlock();
1558 llvm::PHINode *elementPast =
1559 Builder.CreatePHI(begin->getType(), 2,
"arraydestroy.elementPast");
1560 elementPast->addIncoming(end, entryBB);
1565 "arraydestroy.element");
1572 destroyer(*
this,
Address(element, elementAlign), elementType);
1579 Builder.CreateCondBr(done, doneBB, bodyBB);
1580 elementPast->addIncoming(element,
Builder.GetInsertBlock());
1593 unsigned arrayDepth = 0;
1596 if (!isa<VariableArrayType>(arrayType))
1598 type = arrayType->getElementType();
1605 begin = CGF.
Builder.CreateInBoundsGEP(begin, gepIndices,
"pad.arraybegin");
1606 end = CGF.
Builder.CreateInBoundsGEP(end, gepIndices,
"pad.arrayend");
1630 : ArrayBegin(arrayBegin), ArrayEnd(arrayEnd),
1631 ElementType(elementType), Destroyer(destroyer),
1632 ElementAlign(elementAlign) {}
1636 ElementType, ElementAlign, Destroyer);
1650 IrregularPartialArrayDestroy(
llvm::Value *arrayBegin,
1655 : ArrayBegin(arrayBegin), ArrayEndPointer(arrayEndPointer),
1656 ElementType(elementType), Destroyer(destroyer),
1657 ElementAlign(elementAlign) {}
1662 ElementType, ElementAlign, Destroyer);
1677 Destroyer *destroyer) {
1678 pushFullExprCleanup<IrregularPartialArrayDestroy>(
EHCleanup,
1679 arrayBegin, arrayEndPointer,
1680 elementType, elementAlign,
1694 Destroyer *destroyer) {
1695 pushFullExprCleanup<RegularPartialArrayDestroy>(
EHCleanup,
1696 arrayBegin, arrayEnd,
1697 elementType, elementAlign,
1703 if (LifetimeStartFn)
return LifetimeStartFn;
1704 LifetimeStartFn = llvm::Intrinsic::getDeclaration(&
getModule(),
1705 llvm::Intrinsic::lifetime_start);
1706 return LifetimeStartFn;
1711 if (LifetimeEndFn)
return LifetimeEndFn;
1712 LifetimeEndFn = llvm::Intrinsic::getDeclaration(&
getModule(),
1713 llvm::Intrinsic::lifetime_end);
1714 return LifetimeEndFn;
1725 : Param(param), Precise(precise) {}
1741 assert((isa<ParmVarDecl>(D) || isa<ImplicitParamDecl>(D)) &&
1742 "Invalid argument to EmitParmDecl");
1749 if (
auto IPD = dyn_cast<ImplicitParamDecl>(&D)) {
1759 bool DoStore =
false;
1765 unsigned AS = DeclPtr.
getType()->getAddressSpace();
1767 if (DeclPtr.
getType() != IRTy)
1796 bool isConsumed = D.
hasAttr<NSConsumedAttr>();
1851 setAddrOfLocalVar(&D, DeclPtr);
1861 if (D.
hasAttr<AnnotateAttr>())
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...
CK_LValueToRValue - A conversion which causes the extraction of an r-value from the operand gl-value...
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.
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
Decl - This represents one declaration (or definition), e.g.
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...
Emit only debug info necessary for generating line number tables (-gline-tables-only).
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
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)
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)
iterator begin() const
Returns an iterator pointing to the innermost EH scope.
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.
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::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.
void EmitAutoVarInit(const AutoVarEmission &emission)
CK_BitCast - A conversion which causes a bit pattern of one type to be reinterpreted as a bit pattern...
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.
DeclContext * getDeclContext()
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...
EHCleanupScope(bool isNormal, bool isEH, bool isActive, unsigned cleanupSize, unsigned fixupDepth, EHScopeStack::stable_iterator enclosingNormal, EHScopeStack::stable_iterator enclosingEH)
static bool hasNontrivialDestruction(QualType T)
hasNontrivialDestruction - Determine whether a type's destruction is non-trivial. ...
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)
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 isConstant(ASTContext &Ctx) const
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)
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.
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.
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)
Arrange the argument and result information for the declaration or definition of the given function...
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.
Decl * getNonClosureContext()
Find the innermost non-closure ancestor of this declaration, walking up through blocks, lambdas, etc.
Address getIndirectAddress() const
llvm::Constant * EmitNullConstant(QualType T)
Return the result of value-initializing the given type, i.e.
CK_BlockPointerToObjCPointerCast - Casting a block pointer to an ObjC pointer.
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...
bool TypeAlias
Whether this template specialization type is a substituted type alias.
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.
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.
bool isPODType(ASTContext &Context) const
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
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
CK_NoOp - A conversion which does not affect the type other than (possibly) adding qualifiers...
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.
SourceLocation getLocation() const
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)