14 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H 15 #define LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H 32 #include "llvm/ADT/DenseMap.h" 33 #include "llvm/ADT/SetVector.h" 34 #include "llvm/ADT/SmallPtrSet.h" 35 #include "llvm/ADT/StringMap.h" 36 #include "llvm/IR/Module.h" 37 #include "llvm/IR/ValueHandle.h" 38 #include "llvm/Transforms/Utils/SanitizerStats.h" 49 class IndexedInstrProfReader;
58 class ObjCImplementationDecl;
59 class ObjCCategoryImplDecl;
60 class ObjCProtocolDecl;
74 class HeaderSearchOptions;
75 class PreprocessorOptions;
76 class DiagnosticsEngine;
78 class CXXDestructorDecl;
80 class CoverageSourceInfo;
85 class CodeGenFunction;
90 class CGOpenCLRuntime;
93 class BlockFieldFlags;
94 class FunctionArgList;
95 class CoverageMappingModuleGen;
96 class TargetCodeGenInfo;
107 : priority(p), lex_order(l) {}
114 return std::tie(priority, lex_order) <
189 uint32_t VisitedInMainFile;
190 uint32_t MissingInMainFile;
197 : VisitedInMainFile(0), MissingInMainFile(0), Visited(0), Missing(0),
237 void Profile(llvm::FoldingSetNodeID &
id)
const {
241 virtual void profileImpl(llvm::FoldingSetNodeID &
id)
const = 0;
258 Structor() : Priority(0), Initializer(nullptr), AssociatedData(nullptr) {}
259 Structor(
int Priority, llvm::Constant *Initializer,
260 llvm::Constant *AssociatedData)
261 : Priority(Priority), Initializer(Initializer),
262 AssociatedData(AssociatedData) {}
276 llvm::Module &TheModule;
279 std::unique_ptr<CGCXXABI> ABI;
280 llvm::LLVMContext &VMContext;
282 std::unique_ptr<CodeGenTBAA> TBAA;
284 mutable std::unique_ptr<TargetCodeGenInfo> TheTargetCodeGenInfo;
295 std::unique_ptr<CGOpenCLRuntime> OpenCLRuntime;
296 std::unique_ptr<CGOpenMPRuntime> OpenMPRuntime;
297 std::unique_ptr<CGCUDARuntime> CUDARuntime;
298 std::unique_ptr<CGDebugInfo> DebugInfo;
299 std::unique_ptr<ObjCEntrypoints> ObjCData;
300 llvm::MDNode *NoObjCARCExceptionsMetadata =
nullptr;
301 std::unique_ptr<llvm::IndexedInstrProfReader> PGOReader;
303 std::unique_ptr<llvm::SanitizerStatReport> SanStats;
308 llvm::SmallPtrSet<llvm::GlobalValue*, 10> WeakRefReferences;
314 std::map<StringRef, GlobalDecl> DeferredDecls;
318 std::vector<GlobalDecl> DeferredDeclsToEmit;
320 DeferredDeclsToEmit.emplace_back(GD);
325 std::vector<GlobalDecl> Aliases;
329 std::vector<GlobalDecl> MultiVersionFuncs;
331 typedef llvm::StringMap<llvm::TrackingVH<llvm::Constant> > ReplacementsTy;
332 ReplacementsTy Replacements;
338 GlobalValReplacements;
346 std::vector<const CXXRecordDecl*> DeferredVTables;
349 std::vector<const CXXRecordDecl *> OpportunisticVTables;
354 std::vector<llvm::WeakTrackingVH> LLVMUsed;
355 std::vector<llvm::WeakTrackingVH> LLVMCompilerUsed;
359 CtorList GlobalCtors;
363 CtorList GlobalDtors;
366 llvm::MapVector<GlobalDecl, StringRef> MangledDeclNames;
367 llvm::StringMap<GlobalDecl, llvm::BumpPtrAllocator> Manglings;
371 llvm::MapVector<std::pair<GlobalDecl, unsigned>, StringRef>
372 CPUSpecificMangledDeclNames;
373 llvm::StringMap<std::pair<GlobalDecl, unsigned>, llvm::BumpPtrAllocator>
374 CPUSpecificManglings;
377 std::vector<llvm::Constant*> Annotations;
380 llvm::StringMap<llvm::Constant*> AnnotationStrings;
382 llvm::StringMap<llvm::GlobalVariable *> CFConstantStringMap;
384 llvm::DenseMap<llvm::Constant *, llvm::GlobalVariable *> ConstantStringMap;
385 llvm::DenseMap<const Decl*, llvm::Constant *> StaticLocalDeclMap;
386 llvm::DenseMap<const Decl*, llvm::GlobalVariable*> StaticLocalDeclGuardMap;
387 llvm::DenseMap<const Expr*, llvm::Constant *> MaterializedGlobalTemporaryMap;
389 llvm::DenseMap<QualType, llvm::Constant *> AtomicSetterHelperFnMap;
390 llvm::DenseMap<QualType, llvm::Constant *> AtomicGetterHelperFnMap;
393 llvm::DenseMap<QualType, llvm::Constant *> TypeDescriptorMap;
398 llvm::GlobalValue *> StaticExternCMap;
399 StaticExternCMap StaticExternCValues;
402 std::vector<const VarDecl *> CXXThreadLocals;
406 std::vector<llvm::Function *> CXXThreadLocalInits;
407 std::vector<const VarDecl *> CXXThreadLocalInitVars;
410 std::vector<llvm::Function *> CXXGlobalInits;
417 llvm::DenseMap<const Decl*, unsigned> DelayedCXXInitPosition;
419 typedef std::pair<OrderGlobalInits, llvm::Function*> GlobalInitData;
421 struct GlobalInitPriorityCmp {
422 bool operator()(
const GlobalInitData &LHS,
423 const GlobalInitData &RHS)
const {
424 return LHS.first.priority < RHS.first.priority;
433 std::vector<std::pair<llvm::WeakTrackingVH, llvm::Constant *>> CXXGlobalDtors;
436 llvm::SetVector<clang::Module *> ImportedModules;
440 llvm::SmallPtrSet<clang::Module *, 16> EmittedModuleInitializers;
450 llvm::WeakTrackingVH CFConstantStringClassRef;
454 QualType ObjCFastEnumerationStateType;
459 void createObjCRuntime();
461 void createOpenCLRuntime();
462 void createOpenMPRuntime();
463 void createCUDARuntime();
467 bool shouldOpportunisticallyEmitVTables();
469 llvm::DenseMap<const CompoundLiteralExpr *, llvm::GlobalVariable *>
470 EmittedCompoundLiterals;
474 llvm::DenseMap<const BlockExpr *, llvm::Constant *> EmittedGlobalBlocks;
479 llvm::Constant *NSConcreteGlobalBlock =
nullptr;
480 llvm::Constant *NSConcreteStackBlock =
nullptr;
482 llvm::Constant *BlockObjectAssign =
nullptr;
483 llvm::Constant *BlockObjectDispose =
nullptr;
485 llvm::Type *BlockDescriptorType =
nullptr;
486 llvm::Type *GenericBlockLiteralType =
nullptr;
493 llvm::Constant *LifetimeStartFn =
nullptr;
496 llvm::Constant *LifetimeEndFn =
nullptr;
500 std::unique_ptr<SanitizerMetadata> SanitizerMD;
504 llvm::MapVector<const Decl *, bool> DeferredEmptyCoverageMappingDecls;
506 std::unique_ptr<CoverageMappingModuleGen> CoverageMapping;
511 typedef llvm::DenseMap<QualType, llvm::Metadata *> MetadataTypeMap;
512 MetadataTypeMap MetadataIdMap;
513 MetadataTypeMap VirtualMetadataIdMap;
514 MetadataTypeMap GeneralizedMetadataIdMap;
531 bool getExpressionLocationsEnabled()
const;
535 if (!ObjCRuntime) createObjCRuntime();
544 assert(OpenCLRuntime !=
nullptr);
545 return *OpenCLRuntime;
550 assert(OpenMPRuntime !=
nullptr);
551 return *OpenMPRuntime;
556 assert(CUDARuntime !=
nullptr);
561 assert(ObjCData !=
nullptr);
567 llvm::Constant *IsOSVersionAtLeastFn =
nullptr;
570 llvm::IndexedInstrProfReader *
getPGOReader()
const {
return PGOReader.get(); }
573 return CoverageMapping.get();
577 return StaticLocalDeclMap[D];
581 StaticLocalDeclMap[D] = C;
585 getOrCreateStaticVarDecl(
const VarDecl &D,
586 llvm::GlobalValue::LinkageTypes
Linkage);
589 return StaticLocalDeclGuardMap[D];
592 llvm::GlobalVariable *C) {
593 StaticLocalDeclGuardMap[D] = C;
596 bool lookupRepresentativeDecl(StringRef MangledName,
600 return AtomicSetterHelperFnMap[Ty];
603 llvm::Constant *Fn) {
604 AtomicSetterHelperFnMap[Ty] = Fn;
608 return AtomicGetterHelperFnMap[Ty];
611 llvm::Constant *Fn) {
612 AtomicGetterHelperFnMap[Ty] = Fn;
616 return TypeDescriptorMap[Ty];
619 TypeDescriptorMap[Ty] = C;
625 if (!NoObjCARCExceptionsMetadata)
626 NoObjCARCExceptionsMetadata = llvm::MDNode::get(getLLVMContext(), None);
627 return NoObjCARCExceptionsMetadata;
633 const {
return HeaderSearchOpts; }
635 const {
return PreprocessorOpts; }
640 return TheModule.getDataLayout();
644 bool supportsCOMDAT()
const;
645 void maybeSetTrivialComdat(
const Decl &D, llvm::GlobalObject &GO);
671 llvm::MDNode *getTBAATypeInfo(
QualType QTy);
679 TBAAAccessInfo getTBAAVTablePtrAccessInfo(llvm::Type *VTablePtrType);
681 llvm::MDNode *getTBAAStructInfo(
QualType QTy);
685 llvm::MDNode *getTBAABaseTypeInfo(
QualType QTy);
709 return TBAAAccessInfo::getMayAliasInfo();
710 return getTBAAAccessInfo(AccessType);
713 bool isTypeConstant(
QualType QTy,
bool ExcludeCtorDtor);
716 bool isPaddedAtomicType(
const AtomicType *type);
719 void DecorateInstructionWithTBAA(llvm::Instruction *Inst,
723 void DecorateInstructionWithInvariantGroup(llvm::Instruction *I,
727 llvm::ConstantInt *getSize(
CharUnits numChars);
730 void setGlobalVisibility(llvm::GlobalValue *GV,
const NamedDecl *D)
const;
732 void setGlobalVisibilityAndLocal(llvm::GlobalValue *GV,
735 void setDSOLocal(llvm::GlobalValue *GV)
const;
737 void setDLLImportDLLExport(llvm::GlobalValue *GV,
GlobalDecl D)
const;
738 void setDLLImportDLLExport(llvm::GlobalValue *GV,
const NamedDecl *D)
const;
741 void setGVProperties(llvm::GlobalValue *GV,
GlobalDecl GD)
const;
742 void setGVProperties(llvm::GlobalValue *GV,
const NamedDecl *D)
const;
746 void setTLSMode(llvm::GlobalValue *GV,
const VarDecl &D)
const;
754 llvm_unreachable(
"unknown visibility!");
757 llvm::Constant *GetAddrOfGlobal(
GlobalDecl GD,
765 llvm::GlobalVariable *
766 CreateOrReplaceCXXRuntimeVariable(StringRef Name, llvm::Type *Ty,
767 llvm::GlobalValue::LinkageTypes Linkage);
770 CreateGlobalInitOrDestructFunction(llvm::FunctionType *ty,
const Twine &name,
791 llvm::Constant *GetAddrOfGlobalVar(
const VarDecl *D,
792 llvm::Type *Ty =
nullptr,
801 LangAS getStringLiteralAddressSpace()
const;
805 llvm::Constant *GetAddrOfFunction(
GlobalDecl GD, llvm::Type *Ty =
nullptr,
806 bool ForVTable =
false,
807 bool DontDefer =
false,
812 llvm::Constant *GetAddrOfRTTIDescriptor(
QualType Ty,
bool ForEH =
false);
818 llvm::Constant *GetAddrOfThunk(StringRef Name, llvm::Type *FnTy,
840 computeNonVirtualBaseClassOffset(
const CXXRecordDecl *DerivedClass,
857 llvm::Type *getBlockDescriptorType();
860 llvm::Type *getGenericBlockLiteralType();
863 llvm::Constant *GetAddrOfGlobalBlock(
const BlockExpr *BE, StringRef Name);
868 return EmittedGlobalBlocks.lookup(BE);
873 void setAddrOfGlobalBlock(
const BlockExpr *BE, llvm::Constant *Addr);
884 llvm::Constant *GetConstantArrayFromStringLiteral(
const StringLiteral *E);
889 StringRef Name =
".str");
901 GetAddrOfConstantCString(
const std::string &Str,
902 const char *GlobalName =
nullptr);
910 llvm::GlobalVariable *
916 llvm::GlobalVariable *GV);
925 QualType getObjCFastEnumerationStateType();
937 llvm::FunctionType *FnType =
nullptr,
938 bool DontDefer =
false,
943 llvm::Constant *getBuiltinLibFunction(
const FunctionDecl *FD,
949 void EmitTopLevelDecl(
Decl *D);
953 void AddDeferredUnusedCoverageMapping(
Decl *D);
957 void ClearUnusedCoverageMapping(
const Decl *D);
961 void EmitDeferredUnusedCoverageMappings();
964 void HandleCXXStaticMemberVarInstantiation(
VarDecl *VD);
969 template<
typename SomeDecl>
970 void MaybeHandleStaticInExternC(
const SomeDecl *D, llvm::GlobalValue *GV);
973 void addUsedGlobal(llvm::GlobalValue *GV);
976 void addCompilerUsedGlobal(llvm::GlobalValue *GV);
980 CXXGlobalDtors.emplace_back(DtorFn, Object);
985 CreateRuntimeFunction(llvm::FunctionType *Ty, StringRef Name,
986 llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
991 CreateBuiltinFunction(llvm::FunctionType *Ty, StringRef Name,
992 llvm::AttributeList ExtraAttrs = llvm::AttributeList());
994 llvm::Constant *CreateRuntimeVariable(llvm::Type *Ty,
1000 llvm::Constant *getNSConcreteGlobalBlock();
1001 llvm::Constant *getNSConcreteStackBlock();
1002 llvm::Constant *getBlockObjectAssign();
1003 llvm::Constant *getBlockObjectDispose();
1007 llvm::Constant *getLLVMLifetimeStartFn();
1008 llvm::Constant *getLLVMLifetimeEndFn();
1011 void UpdateCompletedType(
const TagDecl *TD);
1013 llvm::Constant *getMemberPointerConstant(
const UnaryOperator *e);
1033 void ErrorUnsupported(
const Stmt *S,
const char *Type);
1036 void ErrorUnsupported(
const Decl *D,
const char *Type);
1041 void SetInternalFunctionAttributes(
GlobalDecl GD, llvm::Function *F,
1045 void SetLLVMFunctionAttributes(
const Decl *D,
1051 void SetLLVMFunctionAttributesForDefinition(
const Decl *D, llvm::Function *F);
1061 bool ReturnTypeUsesFPRet(
QualType ResultType);
1064 bool ReturnTypeUsesFP2Ret(
QualType ResultType);
1076 void ConstructAttributeList(StringRef Name,
const CGFunctionInfo &Info,
1078 llvm::AttributeList &Attrs,
unsigned &
CallingConv,
1079 bool AttrOnCallSite);
1098 void AddDefaultFnAttrs(llvm::Function &F);
1102 TargetAttr::ParsedTargetAttr filterFunctionTargetAttrs(
const TargetAttr *TD);
1106 void getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
1112 void EmitTentativeDefinition(
const VarDecl *D);
1119 void AppendLinkerOptions(StringRef Opts);
1122 void AddDetectMismatch(StringRef Name, StringRef
Value);
1126 void AddDependentLib(StringRef Lib);
1128 void AddELFLibDirective(StringRef Lib);
1130 llvm::GlobalVariable::LinkageTypes getFunctionLinkage(
GlobalDecl GD);
1133 F->setLinkage(getFunctionLinkage(GD));
1138 llvm::GlobalVariable::LinkageTypes getVTableLinkage(
const CXXRecordDecl *RD);
1141 CharUnits GetTargetTypeStoreSize(llvm::Type *Ty)
const;
1144 llvm::GlobalValue::LinkageTypes
1146 bool IsConstantVariable);
1149 llvm::GlobalValue::LinkageTypes
1150 getLLVMLinkageVarDefinition(
const VarDecl *VD,
bool IsConstant);
1153 void EmitGlobalAnnotations();
1156 llvm::Constant *EmitAnnotationString(StringRef Str);
1171 llvm::Constant *EmitAnnotateAttr(llvm::GlobalValue *GV,
1172 const AnnotateAttr *AA,
1177 void AddGlobalAnnotations(
const ValueDecl *D, llvm::GlobalValue *GV);
1182 bool isInSanitizerBlacklist(llvm::GlobalVariable *GV,
SourceLocation Loc,
1184 StringRef
Category = StringRef())
const;
1190 StringRef
Category = StringRef())
const;
1193 return SanitizerMD.get();
1197 DeferredVTables.push_back(RD);
1206 llvm::GlobalValue *GetGlobalValue(StringRef Ref);
1212 void SetCommonAttributes(
GlobalDecl GD, llvm::GlobalValue *GV);
1214 void addReplacement(StringRef Name, llvm::Constant *C);
1216 void addGlobalValReplacement(llvm::GlobalValue *GV, llvm::Constant *C);
1232 void EmitVTableTypeMetadata(llvm::GlobalVariable *VTable,
1236 llvm::ConstantInt *CreateCrossDsoCfiTypeId(llvm::Metadata *MD);
1241 llvm::Metadata *CreateMetadataIdentifierForType(
QualType T);
1245 llvm::Metadata *CreateMetadataIdentifierForVirtualMemPtrType(
QualType T);
1250 llvm::Metadata *CreateMetadataIdentifierGeneralized(
QualType T);
1253 void CreateFunctionTypeMetadataForIcall(
const FunctionDecl *FD,
1257 bool NeedAllVtablesTypeId()
const;
1260 void AddVTableTypeMetadata(llvm::GlobalVariable *VTable,
CharUnits Offset,
1268 std::vector<const CXXRecordDecl *>
1272 llvm::Constant *getTerminateFn();
1274 llvm::SanitizerStatReport &getSanStats();
1282 llvm::Constant *getNullPointer(llvm::PointerType *T,
QualType QT);
1285 llvm::Constant *GetOrCreateLLVMFunction(
1286 StringRef MangledName, llvm::Type *Ty,
GlobalDecl D,
bool ForVTable,
1287 bool DontDefer =
false,
bool IsThunk =
false,
1288 llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
1291 llvm::Constant *GetOrCreateMultiVersionIFunc(
GlobalDecl GD,
1296 llvm::Constant *GetOrCreateLLVMGlobal(StringRef MangledName,
1297 llvm::PointerType *PTy,
1302 bool GetCPUAndFeaturesAttributes(
const Decl *D,
1303 llvm::AttrBuilder &AttrBuilder);
1304 void setNonAliasAttributes(
GlobalDecl GD, llvm::GlobalObject *GO);
1307 void SetFunctionAttributes(
GlobalDecl GD, llvm::Function *F,
1308 bool IsIncompleteFunction,
bool IsThunk);
1310 void EmitGlobalDefinition(
GlobalDecl D, llvm::GlobalValue *GV =
nullptr);
1312 void EmitGlobalFunctionDefinition(
GlobalDecl GD, llvm::GlobalValue *GV);
1313 void EmitGlobalVarDefinition(
const VarDecl *D,
bool IsTentative =
false);
1316 void emitCPUDispatchDefinition(
GlobalDecl GD);
1326 void EmitCXXThreadLocalInitFunc();
1329 void EmitCXXGlobalInitFunc();
1332 void EmitCXXGlobalDtorFunc();
1336 void EmitCXXGlobalVarDeclInitFunc(
const VarDecl *D,
1337 llvm::GlobalVariable *Addr,
1340 void EmitPointerToInitFunc(
const VarDecl *VD, llvm::GlobalVariable *Addr,
1341 llvm::Function *InitFunc, InitSegAttr *ISA);
1344 void AddGlobalCtor(llvm::Function *Ctor,
int Priority = 65535,
1345 llvm::Constant *AssociatedData =
nullptr);
1346 void AddGlobalDtor(llvm::Function *Dtor,
int Priority = 65535);
1351 void EmitCtorList(CtorList &Fns,
const char *GlobalName);
1354 void EmitDeferred();
1360 void EmitVTablesOpportunistically();
1363 void applyReplacements();
1366 void applyGlobalValReplacements();
1368 void checkAliases();
1370 std::map<int, llvm::TinyPtrVector<llvm::Function *>> DtorsUsingAtExit;
1374 void registerGlobalDtorsWithAtExit();
1376 void emitMultiVersionFunctions();
1379 void EmitDeferredVTables();
1383 void emitAtAvailableLinkGuard();
1386 void emitLLVMUsed();
1389 void EmitModuleLinkOptions();
1393 void EmitStaticExternCAliases();
1395 void EmitDeclMetadata();
1398 void EmitVersionIdentMetadata();
1401 void EmitTargetMetadata();
1404 void EmitOpenCLMetadata();
1408 void EmitCoverageFile();
1411 llvm::Constant *EmitUuidofInitializer(StringRef uuidstr);
1421 bool MayBeEmittedEagerly(
const ValueDecl *D);
1425 void SimplifyPersonality();
1429 void ConstructDefaultFnAttrList(StringRef Name,
bool HasOptnone,
1430 bool AttrOnCallSite,
1431 llvm::AttrBuilder &FuncAttrs);
1433 llvm::Metadata *CreateMetadataIdentifierImpl(
QualType T, MetadataTypeMap &Map,
1440 #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.
Represents a function declaration or definition.
bool operator==(const OrderGlobalInits &RHS) const
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()
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
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 * objc_autoreleaseReturnValue
id objc_autoreleaseReturnValue(id);
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...
llvm::Constant * objc_loadWeakRetained
id objc_loadWeakRetained(id*);
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::Constant * objc_autorelease
id objc_autorelease(id);
llvm::GlobalVariable * getStaticLocalDeclGuardAddress(const VarDecl *D)
llvm::Constant * objc_copyWeak
void objc_copyWeak(id *dest, id *src);
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...
llvm::Constant * objc_loadWeak
id objc_loadWeak(id*);
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
llvm::Constant * objc_retainAutoreleasedReturnValue
id objc_retainAutoreleasedReturnValue(id);
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...
CGCUDARuntime & getCUDARuntime()
Return a reference to the configured CUDA runtime.
llvm::Constant * objc_initWeak
id objc_initWeak(id*, id);
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 * objc_release
void objc_release(id);
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
Represents a linkage specification.
llvm::Constant * Initializer
InstrProfStats & getPGOStats()
llvm::Constant * getStaticLocalDeclAddress(const VarDecl *D)
llvm::Constant * objc_storeStrong
void objc_storeStrong(id*, id);
Represents a ValueDecl that came out of a declarator.
CtorList & getGlobalDtors()
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Exposes information about the current target.
CGObjCRuntime & getObjCRuntime()
Return a reference to the configured Objective-C runtime.
CharUnits Alignment
The alignment of the field.
Pepresents 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 ...
Expr - This represents one expression.
Defines the clang::LangOptions interface.
llvm::Constant * objc_autoreleasePoolPop
void objc_autoreleasePoolPop(void*);
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.
void AddCXXDtorEntry(llvm::Constant *DtorFn, llvm::Constant *Object)
Add a destructor and object to add to the C++ global destructor function.
llvm::Constant * objc_retain
id objc_retain(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::Constant * objc_retainBlock
id objc_retainBlock(id);
llvm::Constant * objc_storeWeak
id objc_storeWeak(id*, id);
Encodes a location in the source.
llvm::Constant * getTypeDescriptorFromMap(QualType Ty)
This represents '#pragma omp declare reduction ...' directive.
Represents the declaration of a struct/union/class/enum.
llvm::Constant * objc_autoreleasePoolPush
void *objc_autoreleasePoolPush(void);
Represents a static or instance method of a struct/union/class.
ObjCEntrypoints & getObjCEntrypoints() const
This file defines OpenMP nodes for declarative directives.
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.
llvm::Constant * objc_unsafeClaimAutoreleasedReturnValue
id objc_unsafeClaimAutoreleasedReturnValue(id);
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.
llvm::Constant * objc_destroyWeak
void objc_destroyWeak(id*);
llvm::Constant * clang_arc_use
void clang.arc.use(...);
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...
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.
llvm::Constant * objc_retainAutorelease
id objc_retainAutorelease(id);
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
void setAtomicSetterHelperFnMap(QualType Ty, llvm::Constant *Fn)
llvm::MDNode * getNoObjCARCExceptionsMetadata()
llvm::Constant * objc_moveWeak
void objc_moveWeak(id *dest, id *src);
A pair of helper functions for a __block variable.
static llvm::Constant * EmitNullConstant(CodeGenModule &CGM, const RecordDecl *record, bool asCompleteObject)
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.
A specialization of Address that requires the address to be an LLVM Constant.
OrderGlobalInits(unsigned int p, unsigned int l)
StringLiteral - This represents a string literal expression, e.g.
CGCXXABI & getCXXABI() const
GVALinkage
A more specific kind of linkage than enum Linkage.
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()
llvm::Constant * objc_retainAutoreleaseReturnValue
id objc_retainAutoreleaseReturnValue(id);
This represents '#pragma omp threadprivate ...' directive.
Abstract information about a function or function prototype.
const llvm::Triple & getTriple() const