13 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H 14 #define LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H 31 #include "llvm/ADT/DenseMap.h" 32 #include "llvm/ADT/SetVector.h" 33 #include "llvm/ADT/SmallPtrSet.h" 34 #include "llvm/ADT/StringMap.h" 35 #include "llvm/IR/Module.h" 36 #include "llvm/IR/ValueHandle.h" 37 #include "llvm/Transforms/Utils/SanitizerStats.h" 48 class IndexedInstrProfReader;
57 class ObjCImplementationDecl;
58 class ObjCCategoryImplDecl;
59 class ObjCProtocolDecl;
73 class HeaderSearchOptions;
74 class PreprocessorOptions;
75 class DiagnosticsEngine;
77 class CXXDestructorDecl;
79 class CoverageSourceInfo;
84 class CodeGenFunction;
89 class CGOpenCLRuntime;
92 class BlockFieldFlags;
93 class FunctionArgList;
94 class CoverageMappingModuleGen;
95 class TargetCodeGenInfo;
106 : priority(p), lex_order(l) {}
113 return std::tie(priority, lex_order) <
213 uint32_t VisitedInMainFile;
214 uint32_t MissingInMainFile;
221 : VisitedInMainFile(0), MissingInMainFile(0), Visited(0), Missing(0),
258 : CopyHelper(nullptr), DisposeHelper(nullptr), Alignment(alignment) {}
262 void Profile(llvm::FoldingSetNodeID &
id)
const {
266 virtual void profileImpl(llvm::FoldingSetNodeID &
id)
const = 0;
284 Structor(
int Priority, llvm::Constant *Initializer,
285 llvm::Constant *AssociatedData)
286 : Priority(Priority), Initializer(Initializer),
287 AssociatedData(AssociatedData) {}
301 llvm::Module &TheModule;
304 std::unique_ptr<CGCXXABI> ABI;
305 llvm::LLVMContext &VMContext;
307 std::unique_ptr<CodeGenTBAA> TBAA;
309 mutable std::unique_ptr<TargetCodeGenInfo> TheTargetCodeGenInfo;
320 std::unique_ptr<CGOpenCLRuntime> OpenCLRuntime;
321 std::unique_ptr<CGOpenMPRuntime> OpenMPRuntime;
322 std::unique_ptr<CGCUDARuntime> CUDARuntime;
323 std::unique_ptr<CGDebugInfo> DebugInfo;
324 std::unique_ptr<ObjCEntrypoints> ObjCData;
325 llvm::MDNode *NoObjCARCExceptionsMetadata =
nullptr;
326 std::unique_ptr<llvm::IndexedInstrProfReader> PGOReader;
328 std::unique_ptr<llvm::SanitizerStatReport> SanStats;
333 llvm::SmallPtrSet<llvm::GlobalValue*, 10> WeakRefReferences;
339 std::map<StringRef, GlobalDecl> DeferredDecls;
343 std::vector<GlobalDecl> DeferredDeclsToEmit;
345 DeferredDeclsToEmit.emplace_back(GD);
350 std::vector<GlobalDecl> Aliases;
354 std::vector<GlobalDecl> MultiVersionFuncs;
356 typedef llvm::StringMap<llvm::TrackingVH<llvm::Constant> > ReplacementsTy;
357 ReplacementsTy Replacements;
363 GlobalValReplacements;
367 llvm::DenseMap<const VarDecl*, llvm::GlobalVariable*> InitializerConstants;
375 std::vector<const CXXRecordDecl*> DeferredVTables;
378 std::vector<const CXXRecordDecl *> OpportunisticVTables;
383 std::vector<llvm::WeakTrackingVH> LLVMUsed;
384 std::vector<llvm::WeakTrackingVH> LLVMCompilerUsed;
388 CtorList GlobalCtors;
392 CtorList GlobalDtors;
395 llvm::MapVector<GlobalDecl, StringRef> MangledDeclNames;
396 llvm::StringMap<GlobalDecl, llvm::BumpPtrAllocator> Manglings;
400 llvm::MapVector<std::pair<GlobalDecl, unsigned>, StringRef>
401 CPUSpecificMangledDeclNames;
402 llvm::StringMap<std::pair<GlobalDecl, unsigned>, llvm::BumpPtrAllocator>
403 CPUSpecificManglings;
406 std::vector<llvm::Constant*> Annotations;
409 llvm::StringMap<llvm::Constant*> AnnotationStrings;
411 llvm::StringMap<llvm::GlobalVariable *> CFConstantStringMap;
413 llvm::DenseMap<llvm::Constant *, llvm::GlobalVariable *> ConstantStringMap;
414 llvm::DenseMap<const Decl*, llvm::Constant *> StaticLocalDeclMap;
415 llvm::DenseMap<const Decl*, llvm::GlobalVariable*> StaticLocalDeclGuardMap;
416 llvm::DenseMap<const Expr*, llvm::Constant *> MaterializedGlobalTemporaryMap;
418 llvm::DenseMap<QualType, llvm::Constant *> AtomicSetterHelperFnMap;
419 llvm::DenseMap<QualType, llvm::Constant *> AtomicGetterHelperFnMap;
422 llvm::DenseMap<QualType, llvm::Constant *> TypeDescriptorMap;
427 llvm::GlobalValue *> StaticExternCMap;
428 StaticExternCMap StaticExternCValues;
431 std::vector<const VarDecl *> CXXThreadLocals;
435 std::vector<llvm::Function *> CXXThreadLocalInits;
436 std::vector<const VarDecl *> CXXThreadLocalInitVars;
439 std::vector<llvm::Function *> CXXGlobalInits;
446 llvm::DenseMap<const Decl*, unsigned> DelayedCXXInitPosition;
448 typedef std::pair<OrderGlobalInits, llvm::Function*> GlobalInitData;
450 struct GlobalInitPriorityCmp {
451 bool operator()(
const GlobalInitData &LHS,
452 const GlobalInitData &RHS)
const {
453 return LHS.first.priority < RHS.first.priority;
463 std::tuple<llvm::FunctionType *, llvm::WeakTrackingVH, llvm::Constant *>>
467 llvm::SetVector<clang::Module *> ImportedModules;
471 llvm::SmallPtrSet<clang::Module *, 16> EmittedModuleInitializers;
484 llvm::WeakTrackingVH CFConstantStringClassRef;
488 QualType ObjCFastEnumerationStateType;
493 void createObjCRuntime();
495 void createOpenCLRuntime();
496 void createOpenMPRuntime();
497 void createCUDARuntime();
501 bool shouldOpportunisticallyEmitVTables();
503 llvm::DenseMap<const CompoundLiteralExpr *, llvm::GlobalVariable *>
504 EmittedCompoundLiterals;
508 llvm::DenseMap<const BlockExpr *, llvm::Constant *> EmittedGlobalBlocks;
513 llvm::Constant *NSConcreteGlobalBlock =
nullptr;
514 llvm::Constant *NSConcreteStackBlock =
nullptr;
516 llvm::FunctionCallee BlockObjectAssign =
nullptr;
517 llvm::FunctionCallee BlockObjectDispose =
nullptr;
519 llvm::Type *BlockDescriptorType =
nullptr;
520 llvm::Type *GenericBlockLiteralType =
nullptr;
527 llvm::Function *LifetimeStartFn =
nullptr;
530 llvm::Function *LifetimeEndFn =
nullptr;
534 std::unique_ptr<SanitizerMetadata> SanitizerMD;
538 llvm::MapVector<const Decl *, bool> DeferredEmptyCoverageMappingDecls;
540 std::unique_ptr<CoverageMappingModuleGen> CoverageMapping;
545 typedef llvm::DenseMap<QualType, llvm::Metadata *> MetadataTypeMap;
546 MetadataTypeMap MetadataIdMap;
547 MetadataTypeMap VirtualMetadataIdMap;
548 MetadataTypeMap GeneralizedMetadataIdMap;
565 bool getExpressionLocationsEnabled()
const;
569 if (!ObjCRuntime) createObjCRuntime();
578 assert(OpenCLRuntime !=
nullptr);
579 return *OpenCLRuntime;
584 assert(OpenMPRuntime !=
nullptr);
585 return *OpenMPRuntime;
590 assert(CUDARuntime !=
nullptr);
595 assert(ObjCData !=
nullptr);
601 llvm::FunctionCallee IsOSVersionAtLeastFn =
nullptr;
604 llvm::IndexedInstrProfReader *
getPGOReader()
const {
return PGOReader.get(); }
607 return CoverageMapping.get();
611 return StaticLocalDeclMap[D];
615 StaticLocalDeclMap[D] = C;
619 getOrCreateStaticVarDecl(
const VarDecl &D,
620 llvm::GlobalValue::LinkageTypes
Linkage);
623 return StaticLocalDeclGuardMap[D];
626 llvm::GlobalVariable *C) {
627 StaticLocalDeclGuardMap[D] = C;
630 Address createUnnamedGlobalFrom(
const VarDecl &D, llvm::Constant *Constant,
633 bool lookupRepresentativeDecl(StringRef MangledName,
637 return AtomicSetterHelperFnMap[Ty];
640 llvm::Constant *Fn) {
641 AtomicSetterHelperFnMap[Ty] = Fn;
645 return AtomicGetterHelperFnMap[Ty];
648 llvm::Constant *Fn) {
649 AtomicGetterHelperFnMap[Ty] = Fn;
653 return TypeDescriptorMap[Ty];
656 TypeDescriptorMap[Ty] = C;
662 if (!NoObjCARCExceptionsMetadata)
663 NoObjCARCExceptionsMetadata = llvm::MDNode::get(getLLVMContext(), None);
664 return NoObjCARCExceptionsMetadata;
670 const {
return HeaderSearchOpts; }
672 const {
return PreprocessorOpts; }
677 return TheModule.getDataLayout();
681 bool supportsCOMDAT()
const;
682 void maybeSetTrivialComdat(
const Decl &D, llvm::GlobalObject &GO);
708 llvm::MDNode *getTBAATypeInfo(
QualType QTy);
716 TBAAAccessInfo getTBAAVTablePtrAccessInfo(llvm::Type *VTablePtrType);
718 llvm::MDNode *getTBAAStructInfo(
QualType QTy);
722 llvm::MDNode *getTBAABaseTypeInfo(
QualType QTy);
746 return TBAAAccessInfo::getMayAliasInfo();
747 return getTBAAAccessInfo(AccessType);
750 bool isTypeConstant(
QualType QTy,
bool ExcludeCtorDtor);
753 bool isPaddedAtomicType(
const AtomicType *type);
756 void DecorateInstructionWithTBAA(llvm::Instruction *Inst,
760 void DecorateInstructionWithInvariantGroup(llvm::Instruction *I,
764 llvm::ConstantInt *getSize(
CharUnits numChars);
767 void setGlobalVisibility(llvm::GlobalValue *GV,
const NamedDecl *D)
const;
769 void setDSOLocal(llvm::GlobalValue *GV)
const;
771 void setDLLImportDLLExport(llvm::GlobalValue *GV,
GlobalDecl D)
const;
772 void setDLLImportDLLExport(llvm::GlobalValue *GV,
const NamedDecl *D)
const;
775 void setGVProperties(llvm::GlobalValue *GV,
GlobalDecl GD)
const;
776 void setGVProperties(llvm::GlobalValue *GV,
const NamedDecl *D)
const;
778 void setGVPropertiesAux(llvm::GlobalValue *GV,
const NamedDecl *D)
const;
782 void setTLSMode(llvm::GlobalValue *GV,
const VarDecl &D)
const;
790 llvm_unreachable(
"unknown visibility!");
793 llvm::Constant *GetAddrOfGlobal(
GlobalDecl GD,
801 llvm::GlobalVariable *
802 CreateOrReplaceCXXRuntimeVariable(StringRef Name, llvm::Type *Ty,
803 llvm::GlobalValue::LinkageTypes Linkage,
807 CreateGlobalInitOrDestructFunction(llvm::FunctionType *ty,
const Twine &
name,
828 llvm::Constant *GetAddrOfGlobalVar(
const VarDecl *D,
829 llvm::Type *Ty =
nullptr,
838 LangAS getStringLiteralAddressSpace()
const;
842 llvm::Constant *GetAddrOfFunction(
GlobalDecl GD, llvm::Type *Ty =
nullptr,
843 bool ForVTable =
false,
844 bool DontDefer =
false,
849 llvm::Constant *GetAddrOfRTTIDescriptor(
QualType Ty,
bool ForEH =
false);
855 llvm::Constant *GetAddrOfThunk(StringRef Name, llvm::Type *FnTy,
877 computeNonVirtualBaseClassOffset(
const CXXRecordDecl *DerivedClass,
894 llvm::Type *getBlockDescriptorType();
897 llvm::Type *getGenericBlockLiteralType();
900 llvm::Constant *GetAddrOfGlobalBlock(
const BlockExpr *BE, StringRef Name);
905 return EmittedGlobalBlocks.lookup(BE);
910 void setAddrOfGlobalBlock(
const BlockExpr *BE, llvm::Constant *Addr);
921 llvm::Constant *GetConstantArrayFromStringLiteral(
const StringLiteral *E);
926 StringRef Name =
".str");
938 GetAddrOfConstantCString(
const std::string &Str,
939 const char *GlobalName =
nullptr);
947 llvm::GlobalVariable *
953 llvm::GlobalVariable *GV);
962 QualType getObjCFastEnumerationStateType();
967 llvm::Function *codegenCXXStructor(
GlobalDecl GD);
972 llvm::FunctionType *FnType =
nullptr,
973 bool DontDefer =
false,
975 return cast<llvm::Constant>(getAddrAndTypeOfCXXStructor(GD, FnInfo, FnType,
981 llvm::FunctionCallee getAddrAndTypeOfCXXStructor(
983 llvm::FunctionType *FnType =
nullptr,
bool DontDefer =
false,
988 llvm::Constant *getBuiltinLibFunction(
const FunctionDecl *FD,
994 void EmitTopLevelDecl(
Decl *D);
998 void AddDeferredUnusedCoverageMapping(
Decl *D);
1002 void ClearUnusedCoverageMapping(
const Decl *D);
1006 void EmitDeferredUnusedCoverageMappings();
1009 void HandleCXXStaticMemberVarInstantiation(
VarDecl *VD);
1014 template<
typename SomeDecl>
1015 void MaybeHandleStaticInExternC(
const SomeDecl *D, llvm::GlobalValue *GV);
1018 void addUsedGlobal(llvm::GlobalValue *GV);
1021 void addCompilerUsedGlobal(llvm::GlobalValue *GV);
1025 CXXGlobalDtors.emplace_back(DtorFn.getFunctionType(), DtorFn.getCallee(),
1031 llvm::FunctionCallee
1032 CreateRuntimeFunction(llvm::FunctionType *Ty, StringRef Name,
1033 llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
1034 bool Local =
false);
1037 llvm::Constant *CreateRuntimeVariable(llvm::Type *Ty,
1043 llvm::Constant *getNSConcreteGlobalBlock();
1044 llvm::Constant *getNSConcreteStackBlock();
1045 llvm::FunctionCallee getBlockObjectAssign();
1046 llvm::FunctionCallee getBlockObjectDispose();
1050 llvm::Function *getLLVMLifetimeStartFn();
1051 llvm::Function *getLLVMLifetimeEndFn();
1054 void UpdateCompletedType(
const TagDecl *TD);
1056 llvm::Constant *getMemberPointerConstant(
const UnaryOperator *e);
1076 void ErrorUnsupported(
const Stmt *S,
const char *
Type);
1079 void ErrorUnsupported(
const Decl *D,
const char *Type);
1084 void SetInternalFunctionAttributes(
GlobalDecl GD, llvm::Function *F,
1093 void SetLLVMFunctionAttributesForDefinition(
const Decl *D, llvm::Function *F);
1103 bool ReturnTypeUsesFPRet(
QualType ResultType);
1106 bool ReturnTypeUsesFP2Ret(
QualType ResultType);
1118 void ConstructAttributeList(StringRef Name,
const CGFunctionInfo &Info,
1120 llvm::AttributeList &Attrs,
unsigned &
CallingConv,
1121 bool AttrOnCallSite);
1140 void AddDefaultFnAttrs(llvm::Function &F);
1144 TargetAttr::ParsedTargetAttr filterFunctionTargetAttrs(
const TargetAttr *TD);
1148 void getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
GlobalDecl GD);
1153 void EmitTentativeDefinition(
const VarDecl *D);
1160 void AppendLinkerOptions(StringRef Opts);
1163 void AddDetectMismatch(StringRef Name, StringRef
Value);
1166 void AddDependentLib(StringRef Lib);
1169 llvm::GlobalVariable::LinkageTypes getFunctionLinkage(
GlobalDecl GD);
1172 F->setLinkage(getFunctionLinkage(GD));
1177 llvm::GlobalVariable::LinkageTypes getVTableLinkage(
const CXXRecordDecl *RD);
1180 CharUnits GetTargetTypeStoreSize(llvm::Type *Ty)
const;
1183 llvm::GlobalValue::LinkageTypes
1185 bool IsConstantVariable);
1188 llvm::GlobalValue::LinkageTypes
1189 getLLVMLinkageVarDefinition(
const VarDecl *VD,
bool IsConstant);
1192 void EmitGlobalAnnotations();
1195 llvm::Constant *EmitAnnotationString(StringRef Str);
1210 llvm::Constant *EmitAnnotateAttr(llvm::GlobalValue *GV,
1211 const AnnotateAttr *AA,
1216 void AddGlobalAnnotations(
const ValueDecl *D, llvm::GlobalValue *GV);
1221 bool isInSanitizerBlacklist(llvm::GlobalVariable *GV,
SourceLocation Loc,
1223 StringRef
Category = StringRef())
const;
1229 StringRef
Category = StringRef())
const;
1232 return SanitizerMD.get();
1236 DeferredVTables.push_back(RD);
1245 llvm::GlobalValue *GetGlobalValue(StringRef Ref);
1251 void SetCommonAttributes(
GlobalDecl GD, llvm::GlobalValue *GV);
1253 void addReplacement(StringRef Name, llvm::Constant *C);
1255 void addGlobalValReplacement(llvm::GlobalValue *GV, llvm::Constant *C);
1279 void EmitVTableTypeMetadata(llvm::GlobalVariable *VTable,
1283 llvm::ConstantInt *CreateCrossDsoCfiTypeId(llvm::Metadata *MD);
1288 llvm::Metadata *CreateMetadataIdentifierForType(
QualType T);
1292 llvm::Metadata *CreateMetadataIdentifierForVirtualMemPtrType(
QualType T);
1297 llvm::Metadata *CreateMetadataIdentifierGeneralized(
QualType T);
1300 void CreateFunctionTypeMetadataForIcall(
const FunctionDecl *FD,
1304 bool NeedAllVtablesTypeId()
const;
1307 void AddVTableTypeMetadata(llvm::GlobalVariable *VTable,
CharUnits Offset,
1315 std::vector<const CXXRecordDecl *>
1319 llvm::FunctionCallee getTerminateFn();
1321 llvm::SanitizerStatReport &getSanStats();
1336 void GenOpenCLArgMetadata(llvm::Function *FN,
1343 llvm::Constant *getNullPointer(llvm::PointerType *T,
QualType QT);
1346 llvm::Constant *GetOrCreateLLVMFunction(
1347 StringRef MangledName, llvm::Type *Ty,
GlobalDecl D,
bool ForVTable,
1348 bool DontDefer =
false,
bool IsThunk =
false,
1349 llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
1352 llvm::Constant *GetOrCreateMultiVersionResolver(
GlobalDecl GD,
1357 llvm::Constant *GetOrCreateLLVMGlobal(StringRef MangledName,
1358 llvm::PointerType *PTy,
1363 bool GetCPUAndFeaturesAttributes(
GlobalDecl GD,
1364 llvm::AttrBuilder &AttrBuilder);
1365 void setNonAliasAttributes(
GlobalDecl GD, llvm::GlobalObject *GO);
1368 void SetFunctionAttributes(
GlobalDecl GD, llvm::Function *F,
1369 bool IsIncompleteFunction,
bool IsThunk);
1371 void EmitGlobalDefinition(
GlobalDecl D, llvm::GlobalValue *GV =
nullptr);
1373 void EmitGlobalFunctionDefinition(
GlobalDecl GD, llvm::GlobalValue *GV);
1374 void EmitMultiVersionFunctionDefinition(
GlobalDecl GD, llvm::GlobalValue *GV);
1376 void EmitGlobalVarDefinition(
const VarDecl *D,
bool IsTentative =
false);
1379 void emitCPUDispatchDefinition(
GlobalDecl GD);
1389 void EmitCXXThreadLocalInitFunc();
1392 void EmitCXXGlobalInitFunc();
1395 void EmitCXXGlobalDtorFunc();
1399 void EmitCXXGlobalVarDeclInitFunc(
const VarDecl *D,
1400 llvm::GlobalVariable *Addr,
1403 void EmitPointerToInitFunc(
const VarDecl *VD, llvm::GlobalVariable *Addr,
1404 llvm::Function *InitFunc, InitSegAttr *ISA);
1407 void AddGlobalCtor(llvm::Function *Ctor,
int Priority = 65535,
1408 llvm::Constant *AssociatedData =
nullptr);
1409 void AddGlobalDtor(llvm::Function *Dtor,
int Priority = 65535);
1414 void EmitCtorList(CtorList &Fns,
const char *GlobalName);
1417 void EmitDeferred();
1423 void EmitVTablesOpportunistically();
1426 void applyReplacements();
1429 void applyGlobalValReplacements();
1431 void checkAliases();
1433 std::map<int, llvm::TinyPtrVector<llvm::Function *>> DtorsUsingAtExit;
1437 void registerGlobalDtorsWithAtExit();
1439 void emitMultiVersionFunctions();
1442 void EmitDeferredVTables();
1446 void emitAtAvailableLinkGuard();
1449 void emitLLVMUsed();
1452 void EmitModuleLinkOptions();
1456 void EmitStaticExternCAliases();
1458 void EmitDeclMetadata();
1461 void EmitVersionIdentMetadata();
1464 void EmitCommandLineMetadata();
1467 void EmitTargetMetadata();
1470 void EmitOpenCLMetadata();
1474 void EmitCoverageFile();
1477 llvm::Constant *EmitUuidofInitializer(StringRef uuidstr);
1487 bool MayBeEmittedEagerly(
const ValueDecl *D);
1491 void SimplifyPersonality();
1495 void ConstructDefaultFnAttrList(StringRef Name,
bool HasOptnone,
1496 bool AttrOnCallSite,
1497 llvm::AttrBuilder &FuncAttrs);
1499 llvm::Metadata *CreateMetadataIdentifierImpl(
QualType T, MetadataTypeMap &Map,
1506 #endif // LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H const llvm::DataLayout & getDataLayout() const
TBAAAccessInfo getTBAAInfoForSubobject(LValue Base, QualType AccessType)
getTBAAInfoForSubobject - Get TBAA information for an access with a given base lvalue.
CGOpenCLRuntime & getOpenCLRuntime()
Return a reference to the configured OpenCL runtime.
llvm::Function * objc_retainAutoreleaseReturnValue
id objc_retainAutoreleaseReturnValue(id);
llvm::FunctionCallee objc_releaseRuntimeFunction
void objc_release(id); Note this is the runtime method not the intrinsic.
Represents a function declaration or definition.
bool operator==(const OrderGlobalInits &RHS) const
llvm::Function * objc_copyWeak
void objc_copyWeak(id *dest, id *src);
void setTypeDescriptorInMap(QualType Ty, llvm::Constant *C)
A (possibly-)qualified type.
CodeGenTypes & getTypes()
llvm::Constant * AssociatedData
const CodeGenOptions & getCodeGenOpts() const
bool hasObjCRuntime()
Return true iff an Objective-C runtime has been configured.
llvm::LLVMContext & getLLVMContext()
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
llvm::Constant * CopyHelper
Stmt - This represents one statement.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
Implements runtime-specific code generation functions.
Defines the clang::Module class, which describes a module in the source code.
Decl - This represents one declaration (or definition), e.g.
llvm::Constant * getAddrOfCXXStructor(GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition)
Return the address of the constructor/destructor of the given type.
BlockByrefHelpers(CharUnits alignment)
The base class of the type hierarchy.
void setFunctionLinkage(GlobalDecl GD, llvm::Function *F)
Stores additional source code information like skipped ranges which is required by the coverage mappi...
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
constexpr XRayInstrMask Function
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
CtorList & getGlobalCtors()
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
static llvm::GlobalValue::VisibilityTypes GetLLVMVisibility(Visibility V)
const CXXBaseSpecifier *const * path_const_iterator
Represents a variable declaration or definition.
Objects with "hidden" visibility are not seen by the dynamic linker.
CompoundLiteralExpr - [C99 6.5.2.5].
CGDebugInfo * getModuleDebugInfo()
LangAS
Defines the address space values used by the address space qualifier of QualType. ...
This class gathers all debug information during compilation and is responsible for emitting to llvm g...
bool shouldUseTBAA() const
DiagnosticsEngine & getDiags() const
llvm::Constant * getAtomicSetterHelperFnMap(QualType Ty)
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
llvm::Function * objc_retainAutorelease
id objc_retainAutorelease(id);
llvm::GlobalVariable * getStaticLocalDeclGuardAddress(const VarDecl *D)
llvm::Constant * getAtomicGetterHelperFnMap(QualType Ty)
One of these records is kept for each identifier that is lexed.
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
llvm::Function * objc_initWeak
id objc_initWeak(id*, id);
void AddCXXDtorEntry(llvm::FunctionCallee DtorFn, llvm::Constant *Object)
Add a destructor and object to add to the C++ global destructor function.
llvm::FunctionCallee objc_autoreleaseRuntimeFunction
id objc_autorelease(id); Note this is the runtime method not the intrinsic.
llvm::IndexedInstrProfReader * getPGOReader() const
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Objects with "default" visibility are seen by the dynamic linker and act like normal objects...
llvm::FunctionCallee objc_alloc_init
void objc_alloc_init(id);
llvm::Function * objc_release
void objc_release(id);
CGCUDARuntime & getCUDARuntime()
Return a reference to the configured CUDA runtime.
bool operator<(const OrderGlobalInits &RHS) const
CharUnits - This is an opaque type for sizes expressed in character units.
Structor(int Priority, llvm::Constant *Initializer, llvm::Constant *AssociatedData)
Visibility
Describes the different kinds of visibility that a declaration may have.
void setStaticLocalDeclAddress(const VarDecl *D, llvm::Constant *C)
Concrete class used by the front-end to report problems and issues.
llvm::Constant * getAddrOfGlobalBlockIfEmitted(const BlockExpr *BE)
Returns the address of a block which requires no caputres, or null if we've yet to emit the block for...
void addDeferredVTable(const CXXRecordDecl *RD)
void setAtomicGetterHelperFnMap(QualType Ty, llvm::Constant *Fn)
void addMissing(bool MainFile)
Record that a function we've visited has no profile data.
Enums/classes describing ABI related information about constructors, destructors and thunks...
ItaniumVTableContext & getItaniumVTableContext()
__DEVICE__ void * memset(void *__a, int __b, size_t __c)
const PreprocessorOptions & getPreprocessorOpts() const
void Profile(llvm::FoldingSetNodeID &id) const
llvm::Function * objc_moveWeak
void objc_moveWeak(id *dest, id *src);
Represents a linkage specification.
llvm::Constant * Initializer
InstrProfStats & getPGOStats()
llvm::Constant * getStaticLocalDeclAddress(const VarDecl *D)
llvm::Function * objc_unsafeClaimAutoreleasedReturnValue
id objc_unsafeClaimAutoreleasedReturnValue(id);
llvm::Function * objc_retainAutoreleasedReturnValue
id objc_retainAutoreleasedReturnValue(id);
Represents a ValueDecl that came out of a declarator.
CtorList & getGlobalDtors()
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
This represents '#pragma omp requires...' directive.
Exposes information about the current target.
CGObjCRuntime & getObjCRuntime()
Return a reference to the configured Objective-C runtime.
CharUnits Alignment
The alignment of the field.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
Defines the clang::LangOptions interface.
llvm::Constant * DisposeHelper
Organizes the cross-function state that is used while generating code coverage mapping data...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a C++ destructor within a class.
llvm::FunctionCallee objc_alloc
void objc_alloc(id);
void setStaticLocalDeclGuardAddress(const VarDecl *D, llvm::GlobalVariable *C)
MicrosoftVTableContext & getMicrosoftVTableContext()
Objects with "protected" visibility are seen by the dynamic linker but always dynamically resolve to ...
void addMismatched(bool MainFile)
Record that a function we've visited has mismatched profile data.
TBAAAccessInfo getTBAAInfo() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
const TargetInfo & getTarget() const
const LangOptions & getLangOpts() const
ASTContext & getContext() const
CallingConv
CallingConv - Specifies the calling convention that a function uses.
GlobalDecl - represents a global declaration.
virtual bool needsCopy() const
void addVisited(bool MainFile)
Record that we've visited a function and whether or not that function was in the main source file...
llvm::Function * objc_loadWeakRetained
id objc_loadWeakRetained(id*);
llvm::FunctionCallee objc_autoreleasePoolPop
void objc_autoreleasePoolPop(void*);
Encodes a location in the source.
llvm::Function * clang_arc_use
void clang.arc.use(...);
llvm::Constant * getTypeDescriptorFromMap(QualType Ty)
This represents '#pragma omp declare reduction ...' directive.
Represents the declaration of a struct/union/class/enum.
llvm::Function * objc_destroyWeak
void objc_destroyWeak(id*);
ObjCEntrypoints & getObjCEntrypoints() const
This file defines OpenMP nodes for declarative directives.
llvm::Function * objc_storeWeak
id objc_storeWeak(id*, id);
llvm::FunctionCallee objc_retainRuntimeFunction
id objc_retain(id); Note this is the runtime method not the intrinsic.
llvm::InlineAsm * retainAutoreleasedReturnValueMarker
A void(void) inline asm to use to mark that the return value of a call will be immediately retain...
const HeaderSearchOptions & getHeaderSearchOpts() const
virtual bool needsDispose() const
ItaniumVTableContext & getItaniumVTableContext()
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues, like target-specific attributes, builtins and so on.
std::vector< Structor > CtorList
CGFunctionInfo - Class to encapsulate the information about a function definition.
This class organizes the cross-function state that is used while generating LLVM code.
CGOpenMPRuntime & getOpenMPRuntime()
Return a reference to the configured OpenMP runtime.
Dataflow Directional Tag Classes.
llvm::FoldingSet< BlockByrefHelpers > ByrefHelpersCache
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
int getUniqueBlockCount()
Fetches the global unique block count.
The basic abstraction for the target Objective-C runtime.
static llvm::Constant * EmitNullConstantForBase(CodeGenModule &CGM, llvm::Type *baseType, const CXXRecordDecl *base)
Emit the null constant for a base subobject.
CoverageMappingModuleGen * getCoverageMapping() const
llvm::Module & getModule() const
ExplicitCastExpr - An explicit cast written in the source code.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
llvm::FunctionCallee objc_autoreleasePoolPopInvoke
void objc_autoreleasePoolPop(void*); Note this method is used when we are using exception handling ...
Implements C++ ABI-specific code generation functions.
ObjCEncodeExpr, used for @encode in Objective-C.
This class organizes the cross-module state that is used while lowering AST types to LLVM types...
bool hasDiagnostics()
Whether or not the stats we've gathered indicate any potential problems.
This class records statistics on instrumentation based profiling.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
llvm::Function * objc_autoreleaseReturnValue
id objc_autoreleaseReturnValue(id);
void setAtomicSetterHelperFnMap(QualType Ty, llvm::Constant *Fn)
llvm::Function * objc_autorelease
id objc_autorelease(id);
llvm::MDNode * getNoObjCARCExceptionsMetadata()
A pair of helper functions for a __block variable.
static llvm::Constant * EmitNullConstant(CodeGenModule &CGM, const RecordDecl *record, bool asCompleteObject)
llvm::FunctionCallee objc_allocWithZone
void objc_allocWithZone(id);
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
MicrosoftVTableContext & getMicrosoftVTableContext()
Represents a C++ struct/union/class.
llvm::Function * objc_storeStrong
void objc_storeStrong(id*, id);
A specialization of Address that requires the address to be an LLVM Constant.
llvm::Function * objc_loadWeak
id objc_loadWeak(id*);
OrderGlobalInits(unsigned int p, unsigned int l)
This represents '#pragma omp declare mapper ...' directive.
StringLiteral - This represents a string literal expression, e.g.
CGCXXABI & getCXXABI() const
llvm::Function * objc_retain
id objc_retain(id);
GVALinkage
A more specific kind of linkage than enum Linkage.
llvm::Function * objc_autoreleasePoolPush
void *objc_autoreleasePoolPush(void);
This structure provides a set of types that are commonly used during IR emission. ...
CodeGenVTables & getVTables()
LValue - This represents an lvalue references.
This represents a decl that may have a name.
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
SanitizerMetadata * getSanitizerMetadata()
This represents '#pragma omp threadprivate ...' directive.
Abstract information about a function or function prototype.
llvm::Function * objc_retainBlock
id objc_retainBlock(id);
const llvm::Triple & getTriple() const