clang  6.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::CodeGen::CodeGenModule Class Reference

This class organizes the cross-function state that is used while generating LLVM code. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/CodeGen/CodeGenModule.h"

Inheritance diagram for clang::CodeGen::CodeGenModule:
Inheritance graph
[legend]
Collaboration diagram for clang::CodeGen::CodeGenModule:
Collaboration graph
[legend]

Classes

struct  Structor
 

Public Types

typedef std::vector< StructorCtorList
 

Public Member Functions

 CodeGenModule (ASTContext &C, const HeaderSearchOptions &headersearchopts, const PreprocessorOptions &ppopts, const CodeGenOptions &CodeGenOpts, llvm::Module &M, DiagnosticsEngine &Diags, CoverageSourceInfo *CoverageInfo=nullptr)
 
 ~CodeGenModule ()
 
void clear ()
 
void Release ()
 Finalize LLVM code generation. More...
 
bool getExpressionLocationsEnabled () const
 Return true if we should emit location information for expressions. More...
 
CGObjCRuntimegetObjCRuntime ()
 Return a reference to the configured Objective-C runtime. More...
 
bool hasObjCRuntime ()
 Return true iff an Objective-C runtime has been configured. More...
 
CGOpenCLRuntimegetOpenCLRuntime ()
 Return a reference to the configured OpenCL runtime. More...
 
CGOpenMPRuntimegetOpenMPRuntime ()
 Return a reference to the configured OpenMP runtime. More...
 
CGCUDARuntimegetCUDARuntime ()
 Return a reference to the configured CUDA runtime. More...
 
ObjCEntrypointsgetObjCEntrypoints () const
 
InstrProfStatsgetPGOStats ()
 
llvm::IndexedInstrProfReader * getPGOReader () const
 
CoverageMappingModuleGengetCoverageMapping () const
 
llvm::Constant * getStaticLocalDeclAddress (const VarDecl *D)
 
void setStaticLocalDeclAddress (const VarDecl *D, llvm::Constant *C)
 
llvm::Constant * getOrCreateStaticVarDecl (const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
 
llvm::GlobalVariable * getStaticLocalDeclGuardAddress (const VarDecl *D)
 
void setStaticLocalDeclGuardAddress (const VarDecl *D, llvm::GlobalVariable *C)
 
bool lookupRepresentativeDecl (StringRef MangledName, GlobalDecl &Result) const
 
llvm::Constant * getAtomicSetterHelperFnMap (QualType Ty)
 
void setAtomicSetterHelperFnMap (QualType Ty, llvm::Constant *Fn)
 
llvm::Constant * getAtomicGetterHelperFnMap (QualType Ty)
 
void setAtomicGetterHelperFnMap (QualType Ty, llvm::Constant *Fn)
 
llvm::Constant * getTypeDescriptorFromMap (QualType Ty)
 
void setTypeDescriptorInMap (QualType Ty, llvm::Constant *C)
 
CGDebugInfogetModuleDebugInfo ()
 
llvm::MDNode * getNoObjCARCExceptionsMetadata ()
 
ASTContextgetContext () const
 
const LangOptionsgetLangOpts () const
 
const HeaderSearchOptionsgetHeaderSearchOpts () const
 
const PreprocessorOptionsgetPreprocessorOpts () const
 
const CodeGenOptionsgetCodeGenOpts () const
 
llvm::Module & getModule () const
 
DiagnosticsEnginegetDiags () const
 
const llvm::DataLayout & getDataLayout () const
 
const TargetInfogetTarget () const
 
const llvm::Triple & getTriple () const
 
bool supportsCOMDAT () const
 
void maybeSetTrivialComdat (const Decl &D, llvm::GlobalObject &GO)
 
CGCXXABIgetCXXABI () const
 
llvm::LLVMContext & getLLVMContext ()
 
bool shouldUseTBAA () const
 
const TargetCodeGenInfogetTargetCodeGenInfo ()
 
CodeGenTypesgetTypes ()
 
CodeGenVTablesgetVTables ()
 
ItaniumVTableContextgetItaniumVTableContext ()
 
MicrosoftVTableContextgetMicrosoftVTableContext ()
 
CtorListgetGlobalCtors ()
 
CtorListgetGlobalDtors ()
 
llvm::MDNode * getTBAATypeInfo (QualType QTy)
 getTBAATypeInfo - Get metadata used to describe accesses to objects of the given type. More...
 
TBAAAccessInfo getTBAAAccessInfo (QualType AccessType)
 getTBAAAccessInfo - Get TBAA information that describes an access to an object of the given type. More...
 
TBAAAccessInfo getTBAAVTablePtrAccessInfo ()
 getTBAAVTablePtrAccessInfo - Get the TBAA information that describes an access to a virtual table pointer. More...
 
llvm::MDNode * getTBAAStructInfo (QualType QTy)
 
llvm::MDNode * getTBAABaseTypeInfo (QualType QTy)
 getTBAABaseTypeInfo - Get metadata that describes the given base access type. More...
 
llvm::MDNode * getTBAAAccessTagInfo (TBAAAccessInfo Info)
 getTBAAAccessTagInfo - Get TBAA tag for a given memory access. More...
 
TBAAAccessInfo getTBAAMayAliasAccessInfo ()
 getTBAAMayAliasAccessInfo - Get TBAA information that represents may-alias accesses. More...
 
TBAAAccessInfo mergeTBAAInfoForCast (TBAAAccessInfo SourceInfo, TBAAAccessInfo TargetInfo)
 mergeTBAAInfoForCast - Get merged TBAA information for the purposes of type casts. More...
 
bool isTypeConstant (QualType QTy, bool ExcludeCtorDtor)
 isTypeConstant - Determine whether an object of this type can be emitted as a constant. More...
 
bool isPaddedAtomicType (QualType type)
 
bool isPaddedAtomicType (const AtomicType *type)
 
void DecorateInstructionWithTBAA (llvm::Instruction *Inst, TBAAAccessInfo TBAAInfo)
 DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag. More...
 
void DecorateInstructionWithInvariantGroup (llvm::Instruction *I, const CXXRecordDecl *RD)
 Adds !invariant.barrier !tag to instruction. More...
 
llvm::ConstantInt * getSize (CharUnits numChars)
 Emit the given number of characters as a value of type size_t. More...
 
void setGlobalVisibility (llvm::GlobalValue *GV, const NamedDecl *D) const
 Set the visibility for the given LLVM GlobalValue. More...
 
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. More...
 
llvm::Constant * GetAddrOfGlobal (GlobalDecl GD, ForDefinition_t IsForDefinition=NotForDefinition)
 
llvm::GlobalVariable * CreateOrReplaceCXXRuntimeVariable (StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage)
 Will return a global variable of the given type. More...
 
llvm::Function * CreateGlobalInitOrDestructFunction (llvm::FunctionType *ty, const Twine &name, const CGFunctionInfo &FI, SourceLocation Loc=SourceLocation(), bool TLS=false)
 
LangAS GetGlobalVarAddressSpace (const VarDecl *D)
 Return the AST address space of the underlying global variable for D, as determined by its declaration. More...
 
llvm::Constant * GetAddrOfGlobalVar (const VarDecl *D, llvm::Type *Ty=nullptr, ForDefinition_t IsForDefinition=NotForDefinition)
 Return the llvm::Constant for the address of the given global variable. More...
 
llvm::Constant * GetAddrOfFunction (GlobalDecl GD, llvm::Type *Ty=nullptr, bool ForVTable=false, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition)
 Return the address of the given function. More...
 
llvm::Constant * GetAddrOfRTTIDescriptor (QualType Ty, bool ForEH=false)
 Get the address of the RTTI descriptor for the given type. More...
 
ConstantAddress GetAddrOfUuidDescriptor (const CXXUuidofExpr *E)
 Get the address of a uuid descriptor . More...
 
llvm::Constant * GetAddrOfThunk (GlobalDecl GD, const ThunkInfo &Thunk)
 Get the address of the thunk for the given global decl. More...
 
ConstantAddress GetWeakRefReference (const ValueDecl *VD)
 Get a reference to the target of VD. More...
 
CharUnits getClassPointerAlignment (const CXXRecordDecl *CD)
 Returns the assumed alignment of an opaque pointer to the given class. More...
 
CharUnits getVBaseAlignment (CharUnits DerivedAlign, const CXXRecordDecl *Derived, const CXXRecordDecl *VBase)
 Returns the assumed alignment of a virtual base of a class. More...
 
CharUnits getDynamicOffsetAlignment (CharUnits ActualAlign, const CXXRecordDecl *Class, CharUnits ExpectedTargetAlign)
 Given a class pointer with an actual known alignment, and the expected alignment of an object at a dynamic offset w.r.t that pointer, return the alignment to assume at the offset. More...
 
CharUnits computeNonVirtualBaseClassOffset (const CXXRecordDecl *DerivedClass, CastExpr::path_const_iterator Start, CastExpr::path_const_iterator End)
 
llvm::Constant * GetNonVirtualBaseClassOffset (const CXXRecordDecl *ClassDecl, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd)
 Returns the offset from a derived class to a class. More...
 
int getUniqueBlockCount ()
 Fetches the global unique block count. More...
 
llvm::TypegetBlockDescriptorType ()
 Fetches the type of a generic block descriptor. More...
 
llvm::TypegetGenericBlockLiteralType ()
 The type of a generic block literal. More...
 
llvm::Constant * GetAddrOfGlobalBlock (const BlockExpr *BE, StringRef Name)
 Gets the address of a block which requires no captures. More...
 
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 BE. More...
 
void setAddrOfGlobalBlock (const BlockExpr *BE, llvm::Constant *Addr)
 Notes that BE's global block is available via Addr. More...
 
ConstantAddress GetAddrOfConstantCFString (const StringLiteral *Literal)
 Return a pointer to a constant CFString object for the given string. More...
 
ConstantAddress GetAddrOfConstantString (const StringLiteral *Literal)
 Return a pointer to a constant NSString object for the given string. More...
 
llvm::Constant * GetConstantArrayFromStringLiteral (const StringLiteral *E)
 Return a constant array for the given string. More...
 
ConstantAddress GetAddrOfConstantStringFromLiteral (const StringLiteral *S, StringRef Name=".str")
 Return a pointer to a constant array for the given string literal. More...
 
ConstantAddress GetAddrOfConstantStringFromObjCEncode (const ObjCEncodeExpr *)
 Return a pointer to a constant array for the given ObjCEncodeExpr node. More...
 
ConstantAddress GetAddrOfConstantCString (const std::string &Str, const char *GlobalName=nullptr)
 Returns a pointer to a character array containing the literal and a terminating '\0' character. More...
 
ConstantAddress GetAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *E)
 Returns a pointer to a constant global variable for the given file-scope compound literal expression. More...
 
llvm::GlobalVariable * getAddrOfConstantCompoundLiteralIfEmitted (const CompoundLiteralExpr *E)
 If it's been emitted already, returns the GlobalVariable corresponding to a compound literal. More...
 
void setAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *CLE, llvm::GlobalVariable *GV)
 Notes that CLE's GlobalVariable is GV. More...
 
ConstantAddress GetAddrOfGlobalTemporary (const MaterializeTemporaryExpr *E, const Expr *Inner)
 Returns a pointer to a global variable representing a temporary with static or thread storage duration. More...
 
QualType getObjCFastEnumerationStateType ()
 Retrieve the record type that describes the state of an Objective-C fast enumeration loop (for..in). More...
 
llvm::Function * codegenCXXStructor (const CXXMethodDecl *MD, StructorType Type)
 
llvm::Constant * getAddrOfCXXStructor (const CXXMethodDecl *MD, StructorType Type, 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. More...
 
llvm::Constant * getBuiltinLibFunction (const FunctionDecl *FD, unsigned BuiltinID)
 Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf". More...
 
llvm::Function * getIntrinsic (unsigned IID, ArrayRef< llvm::Type *> Tys=None)
 
void EmitTopLevelDecl (Decl *D)
 Emit code for a single top level declaration. More...
 
void AddDeferredUnusedCoverageMapping (Decl *D)
 Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration. More...
 
void ClearUnusedCoverageMapping (const Decl *D)
 Remove the deferred empty coverage mapping as this declaration is actually instrumented. More...
 
void EmitDeferredUnusedCoverageMappings ()
 Emit all the deferred coverage mappings for the uninstrumented functions. More...
 
void HandleCXXStaticMemberVarInstantiation (VarDecl *VD)
 Tell the consumer that this variable has been instantiated. More...
 
template<typename SomeDecl >
void MaybeHandleStaticInExternC (const SomeDecl *D, llvm::GlobalValue *GV)
 If the declaration has internal linkage but is inside an extern "C" linkage specification, prepare to emit an alias for it to the expected name. More...
 
void addUsedGlobal (llvm::GlobalValue *GV)
 Add a global to a list to be added to the llvm.used metadata. More...
 
void addCompilerUsedGlobal (llvm::GlobalValue *GV)
 Add a global to a list to be added to the llvm.compiler.used metadata. More...
 
void AddCXXDtorEntry (llvm::Constant *DtorFn, llvm::Constant *Object)
 Add a destructor and object to add to the C++ global destructor function. More...
 
llvm::Constant * CreateRuntimeFunction (llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs=llvm::AttributeList(), bool Local=false)
 Create a new runtime function with the specified type and name. More...
 
llvm::Constant * CreateBuiltinFunction (llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs=llvm::AttributeList())
 Create a new compiler builtin function with the specified type and name. More...
 
llvm::Constant * CreateRuntimeVariable (llvm::Type *Ty, StringRef Name)
 Create a new runtime global variable with the specified type and name. More...
 
llvm::Constant * getLLVMLifetimeStartFn ()
 Lazily declare the .lifetime.start intrinsic. More...
 
llvm::Constant * getLLVMLifetimeEndFn ()
 Lazily declare the .lifetime.end intrinsic. More...
 
void UpdateCompletedType (const TagDecl *TD)
 
llvm::Constant * getMemberPointerConstant (const UnaryOperator *e)
 
void EmitExplicitCastExprType (const ExplicitCastExpr *E, CodeGenFunction *CGF=nullptr)
 Emit type info if type of an expression is a variably modified type. More...
 
llvm::Constant * EmitNullConstant (QualType T)
 Return the result of value-initializing the given type, i.e. More...
 
llvm::Constant * EmitNullConstantForBase (const CXXRecordDecl *Record)
 Return a null constant appropriate for zero-initializing a base class with the given type. More...
 
void Error (SourceLocation loc, StringRef error)
 Emit a general error that something can't be done. More...
 
void ErrorUnsupported (const Stmt *S, const char *Type)
 Print out an error that codegen doesn't support the specified stmt yet. More...
 
void ErrorUnsupported (const Decl *D, const char *Type)
 Print out an error that codegen doesn't support the specified decl yet. More...
 
void SetInternalFunctionAttributes (const Decl *D, llvm::Function *F, const CGFunctionInfo &FI)
 Set the attributes on the LLVM function for the given decl and function info. More...
 
void SetLLVMFunctionAttributes (const Decl *D, const CGFunctionInfo &Info, llvm::Function *F)
 Set the LLVM function attributes (sext, zext, etc). More...
 
void SetLLVMFunctionAttributesForDefinition (const Decl *D, llvm::Function *F)
 Set the LLVM function attributes which only apply to a function definition. More...
 
bool ReturnTypeUsesSRet (const CGFunctionInfo &FI)
 Return true iff the given type uses 'sret' when used as a return type. More...
 
bool ReturnSlotInterferesWithArgs (const CGFunctionInfo &FI)
 Return true iff the given type uses an argument slot when 'sret' is used as a return type. More...
 
bool ReturnTypeUsesFPRet (QualType ResultType)
 Return true iff the given type uses 'fpret' when used as a return type. More...
 
bool ReturnTypeUsesFP2Ret (QualType ResultType)
 Return true iff the given type uses 'fp2ret' when used as a return type. More...
 
void ConstructAttributeList (StringRef Name, const CGFunctionInfo &Info, CGCalleeInfo CalleeInfo, llvm::AttributeList &Attrs, unsigned &CallingConv, bool AttrOnCallSite)
 Get the LLVM attributes and calling convention to use for a particular function type. More...
 
void AddDefaultFnAttrs (llvm::Function &F)
 Adds attributes to F according to our CodeGenOptions and LangOptions, as though we had emitted it ourselves. More...
 
void getFunctionFeatureMap (llvm::StringMap< bool > &FeatureMap, const FunctionDecl *FD)
 
StringRef getMangledName (GlobalDecl GD)
 
StringRef getBlockMangledName (GlobalDecl GD, const BlockDecl *BD)
 
void EmitTentativeDefinition (const VarDecl *D)
 
void EmitVTable (CXXRecordDecl *Class)
 This is a callback from Sema to tell us that that a particular vtable is required to be emitted in this translation unit. More...
 
void RefreshTypeCacheForClass (const CXXRecordDecl *Class)
 
void AppendLinkerOptions (StringRef Opts)
 Appends Opts to the "llvm.linker.options" metadata value. More...
 
void AddDetectMismatch (StringRef Name, StringRef Value)
 Appends a detect mismatch command to the linker options. More...
 
void AddDependentLib (StringRef Lib)
 Appends a dependent lib to the "llvm.linker.options" metadata value. More...
 
llvm::GlobalVariable::LinkageTypes getFunctionLinkage (GlobalDecl GD)
 
void setFunctionLinkage (GlobalDecl GD, llvm::Function *F)
 
void setFunctionDLLStorageClass (GlobalDecl GD, llvm::Function *F)
 Set the DLL storage class on F. More...
 
llvm::GlobalVariable::LinkageTypes getVTableLinkage (const CXXRecordDecl *RD)
 Return the appropriate linkage for the vtable, VTT, and type information of the given class. More...
 
CharUnits GetTargetTypeStoreSize (llvm::Type *Ty) const
 Return the store size, in character units, of the given LLVM type. More...
 
llvm::GlobalValue::LinkageTypes getLLVMLinkageForDeclarator (const DeclaratorDecl *D, GVALinkage Linkage, bool IsConstantVariable)
 Returns LLVM linkage for a declarator. More...
 
llvm::GlobalValue::LinkageTypes getLLVMLinkageVarDefinition (const VarDecl *VD, bool IsConstant)
 Returns LLVM linkage for a declarator. More...
 
void EmitGlobalAnnotations ()
 Emit all the global annotations. More...
 
llvm::Constant * EmitAnnotationString (StringRef Str)
 Emit an annotation string. More...
 
llvm::Constant * EmitAnnotationUnit (SourceLocation Loc)
 Emit the annotation's translation unit. More...
 
llvm::Constant * EmitAnnotationLineNo (SourceLocation L)
 Emit the annotation line number. More...
 
llvm::Constant * EmitAnnotateAttr (llvm::GlobalValue *GV, const AnnotateAttr *AA, SourceLocation L)
 Generate the llvm::ConstantStruct which contains the annotation information for a given GlobalValue. More...
 
void AddGlobalAnnotations (const ValueDecl *D, llvm::GlobalValue *GV)
 Add global annotations that are set on D, for the global GV. More...
 
bool isInSanitizerBlacklist (SanitizerMask Kind, llvm::Function *Fn, SourceLocation Loc) const
 
bool isInSanitizerBlacklist (llvm::GlobalVariable *GV, SourceLocation Loc, QualType Ty, StringRef Category=StringRef()) const
 
bool imbueXRayAttrs (llvm::Function *Fn, SourceLocation Loc, StringRef Category=StringRef()) const
 Imbue XRay attributes to a function, applying the always/never attribute lists in the process. More...
 
SanitizerMetadatagetSanitizerMetadata ()
 
void addDeferredVTable (const CXXRecordDecl *RD)
 
void EmitGlobal (GlobalDecl D)
 Emit code for a singal global function or var decl. More...
 
bool TryEmitDefinitionAsAlias (GlobalDecl Alias, GlobalDecl Target)
 Try to emit a definition as a global alias for another definition. More...
 
bool TryEmitBaseDestructorAsAlias (const CXXDestructorDecl *D)
 Try to emit a base destructor as an alias to its primary base-class destructor. More...
 
void setFunctionDefinitionAttributes (const FunctionDecl *D, llvm::Function *F)
 Set attributes for a global definition. More...
 
llvm::GlobalValue * GetGlobalValue (StringRef Ref)
 
void SetCommonAttributes (const Decl *D, llvm::GlobalValue *GV)
 Set attributes which are common to any form of a global definition (alias, Objective-C method, function, global variable). More...
 
void setAliasAttributes (const Decl *D, llvm::GlobalValue *GV)
 Set attributes which must be preserved by an alias. More...
 
void addReplacement (StringRef Name, llvm::Constant *C)
 
void addGlobalValReplacement (llvm::GlobalValue *GV, llvm::Constant *C)
 
void EmitOMPThreadPrivateDecl (const OMPThreadPrivateDecl *D)
 Emit a code for threadprivate directive. More...
 
void EmitOMPDeclareReduction (const OMPDeclareReductionDecl *D, CodeGenFunction *CGF=nullptr)
 Emit a code for declare reduction construct. More...
 
bool HasHiddenLTOVisibility (const CXXRecordDecl *RD)
 Returns whether the given record has hidden LTO visibility and therefore may participate in (single-module) CFI and whole-program vtable optimization. More...
 
void EmitVTableTypeMetadata (llvm::GlobalVariable *VTable, const VTableLayout &VTLayout)
 Emit type metadata for the given vtable using the given layout. More...
 
llvm::ConstantInt * CreateCrossDsoCfiTypeId (llvm::Metadata *MD)
 Generate a cross-DSO type identifier for MD. More...
 
llvm::Metadata * CreateMetadataIdentifierForType (QualType T)
 Create a metadata identifier for the given type. More...
 
void CreateFunctionTypeMetadata (const FunctionDecl *FD, llvm::Function *F)
 Create and attach type metadata to the given function. More...
 
bool NeedAllVtablesTypeId () const
 Returns whether this module needs the "all-vtables" type identifier. More...
 
void AddVTableTypeMetadata (llvm::GlobalVariable *VTable, CharUnits Offset, const CXXRecordDecl *RD)
 Create and attach type metadata for the given vtable. More...
 
llvm::Constant * getTerminateFn ()
 Get the declaration of std::terminate for the platform. More...
 
llvm::SanitizerStatReport & getSanStats ()
 
llvm::ValuecreateOpenCLIntToSamplerConversion (const Expr *E, CodeGenFunction &CGF)
 
llvm::Constant * getNullPointer (llvm::PointerType *T, QualType QT)
 Get target specific null pointer. More...
 
Custom Blocks Runtime Interfaces
llvm::Constant * getNSConcreteGlobalBlock ()
 
llvm::Constant * getNSConcreteStackBlock ()
 
llvm::Constant * getBlockObjectAssign ()
 
llvm::Constant * getBlockObjectDispose ()
 
- Public Member Functions inherited from clang::CodeGen::CodeGenTypeCache
CharUnits getIntSize () const
 
CharUnits getIntAlign () const
 
CharUnits getSizeSize () const
 
CharUnits getSizeAlign () const
 
CharUnits getPointerSize () const
 
CharUnits getPointerAlign () const
 
llvm::CallingConv::ID getRuntimeCC () const
 
llvm::CallingConv::ID getBuiltinCC () const
 
LangAS getASTAllocaAddressSpace () const
 

Static Public Member Functions

static llvm::GlobalValue::VisibilityTypes GetLLVMVisibility (Visibility V)
 

Public Attributes

llvm::Constant * IsOSVersionAtLeastFn = nullptr
 
llvm::FoldingSet< BlockByrefHelpersByrefHelpersCache
 
int GlobalUniqueCount
 
- Public Attributes inherited from clang::CodeGen::CodeGenTypeCache
llvm::TypeVoidTy
 void More...
 
llvm::IntegerType * Int8Ty
 i8, i16, i32, and i64 More...
 
llvm::IntegerType * Int16Ty
 
llvm::IntegerType * Int32Ty
 
llvm::IntegerType * Int64Ty
 
llvm::TypeFloatTy
 float, double More...
 
llvm::TypeDoubleTy
 
llvm::IntegerType * IntTy
 int More...
 
union {
   llvm::IntegerType *   IntPtrTy
 
   llvm::IntegerType *   SizeTy
 
   llvm::IntegerType *   PtrDiffTy
 
}; 
 intptr_t, size_t, and ptrdiff_t, which we assume are the same size. More...
 
union {
   llvm::PointerType *   VoidPtrTy
 
   llvm::PointerType *   Int8PtrTy
 
}; 
 void* in address space 0 More...
 
union {
   llvm::PointerType *   VoidPtrPtrTy
 
   llvm::PointerType *   Int8PtrPtrTy
 
}; 
 void** in address space 0 More...
 
union {
   llvm::PointerType *   AllocaVoidPtrTy
 
   llvm::PointerType *   AllocaInt8PtrTy
 
}; 
 void* in alloca address space More...
 
union {
   unsigned char   IntSizeInBytes
 
   unsigned char   IntAlignInBytes
 
}; 
 The size and alignment of the builtin C type 'int'. More...
 
unsigned char PointerWidthInBits
 The width of a pointer into the generic address space. More...
 
union {
   unsigned char   PointerAlignInBytes
 
   unsigned char   PointerSizeInBytes
 
}; 
 The size and alignment of a pointer into the generic address space. More...
 
union {
   unsigned char   SizeSizeInBytes
 
   unsigned char   SizeAlignInBytes
 
}; 
 The size and alignment of size_t. More...
 
LangAS ASTAllocaAddressSpace
 
llvm::CallingConv::ID RuntimeCC
 
llvm::CallingConv::ID BuiltinCC
 

Detailed Description

This class organizes the cross-function state that is used while generating LLVM code.

Definition at line 252 of file CodeGenModule.h.

Member Typedef Documentation

◆ CtorList

Definition at line 268 of file CodeGenModule.h.

Constructor & Destructor Documentation

◆ CodeGenModule()

CodeGenModule::CodeGenModule ( ASTContext C,
const HeaderSearchOptions headersearchopts,
const PreprocessorOptions ppopts,
const CodeGenOptions CodeGenOpts,
llvm::Module &  M,
DiagnosticsEngine Diags,
CoverageSourceInfo CoverageInfo = nullptr 
)

Definition at line 88 of file CodeGenModule.cpp.

◆ ~CodeGenModule()

CodeGenModule::~CodeGenModule ( )

Member Function Documentation

◆ addCompilerUsedGlobal()

void CodeGenModule::addCompilerUsedGlobal ( llvm::GlobalValue *  GV)

Add a global to a list to be added to the llvm.compiler.used metadata.

Definition at line 1240 of file CodeGenModule.cpp.

Referenced by GetGCAttrTypeForType().

◆ AddCXXDtorEntry()

void clang::CodeGen::CodeGenModule::AddCXXDtorEntry ( llvm::Constant *  DtorFn,
llvm::Constant *  Object 
)
inline

Add a destructor and object to add to the C++ global destructor function.

Definition at line 931 of file CodeGenModule.h.

References EmitNullConstant(), EmitNullConstantForBase(), and clang::T.

◆ AddDefaultFnAttrs()

void CodeGenModule::AddDefaultFnAttrs ( llvm::Function &  F)

Adds attributes to F according to our CodeGenOptions and LangOptions, as though we had emitted it ourselves.

We remove any attributes on F that conflict with the attributes we add here.

This is useful for adding attrs to bitcode modules that you want to link with but don't control, such as CUDA's libdevice. When linking with such a bitcode library, you might want to set e.g. its functions' "unsafe-fp-math" attribute to match the attr of the functions you're codegen'ing. Otherwise, LLVM will interpret the bitcode module's lack of unsafe-fp-math attrs as tantamount to unsafe-fp-math=false, and then LLVM will propagate unsafe-fp-math=false up to every transitive caller of a function in the bitcode library!

With the exception of fast-math attrs, this will only make the attributes on the function more conservative. But it's unsafe to call this on a function which relies on particular fast-math attributes for correctness. It's up to you to ensure that this is safe.

Definition at line 1772 of file CGCall.cpp.

◆ AddDeferredUnusedCoverageMapping()

void CodeGenModule::AddDeferredUnusedCoverageMapping ( Decl D)

Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration.

Definition at line 4238 of file CodeGenModule.cpp.

References getContext(), clang::SourceManager::getFileID(), clang::Decl::getKind(), clang::Decl::getLocStart(), clang::SourceManager::getMainFileID(), clang::ASTContext::getSourceManager(), LimitedCoverage(), and SM.

Referenced by EmitTopLevelDecl().

◆ addDeferredVTable()

void clang::CodeGen::CodeGenModule::addDeferredVTable ( const CXXRecordDecl RD)
inline

Definition at line 1145 of file CodeGenModule.h.

References clang::CodeGen::NotForDefinition.

◆ AddDependentLib()

void CodeGenModule::AddDependentLib ( StringRef  Lib)

Appends a dependent lib to the "llvm.linker.options" metadata value.

Definition at line 1289 of file CodeGenModule.cpp.

References clang::CodeGen::TargetCodeGenInfo::getDependentLibraryOption(), getLLVMContext(), and getTargetCodeGenInfo().

◆ AddDetectMismatch()

void CodeGenModule::AddDetectMismatch ( StringRef  Name,
StringRef  Value 
)

Appends a detect mismatch command to the linker options.

Definition at line 1282 of file CodeGenModule.cpp.

◆ AddGlobalAnnotations()

void CodeGenModule::AddGlobalAnnotations ( const ValueDecl D,
llvm::GlobalValue *  GV 
)

Add global annotations that are set on D, for the global GV.

Those annotations are emitted during finalization of the LLVM code.

Definition at line 1544 of file CodeGenModule.cpp.

References clang::Decl::hasAttr().

Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), HandleCXXStaticMemberVarInstantiation(), and maybeSetTrivialComdat().

◆ addGlobalValReplacement()

void CodeGenModule::addGlobalValReplacement ( llvm::GlobalValue *  GV,
llvm::Constant *  C 
)

Definition at line 254 of file CodeGenModule.cpp.

◆ addReplacement()

void CodeGenModule::addReplacement ( StringRef  Name,
llvm::Constant *  C 
)

Definition at line 219 of file CodeGenModule.cpp.

Referenced by emitConstructorDestructorAlias(), and TryEmitDefinitionAsAlias().

◆ addUsedGlobal()

void CodeGenModule::addUsedGlobal ( llvm::GlobalValue *  GV)

Add a global to a list to be added to the llvm.used metadata.

Definition at line 1234 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitGlobalDtorWithTLRegDtor(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().

◆ AddVTableTypeMetadata()

void CodeGenModule::AddVTableTypeMetadata ( llvm::GlobalVariable *  VTable,
CharUnits  Offset,
const CXXRecordDecl RD 
)

◆ AppendLinkerOptions()

void CodeGenModule::AppendLinkerOptions ( StringRef  Opts)

Appends Opts to the "llvm.linker.options" metadata value.

Definition at line 1277 of file CodeGenModule.cpp.

References getLLVMContext().

Referenced by emitGlobalDtorWithTLRegDtor().

◆ clear()

void CodeGenModule::clear ( )

Definition at line 365 of file CodeGenModule.cpp.

◆ ClearUnusedCoverageMapping()

void CodeGenModule::ClearUnusedCoverageMapping ( const Decl D)

Remove the deferred empty coverage mapping as this declaration is actually instrumented.

Definition at line 4264 of file CodeGenModule.cpp.

◆ codegenCXXStructor()

llvm::Function * CodeGenModule::codegenCXXStructor ( const CXXMethodDecl MD,
StructorType  Type 
)

◆ computeNonVirtualBaseClassOffset()

CharUnits CodeGenModule::computeNonVirtualBaseClassOffset ( const CXXRecordDecl DerivedClass,
CastExpr::path_const_iterator  Start,
CastExpr::path_const_iterator  End 
)

Definition at line 149 of file CGClass.cpp.

References getContext(), and clang::CharUnits::Zero().

Referenced by GetNonVirtualBaseClassOffset().

◆ ConstructAttributeList()

void CodeGenModule::ConstructAttributeList ( StringRef  Name,
const CGFunctionInfo Info,
CGCalleeInfo  CalleeInfo,
llvm::AttributeList &  Attrs,
unsigned &  CallingConv,
bool  AttrOnCallSite 
)

Get the LLVM attributes and calling convention to use for a particular function type.

Parameters
Name- The function name.
Info- The function type information.
CalleeInfo- The callee information these attributes are being constructed for. If valid, the attributes applied to this decl may contribute to the function attributes and calling convention.
Attrs[out] - On return, the attribute list to use.
CallingConv[out] - On return, the LLVM calling convention to use.

Definition at line 1780 of file CGCall.cpp.

References AddAttributesFromFunctionProtoType(), clang::CodeGen::ABIArgInfo::CoerceAndExpand, clang::TargetOptions::CPU, clang::CodeGen::ABIArgInfo::Direct, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::TargetOptions::Features, clang::Type::getAs(), clang::Decl::getAttr(), clang::CodeGen::CGCalleeInfo::getCalleeDecl(), clang::CodeGen::CGCalleeInfo::getCalleeFunctionProtoType(), clang::CodeGen::CodeGenTypes::getContext(), clang::CodeGen::CGFunctionInfo::getEffectiveCallingConvention(), clang::CodeGen::ABIArgInfo::getInReg(), clang::CodeGen::ABIArgInfo::getKind(), clang::CodeGen::CodeGenTypes::getLLVMContext(), clang::Type::getPointeeType(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::CodeGenTypes::getTarget(), clang::TargetInfo::getTargetOpts(), clang::Decl::hasAttr(), clang::Type::hasSignedIntegerRepresentation(), clang::Type::hasUnsignedIntegerRepresentation(), clang::CodeGen::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::Type::isConstantSizeType(), clang::Type::isIncompleteType(), clang::CodeGen::CGFunctionInfo::isNoReturn(), and clang::CXXMethodDecl::isVirtual().

Referenced by SetLLVMFunctionAttributes().

◆ CreateBuiltinFunction()

llvm::Constant * CodeGenModule::CreateBuiltinFunction ( llvm::FunctionType *  FTy,
StringRef  Name,
llvm::AttributeList  ExtraAttrs = llvm::AttributeList() 
)

Create a new compiler builtin function with the specified type and name.

CreateBuiltinFunction - Create a new builtin function with the specified type and name.

Definition at line 2300 of file CodeGenModule.cpp.

◆ CreateCrossDsoCfiTypeId()

llvm::ConstantInt * CodeGenModule::CreateCrossDsoCfiTypeId ( llvm::Metadata *  MD)

Generate a cross-DSO type identifier for MD.

Definition at line 886 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTypeCache::Int64Ty.

Referenced by AddVTableTypeMetadata(), and CreateFunctionTypeMetadata().

◆ CreateFunctionTypeMetadata()

void CodeGenModule::CreateFunctionTypeMetadata ( const FunctionDecl FD,
llvm::Function *  F 
)

◆ CreateGlobalInitOrDestructFunction()

llvm::Function * CodeGenModule::CreateGlobalInitOrDestructFunction ( llvm::FunctionType *  ty,
const Twine &  name,
const CGFunctionInfo FI,
SourceLocation  Loc = SourceLocation(),
bool  TLS = false 
)

◆ CreateMetadataIdentifierForType()

llvm::Metadata * CodeGenModule::CreateMetadataIdentifierForType ( QualType  T)

Create a metadata identifier for the given type.

This may either be an MDString (for external identifiers) or a distinct unnamed MDNode (for internal identifiers).

Definition at line 4525 of file CodeGenModule.cpp.

References clang::QualType::getCanonicalType(), getCXXABI(), clang::Type::getLinkage(), getLLVMContext(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::isExternallyVisible(), and clang::MangleContext::mangleTypeName().

Referenced by AddVTableTypeMetadata(), and CreateFunctionTypeMetadata().

◆ createOpenCLIntToSamplerConversion()

llvm::Value * CodeGenModule::createOpenCLIntToSamplerConversion ( const Expr E,
CodeGenFunction CGF 
)

◆ CreateOrReplaceCXXRuntimeVariable()

llvm::GlobalVariable * CodeGenModule::CreateOrReplaceCXXRuntimeVariable ( StringRef  Name,
llvm::Type Ty,
llvm::GlobalValue::LinkageTypes  Linkage 
)

Will return a global variable of the given type.

If a variable with a different type already exists then a new variable with the right type will be created and all uses of the old variable will be replaced with a bitcast to the new variable.

Definition at line 2546 of file CodeGenModule.cpp.

◆ CreateRuntimeFunction()

llvm::Constant * CodeGenModule::CreateRuntimeFunction ( llvm::FunctionType *  FTy,
StringRef  Name,
llvm::AttributeList  ExtraAttrs = llvm::AttributeList(),
bool  Local = false 
)

◆ CreateRuntimeVariable()

llvm::Constant * CodeGenModule::CreateRuntimeVariable ( llvm::Type Ty,
StringRef  Name 
)

Create a new runtime global variable with the specified type and name.

CreateRuntimeVariable - Create a new runtime global variable with the specified type and name.

Definition at line 2611 of file CodeGenModule.cpp.

Referenced by emitGlobalDtorWithCXAAtExit(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), GetAddrOfConstantCFString(), and GetConstantStringEntry().

◆ DecorateInstructionWithInvariantGroup()

void CodeGenModule::DecorateInstructionWithInvariantGroup ( llvm::Instruction *  I,
const CXXRecordDecl RD 
)

Adds !invariant.barrier !tag to instruction.

Definition at line 628 of file CodeGenModule.cpp.

◆ DecorateInstructionWithTBAA()

void CodeGenModule::DecorateInstructionWithTBAA ( llvm::Instruction *  Inst,
TBAAAccessInfo  TBAAInfo 
)

DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag.

Definition at line 622 of file CodeGenModule.cpp.

References getTBAAAccessTagInfo().

Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), and clang::CodeGen::CodeGenFunction::EmitStoreOfScalar().

◆ EmitAnnotateAttr()

llvm::Constant * CodeGenModule::EmitAnnotateAttr ( llvm::GlobalValue *  GV,
const AnnotateAttr *  AA,
SourceLocation  L 
)

Generate the llvm::ConstantStruct which contains the annotation information for a given GlobalValue.

The annotation struct is {i8 *, i8 *, i8 *, i32}. The first field is a constant expression, the GlobalValue being annotated. The second field is the constant string created from the AnnotateAttr's annotation. The third field is a constant string containing the name of the translation unit. The fourth field is the line number in the file of the annotated value declaration.

Definition at line 1526 of file CodeGenModule.cpp.

References EmitAnnotationLineNo(), EmitAnnotationString(), EmitAnnotationUnit(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.

◆ EmitAnnotationLineNo()

llvm::Constant * CodeGenModule::EmitAnnotationLineNo ( SourceLocation  L)

◆ EmitAnnotationString()

llvm::Constant * CodeGenModule::EmitAnnotationString ( StringRef  Str)

Emit an annotation string.

Definition at line 1494 of file CodeGenModule.cpp.

References getLLVMContext(), and getModule().

Referenced by EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitAnnotationCall(), and EmitAnnotationUnit().

◆ EmitAnnotationUnit()

llvm::Constant * CodeGenModule::EmitAnnotationUnit ( SourceLocation  Loc)

◆ EmitDeferredUnusedCoverageMappings()

void CodeGenModule::EmitDeferredUnusedCoverageMappings ( )

Emit all the deferred coverage mappings for the uninstrumented functions.

Definition at line 4279 of file CodeGenModule.cpp.

Referenced by Release().

◆ EmitExplicitCastExprType()

void CodeGenModule::EmitExplicitCastExprType ( const ExplicitCastExpr E,
CodeGenFunction CGF = nullptr 
)

Emit type info if type of an expression is a variably modified type.

Also emit proper debug info for cast types.

Definition at line 902 of file CGExpr.cpp.

Referenced by findPeephole().

◆ EmitGlobal()

void CodeGenModule::EmitGlobal ( GlobalDecl  D)

◆ EmitGlobalAnnotations()

void CodeGenModule::EmitGlobalAnnotations ( )

Emit all the global annotations.

Definition at line 1481 of file CodeGenModule.cpp.

References getModule().

Referenced by Release().

◆ EmitNullConstant()

llvm::Constant * CodeGenModule::EmitNullConstant ( QualType  T)

◆ EmitNullConstantForBase()

llvm::Constant * CodeGenModule::EmitNullConstantForBase ( const CXXRecordDecl Record)

Return a null constant appropriate for zero-initializing a base class with the given type.

This is usually, but not always, an LLVM null constant.

Definition at line 2121 of file CGExprConstant.cpp.

References EmitNullConstant().

Referenced by EmitNullBaseClassInitialization().

◆ EmitOMPDeclareReduction()

void CodeGenModule::EmitOMPDeclareReduction ( const OMPDeclareReductionDecl D,
CodeGenFunction CGF = nullptr 
)

Emit a code for declare reduction construct.

Definition at line 1939 of file CGDecl.cpp.

References clang::Decl::isUsed().

Referenced by clang::CodeGen::CodeGenFunction::EmitDecl(), and EmitGlobal().

◆ EmitOMPThreadPrivateDecl()

void CodeGenModule::EmitOMPThreadPrivateDecl ( const OMPThreadPrivateDecl D)

Emit a code for threadprivate directive.

Parameters
DThreadprivate declaration.

Definition at line 4510 of file CodeGenModule.cpp.

References clang::CodeGen::emitThreadPrivateVarDefinition(), GetAddrOfGlobalVar(), getContext(), getDeclAlign(), getOpenMPRuntime(), and clang::OMPThreadPrivateDecl::varlists().

◆ EmitTentativeDefinition()

void CodeGenModule::EmitTentativeDefinition ( const VarDecl D)

Definition at line 2616 of file CodeGenModule.cpp.

References GetGlobalValue(), clang::VarDecl::getInit(), and getMangledName().

◆ EmitTopLevelDecl()

void CodeGenModule::EmitTopLevelDecl ( Decl D)

◆ EmitVTable()

void CodeGenModule::EmitVTable ( CXXRecordDecl theClass)

This is a callback from Sema to tell us that that a particular vtable is required to be emitted in this translation unit.

This is only called for vtables that must be emitted (mainly due to key functions). For weak vtables, CodeGen tracks when they are needed and emits them as-needed.

Definition at line 822 of file CGVTables.cpp.

◆ EmitVTableTypeMetadata()

void CodeGenModule::EmitVTableTypeMetadata ( llvm::GlobalVariable *  VTable,
const VTableLayout VTLayout 
)

Emit type metadata for the given vtable using the given layout.

Definition at line 946 of file CGVTables.cpp.

◆ Error()

void CodeGenModule::Error ( SourceLocation  loc,
StringRef  error 
)

◆ ErrorUnsupported() [1/2]

void CodeGenModule::ErrorUnsupported ( const Stmt S,
const char *  Type 
)

Print out an error that codegen doesn't support the specified stmt yet.

ErrorUnsupported - Print out an error that codegen doesn't support the specified stmt yet.

Definition at line 641 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), AddVariableConstraints(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), and maybeSetTrivialComdat().

◆ ErrorUnsupported() [2/2]

void CodeGenModule::ErrorUnsupported ( const Decl D,
const char *  Type 
)

Print out an error that codegen doesn't support the specified decl yet.

ErrorUnsupported - Print out an error that codegen doesn't support the specified decl yet.

Definition at line 651 of file CodeGenModule.cpp.

References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getFullLoc(), clang::Decl::getLocation(), clang::DiagnosticsEngine::Report(), and clang::CodeGen::Type.

◆ GetAddrOfConstantCFString()

ConstantAddress CodeGenModule::GetAddrOfConstantCFString ( const StringLiteral Literal)

◆ GetAddrOfConstantCompoundLiteral()

ConstantAddress CodeGenModule::GetAddrOfConstantCompoundLiteral ( const CompoundLiteralExpr E)

Returns a pointer to a constant global variable for the given file-scope compound literal expression.

Definition at line 1961 of file CGExprConstant.cpp.

References clang::CompoundLiteralExpr::isFileScope().

◆ getAddrOfConstantCompoundLiteralIfEmitted()

llvm::GlobalVariable * CodeGenModule::getAddrOfConstantCompoundLiteralIfEmitted ( const CompoundLiteralExpr E)

If it's been emitted already, returns the GlobalVariable corresponding to a compound literal.

Otherwise, returns null.

Definition at line 1948 of file CGExprConstant.cpp.

◆ GetAddrOfConstantCString()

ConstantAddress CodeGenModule::GetAddrOfConstantCString ( const std::string &  Str,
const char *  GlobalName = nullptr 
)

Returns a pointer to a character array containing the literal and a terminating '\0' character.

GetAddrOfConstantCString - Returns a pointer to a character array containing the literal and a terminating '\0' character.

The result has pointer to array type.

Parameters
GlobalNameIf provided, the name to use for the global (if one is created).

The result has pointer to array type.

Definition at line 3734 of file CodeGenModule.cpp.

References GenerateStringLiteral(), clang::ASTContext::getAlignOfGlobalVarInChars(), getContext(), and getLLVMContext().

Referenced by buildBlockDescriptor(), and GetGCAttrTypeForType().

◆ GetAddrOfConstantString()

ConstantAddress clang::CodeGen::CodeGenModule::GetAddrOfConstantString ( const StringLiteral Literal)

Return a pointer to a constant NSString object for the given string.

Or a user defined String object as defined via -fconstant-string-class=class_name option.

◆ GetAddrOfConstantStringFromLiteral()

ConstantAddress CodeGenModule::GetAddrOfConstantStringFromLiteral ( const StringLiteral S,
StringRef  Name = ".str" 
)

Return a pointer to a constant array for the given string literal.

GetAddrOfConstantStringFromLiteral - Return a pointer to a constant array for the given string literal.

Definition at line 3677 of file CodeGenModule.cpp.

◆ GetAddrOfConstantStringFromObjCEncode()

ConstantAddress CodeGenModule::GetAddrOfConstantStringFromObjCEncode ( const ObjCEncodeExpr E)

Return a pointer to a constant array for the given ObjCEncodeExpr node.

GetAddrOfConstantStringFromObjCEncode - Return a pointer to a constant array for the given ObjCEncodeExpr node.

Definition at line 3724 of file CodeGenModule.cpp.

◆ getAddrOfCXXStructor()

llvm::Constant * CodeGenModule::getAddrOfCXXStructor ( const CXXMethodDecl MD,
StructorType  Type,
const CGFunctionInfo FnInfo = nullptr,
llvm::FunctionType *  FnType = nullptr,
bool  DontDefer = false,
ForDefinition_t  IsForDefinition = NotForDefinition 
)

◆ GetAddrOfFunction()

llvm::Constant * CodeGenModule::GetAddrOfFunction ( GlobalDecl  GD,
llvm::Type Ty = nullptr,
bool  ForVTable = false,
bool  DontDefer = false,
ForDefinition_t  IsForDefinition = NotForDefinition 
)

Return the address of the given function.

GetAddrOfFunction - Return the address of the given function.

If Ty is non-null, then this function will use the specified type if it has to create it.

If Ty is non-null, then this function will use the specified type if it has to create it (this occurs when we see a definition of the function).

Definition at line 2212 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTypes::ConvertFunctionType(), clang::ASTContext::getCanonicalType(), clang::GlobalDecl::getDecl(), getMangledName(), clang::ValueDecl::getType(), and getTypes().

Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), EmitFunctionDeclPointer(), EmitNewDeleteCall(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfGlobal(), and HandleCXXStaticMemberVarInstantiation().

◆ GetAddrOfGlobal()

llvm::Constant * CodeGenModule::GetAddrOfGlobal ( GlobalDecl  GD,
ForDefinition_t  IsForDefinition = NotForDefinition 
)

◆ GetAddrOfGlobalBlock()

llvm::Constant * CodeGenModule::GetAddrOfGlobalBlock ( const BlockExpr BE,
StringRef  Name 
)

◆ getAddrOfGlobalBlockIfEmitted()

llvm::Constant* clang::CodeGen::CodeGenModule::getAddrOfGlobalBlockIfEmitted ( const BlockExpr BE)
inline

Returns the address of a block which requires no caputres, or null if we've yet to emit the block for BE.

Definition at line 819 of file CodeGenModule.h.

Referenced by buildGlobalBlock(), and clang::CodeGen::CodeGenFunction::EmitBlockLiteral().

◆ GetAddrOfGlobalTemporary()

ConstantAddress CodeGenModule::GetAddrOfGlobalTemporary ( const MaterializeTemporaryExpr E,
const Expr Inner 
)

Returns a pointer to a global variable representing a temporary with static or thread storage duration.

Definition at line 3765 of file CodeGenModule.cpp.

Referenced by createReferenceTemporary().

◆ GetAddrOfGlobalVar()

llvm::Constant * CodeGenModule::GetAddrOfGlobalVar ( const VarDecl D,
llvm::Type Ty = nullptr,
ForDefinition_t  IsForDefinition = NotForDefinition 
)

Return the llvm::Constant for the address of the given global variable.

GetAddrOfGlobalVar - Return the llvm::Constant for the address of the given global variable.

If Ty is non-null and if the global doesn't exist, then it will be created with the specified type instead of whatever the normal requested type would be. If IsForDefinition is true, it is guranteed that an actual global with type Ty will be returned, not conversion of a variable with the same mangled name but some other type.

Definition at line 2593 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), getContext(), getMangledName(), clang::ValueDecl::getType(), getTypes(), and clang::VarDecl::hasGlobalStorage().

Referenced by EmitGlobal(), EmitOMPThreadPrivateDecl(), GetAddrOfGlobal(), HandleCXXStaticMemberVarInstantiation(), isTypeConstant(), and maybeSetTrivialComdat().

◆ GetAddrOfRTTIDescriptor()

llvm::Constant * CodeGenModule::GetAddrOfRTTIDescriptor ( QualType  Ty,
bool  ForEH = false 
)

◆ GetAddrOfThunk()

llvm::Constant * CodeGenModule::GetAddrOfThunk ( GlobalDecl  GD,
const ThunkInfo Thunk 
)

Get the address of the thunk for the given global decl.

Definition at line 33 of file CGVTables.cpp.

References clang::GlobalDecl::getDecl().

Referenced by clang::CodeGen::CodeGenVTables::EmitThunks(), and clang::CodeGen::CodeGenFunction::generateThunk().

◆ GetAddrOfUuidDescriptor()

ConstantAddress CodeGenModule::GetAddrOfUuidDescriptor ( const CXXUuidofExpr E)

Get the address of a uuid descriptor .

Definition at line 1658 of file CodeGenModule.cpp.

◆ getAtomicGetterHelperFnMap()

llvm::Constant* clang::CodeGen::CodeGenModule::getAtomicGetterHelperFnMap ( QualType  Ty)
inline

◆ getAtomicSetterHelperFnMap()

llvm::Constant* clang::CodeGen::CodeGenModule::getAtomicSetterHelperFnMap ( QualType  Ty)
inline

◆ getBlockDescriptorType()

llvm::Type * CodeGenModule::getBlockDescriptorType ( )

Fetches the type of a generic block descriptor.

Definition at line 1029 of file CGBlocks.cpp.

References clang::serialized_diags::create(), clang::opencl_constant, and clang::CodeGen::Type.

Referenced by buildBlockDescriptor().

◆ getBlockMangledName()

StringRef CodeGenModule::getBlockMangledName ( GlobalDecl  GD,
const BlockDecl BD 
)

◆ getBlockObjectAssign()

llvm::Constant * CodeGenModule::getBlockObjectAssign ( )

Definition at line 2586 of file CGBlocks.cpp.

References configureBlocksRuntimeObject(), and clang::CodeGen::Type.

◆ getBlockObjectDispose()

llvm::Constant * CodeGenModule::getBlockObjectDispose ( )

◆ getBuiltinLibFunction()

llvm::Constant * CodeGenModule::getBuiltinLibFunction ( const FunctionDecl FD,
unsigned  BuiltinID 
)

Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf".

getBuiltinLibFunction - Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf".

Definition at line 48 of file CGBuiltin.cpp.

◆ getClassPointerAlignment()

CharUnits CodeGenModule::getClassPointerAlignment ( const CXXRecordDecl RD)

Returns the assumed alignment of an opaque pointer to the given class.

Return the best known alignment for an unknown pointer to a particular class.

Definition at line 36 of file CGClass.cpp.

References clang::ASTRecordLayout::getAlignment(), clang::ASTContext::getASTRecordLayout(), getContext(), clang::Decl::hasAttr(), clang::TagDecl::isCompleteDefinition(), and clang::CharUnits::One().

Referenced by clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), clang::CodeGen::CodeGenFunction::getNaturalTypeAlignment(), InitCatchParam(), and PerformReturnAdjustment().

◆ getCodeGenOpts()

const CodeGenOptions& clang::CodeGen::CodeGenModule::getCodeGenOpts ( ) const
inline

Definition at line 622 of file CodeGenModule.h.

Referenced by clang::CodeGen::CGDebugInfo::CGDebugInfo(), CreateFunctionTypeMetadata(), createReferenceTemporary(), clang::CodeGen::CodeGenFunction::EmitARCDestroyStrong(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), emitCheckHandlerCall(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), EmitDeclDestroy(), EmitDeclInvariant(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitSanitizerStatReport(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), emitWritebackArg(), enterBlockScope(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::getARCCleanupKind(), clang::CodeGen::CodeGenTypes::getCodeGenOpts(), getCodegenToUse(), getRangeForType(), clang::CodeGen::CodeGenFunction::incrementProfileCounter(), maybeSetTrivialComdat(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), Release(), clang::CodeGen::CodeGenFunction::setBlockContextParameter(), shouldEmitAvailableExternallyVTable(), clang::CodeGen::CodeGenFunction::ShouldInstrumentFunction(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), clang::CodeGen::CodeGenFunction::ShouldXRayInstrumentFunction(), clang::CodeGen::CodeGenFunction::StartFunction(), TryEmitBaseDestructorAsAlias(), and TryEmitDefinitionAsAlias().

◆ GetConstantArrayFromStringLiteral()

llvm::Constant * CodeGenModule::GetConstantArrayFromStringLiteral ( const StringLiteral E)

Return a constant array for the given string.

Definition at line 3611 of file CodeGenModule.cpp.

◆ getContext()

ASTContext& clang::CodeGen::CodeGenModule::getContext ( ) const
inline

Definition at line 616 of file CodeGenModule.h.

Referenced by AddDeferredUnusedCoverageMapping(), clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), buildBlockDescriptor(), buildByrefHelpers(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), clang::CodeGen::CGCXXABI::buildThisParam(), CanUseSingleInheritance(), classifyType(), clang::CodeGen::CGObjCRuntime::ComputeBitfieldBitOffset(), computeBlockInfo(), clang::CodeGen::CGObjCRuntime::ComputeIvarBaseOffset(), computeNonVirtualBaseClassOffset(), configureBlocksRuntimeObject(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateFunctionTypeMetadata(), clang::CodeGen::CreateItaniumCXXABI(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), createPrivatesRecordDecl(), clang::CodeGen::createRuntimeFunction(), createRuntimeShuffleFunction(), EmitAnnotationLineNo(), EmitAnnotationUnit(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitCopyToScratchpad(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), emitCXXDestructor(), clang::CodeGen::emitDeclareSimdFunction(), emitDestructorsFunction(), clang::CodeGen::emitDoacrossInit(), clang::CodeGen::emitDoacrossOrdered(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), clang::CodeGen::ConstantEmitter::emitForMemory(), EmitFunctionDeclPointer(), emitInterWarpCopyFunction(), clang::CodeGen::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLambdaDelegatingInvokeBody(), clang::CodeGen::CGCXXABI::EmitMemberFunctionPointer(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReduceScratchpadFunction(), emitReductionCombiner(), clang::CodeGen::CodeGenFunction::EmitScalarRangeCheck(), clang::CodeGen::CodeGenFunction::EmitSEHExceptionCodeSave(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::emitTaskCall(), emitTaskDupFunction(), clang::CodeGen::emitTaskInit(), emitTaskPrivateMappingFunction(), clang::CodeGen::emitTaskReductionFixups(), clang::CodeGen::emitThreadPrivateVarDefinition(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::emitUserDefinedReduction(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), extractFieldType(), extractPBaseFlags(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), GenerateStringLiteral(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDirectBaseInCompleteClass(), GetAddrOfConstantCFString(), GetAddrOfConstantCString(), GetAddrOfGlobalVar(), clang::CodeGen::getAddrOfThreadPrivate(), getAsmSrcLocInfo(), getClassPointerAlignment(), clang::CodeGen::CGCXXABI::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), getDynamicOffsetAlignment(), getFunctionLinkage(), GetGCAttrTypeForType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAcquireFn(), getLLVMLinkageVarDefinition(), getMaxAtomicAccessSize(), clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize(), getNonMemoryType(), GetNonVirtualBaseClassOffset(), clang::CodeGen::getOrCreateThreadPrivateCache(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), clang::CodeGen::CGOpenCLRuntime::getPipeType(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), clang::CodeGen::getTgtBinaryDescriptorQTy(), clang::CodeGen::getTgtDeviceImageQTy(), clang::CodeGen::getTgtOffloadEntryQTy(), getTypeInfoLinkage(), getVBaseAlignment(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), GetWeakRefReference(), hasMRCWeakIvars(), imbueXRayAttrs(), InitCatchParam(), initializeForBlockHeader(), isInSanitizerBlacklist(), clang::CodeGen::swiftcall::isLegalIntegerType(), isTypeConstant(), clang::CodeGen::CodeGenVTables::isVTableExternal(), isWeakLinkedClass(), maybeSetTrivialComdat(), shouldBeInCOMDAT(), clang::CodeGen::CodeGenFunction::ShouldEmitVTableTypeCheckedLoad(), clang::CodeGen::CodeGenFunction::StartThunk(), SymbolNameForMethod(), clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit().

◆ getCoverageMapping()

CoverageMappingModuleGen* clang::CodeGen::CodeGenModule::getCoverageMapping ( ) const
inline

Definition at line 558 of file CodeGenModule.h.

◆ getCUDARuntime()

CGCUDARuntime& clang::CodeGen::CodeGenModule::getCUDARuntime ( )
inline

Return a reference to the configured CUDA runtime.

Definition at line 541 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::GenerateCode(), and maybeSetTrivialComdat().

◆ getCXXABI()

CGCXXABI& clang::CodeGen::CodeGenModule::getCXXABI ( ) const
inline

Definition at line 633 of file CodeGenModule.h.

Referenced by BuildAppleKextVirtualCall(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), commonEmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateFunctionTypeMetadata(), CreateMetadataIdentifierForType(), clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), EmitDeclDestroy(), EmitDestroyingObjectDelete(), EmitDynamicCastToNull(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), EmitMemberInitializer(), EmitNullBaseClassInitialization(), EmitObjectDelete(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), GetAddrOfRTTIDescriptor(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), GetAddrOfVTTVTable(), getBlockMangledName(), getFunctionLinkage(), GetIntrinsic(), getTerminateFn(), getUniqueTagTypeName(), PerformReturnAdjustment(), setFunctionDLLStorageClass(), SetLLVMFunctionAttributesForDefinition(), setThunkProperties(), shouldEmitAvailableExternallyVTable(), clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::CodeGen::CodeGenFunction::StartThunk().

◆ getDataLayout()

const llvm::DataLayout& clang::CodeGen::CodeGenModule::getDataLayout ( ) const
inline

◆ getDiags()

DiagnosticsEngine& clang::CodeGen::CodeGenModule::getDiags ( ) const
inline

◆ getDynamicOffsetAlignment()

CharUnits CodeGenModule::getDynamicOffsetAlignment ( CharUnits  ActualAlign,
const CXXRecordDecl Class,
CharUnits  ExpectedTargetAlign 
)

Given a class pointer with an actual known alignment, and the expected alignment of an object at a dynamic offset w.r.t that pointer, return the alignment to assume at the offset.

Definition at line 70 of file CGClass.cpp.

References clang::ASTContext::getASTRecordLayout(), getContext(), clang::TagDecl::isCompleteDefinition(), and min().

Referenced by getVBaseAlignment().

◆ getExpressionLocationsEnabled()

bool CodeGenModule::getExpressionLocationsEnabled ( ) const

Return true if we should emit location information for expressions.

Definition at line 3573 of file CodeGenModule.cpp.

◆ getFunctionFeatureMap()

void CodeGenModule::getFunctionFeatureMap ( llvm::StringMap< bool > &  FeatureMap,
const FunctionDecl FD 
)

Definition at line 4578 of file CodeGenModule.cpp.

References clang::Decl::getAttr(), and getDiags().

Referenced by hasRequiredFeatures().

◆ getFunctionLinkage()

llvm::GlobalValue::LinkageTypes CodeGenModule::getFunctionLinkage ( GlobalDecl  GD)

◆ getGenericBlockLiteralType()

llvm::Type * CodeGenModule::getGenericBlockLiteralType ( )

The type of a generic block literal.

Definition at line 1061 of file CGBlocks.cpp.

References clang::CodeGen::Type.

◆ getGlobalCtors()

CtorList& clang::CodeGen::CodeGenModule::getGlobalCtors ( )
inline

Definition at line 652 of file CodeGenModule.h.

◆ getGlobalDtors()

CtorList& clang::CodeGen::CodeGenModule::getGlobalDtors ( )
inline

Definition at line 653 of file CodeGenModule.h.

◆ GetGlobalValue()

llvm::GlobalValue * CodeGenModule::GetGlobalValue ( StringRef  Ref)

◆ GetGlobalVarAddressSpace()

LangAS CodeGenModule::GetGlobalVarAddressSpace ( const VarDecl D)

Return the AST address space of the underlying global variable for D, as determined by its declaration.

Normally this is the same as the address space of D's type, but in CUDA, address spaces are associated with declarations, not types. If D is nullptr, return the default address space for global variable.

For languages without explicit address spaces, if D has default address space, target-specific global or constant address space may be returned.

Definition at line 2644 of file CodeGenModule.cpp.

References clang::cuda_constant, clang::cuda_device, clang::cuda_shared, clang::Default, clang::FirstTargetAddressSpace, clang::QualType::getAddressSpace(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), getTargetCodeGenInfo(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::opencl_constant, clang::opencl_global, and clang::opencl_local.

Referenced by isTypeConstant(), and maybeSetTrivialComdat().

◆ getHeaderSearchOpts()

const HeaderSearchOptions& clang::CodeGen::CodeGenModule::getHeaderSearchOpts ( ) const
inline

Definition at line 618 of file CodeGenModule.h.

◆ getIntrinsic()

llvm::Function * CodeGenModule::getIntrinsic ( unsigned  IID,
ArrayRef< llvm::Type *>  Tys = None 
)

◆ getItaniumVTableContext()

ItaniumVTableContext& clang::CodeGen::CodeGenModule::getItaniumVTableContext ( )
inline

◆ getLangOpts()

const LangOptions& clang::CodeGen::CodeGenModule::getLangOpts ( ) const
inline

Definition at line 617 of file CodeGenModule.h.

Referenced by buildBlockDescriptor(), buildGlobalBlock(), clang::CodeGen::CGOpenMPRuntimeNVPTX::CGOpenMPRuntimeNVPTX(), computeBlockInfo(), clang::CodeGen::CreateGNUObjCRuntime(), clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), clang::CodeGen::SanitizerMetadata::disableSanitizerForGlobal(), EmitBaseInitializer(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCommonOMPTargetDirective(), EmitGlobal(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolCleanup(), clang::CodeGen::emitTargetFunctions(), clang::CodeGen::emitTargetGlobalVariable(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::emitThreadPrivateVarDefinition(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), enterBlockScope(), clang::CodeGen::CodeGenFunction::enterByrefCleanup(), GenerateStringLiteral(), clang::CodeGen::EHPersonality::get(), GetAddrOfRTTIDescriptor(), clang::CodeGen::getAddrOfThreadPrivate(), getAsmSrcLocInfo(), getClangCallTerminateFn(), GetConstantStringEntry(), GetGCAttrTypeForType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), clang::CodeGen::CodeGenFunction::getLangOpts(), getLLVMLinkageForDeclarator(), getMaxAtomicAccessSize(), clang::CodeGen::getOrCreateThreadPrivateCache(), getStaticDeclName(), getTerminateFn(), getTypeInfoLinkage(), hasMRCWeakIvars(), initializeForBlockHeader(), isWeakLinkedClass(), clang::CodeGen::loadOffloadInfoMetadata(), MaybeHandleStaticInExternC(), maybeSetTrivialComdat(), clang::CodeGen::SanitizerMetadata::reportGlobalToASan(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), SymbolNameForMethod(), tryCaptureAsConstant(), UseOptimizedSetter(), and ~CodeGenModule().

◆ getLLVMContext()

llvm::LLVMContext& clang::CodeGen::CodeGenModule::getLLVMContext ( )
inline

◆ getLLVMLifetimeEndFn()

llvm::Constant * CodeGenModule::getLLVMLifetimeEndFn ( )

Lazily declare the .lifetime.end intrinsic.

Definition at line 1748 of file CGDecl.cpp.

References clang::CodeGen::CodeGenTypeCache::AllocaInt8PtrTy, and clang::CodeGen::CodeGenFunction::EmitARCRelease().

Referenced by clang::CodeGen::CodeGenFunction::EmitLifetimeEnd().

◆ getLLVMLifetimeStartFn()

llvm::Constant * CodeGenModule::getLLVMLifetimeStartFn ( )

Lazily declare the .lifetime.start intrinsic.

Definition at line 1739 of file CGDecl.cpp.

References clang::CodeGen::CodeGenTypeCache::AllocaInt8PtrTy.

Referenced by clang::CodeGen::CodeGenFunction::EmitLifetimeStart().

◆ getLLVMLinkageForDeclarator()

llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageForDeclarator ( const DeclaratorDecl D,
GVALinkage  Linkage,
bool  IsConstantVariable 
)

◆ getLLVMLinkageVarDefinition()

llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageVarDefinition ( const VarDecl VD,
bool  IsConstant 
)

◆ GetLLVMVisibility()

static llvm::GlobalValue::VisibilityTypes clang::CodeGen::CodeGenModule::GetLLVMVisibility ( Visibility  V)
inlinestatic

◆ getMangledName()

StringRef CodeGenModule::getMangledName ( GlobalDecl  GD)

◆ getMemberPointerConstant()

llvm::Constant * CodeGenModule::getMemberPointerConstant ( const UnaryOperator e)

◆ getMicrosoftVTableContext()

MicrosoftVTableContext& clang::CodeGen::CodeGenModule::getMicrosoftVTableContext ( )
inline

◆ getModule()

llvm::Module& clang::CodeGen::CodeGenModule::getModule ( ) const
inline

Definition at line 623 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), CanUseSingleInheritance(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), createReferenceTemporary(), decomposeTypeForEH(), detectAmbiguousBases(), EmitAnnotationString(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitCopyToScratchpad(), emitCXXDestructor(), emitDestructorsFunction(), EmitGlobalAnnotations(), EmitGlobalDeclMetadata(), emitGlobalDtorWithTLRegDtor(), emitInitWithReductionInitializer(), emitInterWarpCopyFunction(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReduceScratchpadFunction(), emitReductionCombiner(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), emitTaskDupFunction(), clang::CodeGen::CodeGenFunction::EncodeAddrForUseInPrologue(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), GenerateStringLiteral(), getClangCallTerminateFn(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), GetGCAttrTypeForType(), getInitThreadEpochPtr(), getIntrinsic(), getMasterThreadID(), getNVPTXBarrier(), getNVPTXCTABarrier(), getNVPTXNumThreads(), getNVPTXThreadID(), getNVPTXWarpSize(), getSanStats(), getTypeInfoVTable(), HandleCXXStaticMemberVarInstantiation(), isTypeConstant(), Release(), setThunkProperties(), SymbolNameForMethod(), and TryEmitDefinitionAsAlias().

◆ getModuleDebugInfo()

CGDebugInfo* clang::CodeGen::CodeGenModule::getModuleDebugInfo ( )
inline

◆ GetNonVirtualBaseClassOffset()

llvm::Constant * CodeGenModule::GetNonVirtualBaseClassOffset ( const CXXRecordDecl ClassDecl,
CastExpr::path_const_iterator  PathBegin,
CastExpr::path_const_iterator  PathEnd 
)

◆ getNoObjCARCExceptionsMetadata()

llvm::MDNode* clang::CodeGen::CodeGenModule::getNoObjCARCExceptionsMetadata ( )
inline

Definition at line 610 of file CodeGenModule.h.

◆ getNSConcreteGlobalBlock()

llvm::Constant * CodeGenModule::getNSConcreteGlobalBlock ( )

Definition at line 2598 of file CGBlocks.cpp.

References configureBlocksRuntimeObject().

Referenced by buildGlobalBlock().

◆ getNSConcreteStackBlock()

llvm::Constant * CodeGenModule::getNSConcreteStackBlock ( )

◆ getNullPointer()

llvm::Constant * CodeGenModule::getNullPointer ( llvm::PointerType *  T,
QualType  QT 
)

Get target specific null pointer.

Parameters
Tis the LLVM type of the null pointer.
QTis the clang QualType of the null pointer.

Definition at line 1508 of file CGExprConstant.cpp.

References clang::CodeGen::ConstantEmitter::CGM, clang::CodeGen::ConstantAddress::getPointer(), and clang::CodeGen::Type.

Referenced by clang::CodeGen::CodeGenFunction::EmitScalarInit(), and clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().

◆ getObjCEntrypoints()

ObjCEntrypoints& clang::CodeGen::CodeGenModule::getObjCEntrypoints ( ) const
inline

◆ getObjCFastEnumerationStateType()

QualType CodeGenModule::getObjCFastEnumerationStateType ( )

◆ getObjCRuntime()

CGObjCRuntime& clang::CodeGen::CodeGenModule::getObjCRuntime ( )
inline

◆ getOpenCLRuntime()

CGOpenCLRuntime& clang::CodeGen::CodeGenModule::getOpenCLRuntime ( )
inline

◆ getOpenMPRuntime()

CGOpenMPRuntime& clang::CodeGen::CodeGenModule::getOpenMPRuntime ( )
inline

◆ getOrCreateStaticVarDecl()

llvm::Constant * CodeGenModule::getOrCreateStaticVarDecl ( const VarDecl D,
llvm::GlobalValue::LinkageTypes  Linkage 
)

◆ getPGOReader()

llvm::IndexedInstrProfReader* clang::CodeGen::CodeGenModule::getPGOReader ( ) const
inline

Definition at line 556 of file CodeGenModule.h.

◆ getPGOStats()

InstrProfStats& clang::CodeGen::CodeGenModule::getPGOStats ( )
inline

Definition at line 555 of file CodeGenModule.h.

◆ getPreprocessorOpts()

const PreprocessorOptions& clang::CodeGen::CodeGenModule::getPreprocessorOpts ( ) const
inline

Definition at line 620 of file CodeGenModule.h.

◆ getSanitizerMetadata()

SanitizerMetadata* clang::CodeGen::CodeGenModule::getSanitizerMetadata ( )
inline

◆ getSanStats()

llvm::SanitizerStatReport & CodeGenModule::getSanStats ( )

Definition at line 4606 of file CodeGenModule.cpp.

References getModule().

Referenced by clang::CodeGen::CodeGenFunction::EmitSanitizerStatReport().

◆ getSize()

llvm::ConstantInt * CodeGenModule::getSize ( CharUnits  numChars)

◆ getStaticLocalDeclAddress()

llvm::Constant* clang::CodeGen::CodeGenModule::getStaticLocalDeclAddress ( const VarDecl D)
inline

Definition at line 562 of file CodeGenModule.h.

◆ getStaticLocalDeclGuardAddress()

llvm::GlobalVariable* clang::CodeGen::CodeGenModule::getStaticLocalDeclGuardAddress ( const VarDecl D)
inline

Definition at line 574 of file CodeGenModule.h.

◆ getTarget()

const TargetInfo& clang::CodeGen::CodeGenModule::getTarget ( ) const
inline

◆ getTargetCodeGenInfo()

const TargetCodeGenInfo & CodeGenModule::getTargetCodeGenInfo ( )

◆ GetTargetTypeStoreSize()

CharUnits CodeGenModule::GetTargetTypeStoreSize ( llvm::Type Ty) const

Return the store size, in character units, of the given LLVM type.

Definition at line 2639 of file CodeGenModule.cpp.

References getDataLayout(), and clang::ASTContext::toCharUnitsFromBits().

Referenced by clang::CodeGen::getAddrOfThreadPrivate().

◆ getTBAAAccessInfo()

TBAAAccessInfo CodeGenModule::getTBAAAccessInfo ( QualType  AccessType)

◆ getTBAAAccessTagInfo()

llvm::MDNode * CodeGenModule::getTBAAAccessTagInfo ( TBAAAccessInfo  Info)

getTBAAAccessTagInfo - Get TBAA tag for a given memory access.

Definition at line 603 of file CodeGenModule.cpp.

Referenced by DecorateInstructionWithTBAA().

◆ getTBAABaseTypeInfo()

llvm::MDNode * CodeGenModule::getTBAABaseTypeInfo ( QualType  QTy)

getTBAABaseTypeInfo - Get metadata that describes the given base access type.

Return null if the type is not suitable for use in TBAA access tags.

Definition at line 597 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField().

◆ getTBAAMayAliasAccessInfo()

TBAAAccessInfo CodeGenModule::getTBAAMayAliasAccessInfo ( )

getTBAAMayAliasAccessInfo - Get TBAA information that represents may-alias accesses.

Definition at line 609 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), and clang::CodeGen::CodeGenFunction::EmitStoreOfScalar().

◆ getTBAAStructInfo()

llvm::MDNode * CodeGenModule::getTBAAStructInfo ( QualType  QTy)

Definition at line 591 of file CodeGenModule.cpp.

◆ getTBAATypeInfo()

llvm::MDNode * CodeGenModule::getTBAATypeInfo ( QualType  QTy)

getTBAATypeInfo - Get metadata used to describe accesses to objects of the given type.

Definition at line 575 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField(), and getTBAAAccessInfo().

◆ getTBAAVTablePtrAccessInfo()

TBAAAccessInfo CodeGenModule::getTBAAVTablePtrAccessInfo ( )

getTBAAVTablePtrAccessInfo - Get the TBAA information that describes an access to a virtual table pointer.

Definition at line 585 of file CodeGenModule.cpp.

◆ getTerminateFn()

llvm::Constant * CodeGenModule::getTerminateFn ( )

◆ getTriple()

const llvm::Triple& clang::CodeGen::CodeGenModule::getTriple ( ) const
inline

◆ getTypeDescriptorFromMap()

llvm::Constant* clang::CodeGen::CodeGenModule::getTypeDescriptorFromMap ( QualType  Ty)
inline

◆ getTypes()

CodeGenTypes& clang::CodeGen::CodeGenModule::getTypes ( )
inline

Definition at line 640 of file CodeGenModule.h.

Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), clang::CodeGen::arrangeCXXMethodType(), clang::CodeGen::arrangeFreeFunctionCall(), clang::CodeGen::arrangeFreeFunctionType(), clang::CodeGen::arrangeObjCMessageSendSignature(), buildBlockDescriptor(), canEmitDelegateCallArgs(), CanUseSingleInheritance(), codegenCXXStructor(), computeBlockInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::convertTypeForMemory(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateFunctionTypeMetadata(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), clang::CodeGen::createRuntimeFunction(), emitAddrOfFieldStorage(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitCopyToScratchpad(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), emitCXXDestructor(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementLValue(), clang::CodeGen::ConstantEmitter::emitForMemory(), EmitFunctionDeclPointer(), EmitGlobal(), emitInterWarpCopyFunction(), clang::CodeGen::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLambdaDelegatingInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), EmitNewDeleteCall(), EmitNullConstant(), EmitNullConstantForBase(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReduceScratchpadFunction(), emitReductionCombiner(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), emitTaskDupFunction(), clang::CodeGen::emitThreadPrivateVarDefinition(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), extractPBaseFlags(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfConstantCFString(), getAddrOfCXXStructor(), GetAddrOfFunction(), GetAddrOfGlobal(), GetAddrOfGlobalVar(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), GetGCAttrTypeForType(), getGuardAcquireFn(), clang::CodeGen::getLLVMFieldNumber(), getMasterThreadID(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), clang::CodeGen::CodeGenFunction::getTypes(), GetWeakRefReference(), HandleCXXStaticMemberVarInstantiation(), maybeSetTrivialComdat(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), SymbolNameForMethod(), and TryEmitDefinitionAsAlias().

◆ getUniqueBlockCount()

int clang::CodeGen::CodeGenModule::getUniqueBlockCount ( )
inline

Fetches the global unique block count.

Definition at line 806 of file CodeGenModule.h.

◆ getVBaseAlignment()

CharUnits CodeGenModule::getVBaseAlignment ( CharUnits  actualDerivedAlign,
const CXXRecordDecl derivedClass,
const CXXRecordDecl vbaseClass 
)

Returns the assumed alignment of a virtual base of a class.

Return the best known alignment for a pointer to a virtual base, given the alignment of a pointer to the derived class.

Definition at line 55 of file CGClass.cpp.

References clang::ASTContext::getASTRecordLayout(), getContext(), getDynamicOffsetAlignment(), and clang::TagDecl::isCompleteDefinition().

Referenced by ApplyNonVirtualAndVirtualOffset().

◆ getVTableLinkage()

llvm::GlobalVariable::LinkageTypes CodeGenModule::getVTableLinkage ( const CXXRecordDecl RD)

Return the appropriate linkage for the vtable, VTT, and type information of the given class.

Compute the required linkage of the vtable for the given class.

Note that we only call this at the end of the translation unit.

Definition at line 730 of file CGVTables.cpp.

References clang::InternalLinkage, and clang::NamedDecl::isExternallyVisible().

Referenced by getTypeInfoLinkage().

◆ getVTables()

CodeGenVTables& clang::CodeGen::CodeGenModule::getVTables ( )
inline

Definition at line 642 of file CodeGenModule.h.

Referenced by emitCXXDestructor(), and shouldEmitVTableAtEndOfTranslationUnit().

◆ GetWeakRefReference()

ConstantAddress CodeGenModule::GetWeakRefReference ( const ValueDecl VD)

◆ HandleCXXStaticMemberVarInstantiation()

void CodeGenModule::HandleCXXStaticMemberVarInstantiation ( VarDecl VD)

◆ HasHiddenLTOVisibility()

bool CodeGenModule::HasHiddenLTOVisibility ( const CXXRecordDecl RD)

Returns whether the given record has hidden LTO visibility and therefore may participate in (single-module) CFI and whole-program vtable optimization.

Definition at line 912 of file CGVTables.cpp.

References clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), clang::DeclContext::getParent(), clang::LinkageInfo::getVisibility(), clang::Decl::hasAttr(), clang::HiddenVisibility, and clang::isExternallyVisible().

◆ hasObjCRuntime()

bool clang::CodeGen::CodeGenModule::hasObjCRuntime ( )
inline

Return true iff an Objective-C runtime has been configured.

Definition at line 526 of file CodeGenModule.h.

◆ imbueXRayAttrs()

bool CodeGenModule::imbueXRayAttrs ( llvm::Function *  Fn,
SourceLocation  Loc,
StringRef  Category = StringRef() 
) const

◆ isInSanitizerBlacklist() [1/2]

bool CodeGenModule::isInSanitizerBlacklist ( SanitizerMask  Kind,
llvm::Function *  Fn,
SourceLocation  Loc 
) const

◆ isInSanitizerBlacklist() [2/2]

bool CodeGenModule::isInSanitizerBlacklist ( llvm::GlobalVariable *  GV,
SourceLocation  Loc,
QualType  Ty,
StringRef  Category = StringRef() 
) const

◆ isPaddedAtomicType() [1/2]

bool CodeGenModule::isPaddedAtomicType ( QualType  type)

Definition at line 659 of file CodeGenTypes.cpp.

References clang::Type::castAs().

◆ isPaddedAtomicType() [2/2]

bool CodeGenModule::isPaddedAtomicType ( const AtomicType type)

◆ isTypeConstant()

bool CodeGenModule::isTypeConstant ( QualType  Ty,
bool  ExcludeCtor 
)

isTypeConstant - Determine whether an object of this type can be emitted as a constant.

If ExcludeCtor is true, the duration when the object's constructor runs will not be considered. The caller will need to verify that the object is not written to during its construction.

Definition at line 2317 of file CodeGenModule.cpp.

References clang::CLanguageLinkage, clang::Default, clang::ExternalLinkage, clang::CodeGen::ConstantEmitter::finalize(), clang::QualType::getAddressSpace(), GetAddrOfGlobalVar(), clang::VarDecl::getAnyInitializer(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getAttr(), clang::ASTContext::getBaseElementType(), clang::GlobalDecl::getCanonicalDecl(), clang::VarDecl::getCanonicalDecl(), getContext(), clang::GlobalDecl::getDecl(), getDeclAlign(), getDiags(), GetGlobalValue(), GetGlobalVarAddressSpace(), clang::ASTContext::getLangOpts(), clang::VarDecl::getLanguageLinkage(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), clang::Decl::getLocation(), getModule(), clang::ASTContext::getTargetAddressSpace(), getTargetCodeGenInfo(), clang::VarDecl::getTLSKind(), getTriple(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasDefinition(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasInit(), clang::QualType::isConstant(), clang::QualType::isConstQualified(), clang::isExternallyVisible(), clang::Type::isReferenceType(), lookupRepresentativeDecl(), clang::opencl_global, clang::CodeGen::TargetCodeGenInfo::performAddrSpaceCast(), clang::DiagnosticsEngine::Report(), setLinkageAndVisibilityForGV(), setTLSMode(), clang::VarDecl::TLS_Dynamic, and clang::CodeGen::ConstantEmitter::tryEmitForInitializer().

Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), createReferenceTemporary(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), and maybeSetTrivialComdat().

◆ lookupRepresentativeDecl()

bool CodeGenModule::lookupRepresentativeDecl ( StringRef  MangledName,
GlobalDecl Result 
) const

Definition at line 4366 of file CodeGenModule.cpp.

Referenced by HandleCXXStaticMemberVarInstantiation(), and isTypeConstant().

◆ MaybeHandleStaticInExternC()

template<typename SomeDecl >
void CodeGenModule::MaybeHandleStaticInExternC ( const SomeDecl *  D,
llvm::GlobalValue *  GV 
)

If the declaration has internal linkage but is inside an extern "C" linkage specification, prepare to emit an alias for it to the expected name.

Definition at line 2668 of file CodeGenModule.cpp.

References clang::frontend::CPlusPlus, getLangOpts(), and clang::InternalLinkage.

Referenced by HandleCXXStaticMemberVarInstantiation(), and maybeSetTrivialComdat().

◆ maybeSetTrivialComdat()

void CodeGenModule::maybeSetTrivialComdat ( const Decl D,
llvm::GlobalObject &  GO 
)

◆ mergeTBAAInfoForCast()

TBAAAccessInfo CodeGenModule::mergeTBAAInfoForCast ( TBAAAccessInfo  SourceInfo,
TBAAAccessInfo  TargetInfo 
)

mergeTBAAInfoForCast - Get merged TBAA information for the purposes of type casts.

Definition at line 615 of file CodeGenModule.cpp.

◆ NeedAllVtablesTypeId()

bool CodeGenModule::NeedAllVtablesTypeId ( ) const

Returns whether this module needs the "all-vtables" type identifier.

Definition at line 4545 of file CodeGenModule.cpp.

Referenced by AddVTableTypeMetadata().

◆ RefreshTypeCacheForClass()

void CodeGenModule::RefreshTypeCacheForClass ( const CXXRecordDecl Class)

◆ Release()

void CodeGenModule::Release ( )

◆ ReturnSlotInterferesWithArgs()

bool CodeGenModule::ReturnSlotInterferesWithArgs ( const CGFunctionInfo FI)

Return true iff the given type uses an argument slot when 'sret' is used as a return type.

Definition at line 1485 of file CGCall.cpp.

Referenced by clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), and isWeakLinkedClass().

◆ ReturnTypeUsesFP2Ret()

bool CodeGenModule::ReturnTypeUsesFP2Ret ( QualType  ResultType)

Return true iff the given type uses 'fp2ret' when used as a return type.

Definition at line 1507 of file CGCall.cpp.

References clang::Type::getAs(), clang::CodeGen::CodeGenTypes::getTarget(), and clang::TargetInfo::useObjCFP2RetForComplexLongDouble().

Referenced by isWeakLinkedClass().

◆ ReturnTypeUsesFPRet()

bool CodeGenModule::ReturnTypeUsesFPRet ( QualType  ResultType)

Return true iff the given type uses 'fpret' when used as a return type.

Definition at line 1490 of file CGCall.cpp.

References clang::TargetInfo::Double, clang::TargetInfo::Float, clang::Type::getAs(), clang::CodeGen::CodeGenTypes::getTarget(), clang::TargetInfo::LongDouble, and clang::TargetInfo::useObjCFPRetForRealType().

Referenced by isWeakLinkedClass().

◆ ReturnTypeUsesSRet()

bool CodeGenModule::ReturnTypeUsesSRet ( const CGFunctionInfo FI)

Return true iff the given type uses 'sret' when used as a return type.

Definition at line 1481 of file CGCall.cpp.

References clang::CodeGen::CGFunctionInfo::getReturnInfo(), and clang::CodeGen::ABIArgInfo::isIndirect().

Referenced by clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), and isWeakLinkedClass().

◆ setAddrOfConstantCompoundLiteral()

void CodeGenModule::setAddrOfConstantCompoundLiteral ( const CompoundLiteralExpr CLE,
llvm::GlobalVariable *  GV 
)

Notes that CLE's GlobalVariable is GV.

Asserts that CLE isn't already emitted.

Definition at line 1953 of file CGExprConstant.cpp.

◆ setAddrOfGlobalBlock()

void CodeGenModule::setAddrOfGlobalBlock ( const BlockExpr BE,
llvm::Constant *  Addr 
)

Notes that BE's global block is available via Addr.

Asserts that BE isn't already emitted.

Definition at line 1198 of file CGBlocks.cpp.

◆ setAliasAttributes()

void CodeGenModule::setAliasAttributes ( const Decl D,
llvm::GlobalValue *  GV 
)

Set attributes which must be preserved by an alias.

This includes common attributes (i.e. it includes a call to SetCommonAttributes).

NOTE: This should only be called for definitions.

Definition at line 1061 of file CodeGenModule.cpp.

References clang::CodeGen::ForDefinition, clang::Decl::getAttr(), getTargetCodeGenInfo(), clang::Decl::hasAttr(), SetCommonAttributes(), and clang::CodeGen::TargetCodeGenInfo::setTargetAttributes().

Referenced by emitConstructorDestructorAlias(), HandleCXXStaticMemberVarInstantiation(), and TryEmitDefinitionAsAlias().

◆ setAtomicGetterHelperFnMap()

void clang::CodeGen::CodeGenModule::setAtomicGetterHelperFnMap ( QualType  Ty,
llvm::Constant *  Fn 
)
inline

◆ setAtomicSetterHelperFnMap()

void clang::CodeGen::CodeGenModule::setAtomicSetterHelperFnMap ( QualType  Ty,
llvm::Constant *  Fn 
)
inline

◆ SetCommonAttributes()

void CodeGenModule::SetCommonAttributes ( const Decl D,
llvm::GlobalValue *  GV 
)

Set attributes which are common to any form of a global definition (alias, Objective-C method, function, global variable).

NOTE: This should only be called for definitions.

Definition at line 1050 of file CodeGenModule.cpp.

Referenced by HandleCXXStaticMemberVarInstantiation(), and setAliasAttributes().

◆ setFunctionDefinitionAttributes()

void CodeGenModule::setFunctionDefinitionAttributes ( const FunctionDecl D,
llvm::Function *  F 
)

Set attributes for a global definition.

Definition at line 893 of file CodeGenModule.cpp.

Referenced by codegenCXXStructor(), and HandleCXXStaticMemberVarInstantiation().

◆ setFunctionDLLStorageClass()

void CodeGenModule::setFunctionDLLStorageClass ( GlobalDecl  GD,
llvm::Function *  F 
)

◆ setFunctionLinkage()

void clang::CodeGen::CodeGenModule::setFunctionLinkage ( GlobalDecl  GD,
llvm::Function *  F 
)
inline

◆ setGlobalVisibility()

void CodeGenModule::setGlobalVisibility ( llvm::GlobalValue *  GV,
const NamedDecl D 
) const

◆ SetInternalFunctionAttributes()

void CodeGenModule::SetInternalFunctionAttributes ( const Decl D,
llvm::Function *  F,
const CGFunctionInfo FI 
)

◆ SetLLVMFunctionAttributes()

void CodeGenModule::SetLLVMFunctionAttributes ( const Decl D,
const CGFunctionInfo Info,
llvm::Function *  F 
)

Set the LLVM function attributes (sext, zext, etc).

Definition at line 898 of file CodeGenModule.cpp.

References ConstructAttributeList().

Referenced by CreateFunctionTypeMetadata(), and SetInternalFunctionAttributes().

◆ SetLLVMFunctionAttributesForDefinition()

void CodeGenModule::SetLLVMFunctionAttributesForDefinition ( const Decl D,
llvm::Function *  F 
)

◆ setStaticLocalDeclAddress()

void clang::CodeGen::CodeGenModule::setStaticLocalDeclAddress ( const VarDecl D,
llvm::Constant *  C 
)
inline

Definition at line 565 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().

◆ setStaticLocalDeclGuardAddress()

void clang::CodeGen::CodeGenModule::setStaticLocalDeclGuardAddress ( const VarDecl D,
llvm::GlobalVariable *  C 
)
inline

Definition at line 577 of file CodeGenModule.h.

◆ setTLSMode()

void CodeGenModule::setTLSMode ( llvm::GlobalValue *  GV,
const VarDecl D 
) const

Set the TLS mode for the given LLVM GlobalValue for the thread-local variable declaration D.

Definition at line 699 of file CodeGenModule.cpp.

References clang::Decl::getAttr(), GetLLVMTLSModel(), and clang::VarDecl::getTLSKind().

Referenced by HandleCXXStaticMemberVarInstantiation(), isTypeConstant(), and maybeSetTrivialComdat().

◆ setTypeDescriptorInMap()

void clang::CodeGen::CodeGenModule::setTypeDescriptorInMap ( QualType  Ty,
llvm::Constant *  C 
)
inline

Definition at line 604 of file CodeGenModule.h.

◆ shouldUseTBAA()

bool clang::CodeGen::CodeGenModule::shouldUseTBAA ( ) const
inline

Definition at line 636 of file CodeGenModule.h.

◆ supportsCOMDAT()

bool CodeGenModule::supportsCOMDAT ( ) const

◆ TryEmitBaseDestructorAsAlias()

bool CodeGenModule::TryEmitBaseDestructorAsAlias ( const CXXDestructorDecl D)

◆ TryEmitDefinitionAsAlias()

bool CodeGenModule::TryEmitDefinitionAsAlias ( GlobalDecl  AliasDecl,
GlobalDecl  TargetDecl 
)

Try to emit a definition as a global alias for another definition.

If InEveryTU is true, we know that an equivalent alias can be produced in every translation unit.

Definition at line 119 of file CGCXX.cpp.

References addReplacement(), clang::serialized_diags::create(), GetAddrOfGlobal(), getCodeGenOpts(), clang::GlobalDecl::getDecl(), getFunctionLinkage(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), getMangledName(), getModule(), getTriple(), getTypes(), clang::Decl::hasAttr(), setAliasAttributes(), and clang::CodeGen::Type.

Referenced by emitCXXDestructor().

◆ UpdateCompletedType()

void CodeGenModule::UpdateCompletedType ( const TagDecl TD)

Member Data Documentation

◆ ByrefHelpersCache

llvm::FoldingSet<BlockByrefHelpers> clang::CodeGen::CodeGenModule::ByrefHelpersCache

Definition at line 803 of file CodeGenModule.h.

Referenced by buildByrefHelpers().

◆ GlobalUniqueCount

int clang::CodeGen::CodeGenModule::GlobalUniqueCount

Definition at line 478 of file CodeGenModule.h.

◆ IsOSVersionAtLeastFn

llvm::Constant* clang::CodeGen::CodeGenModule::IsOSVersionAtLeastFn = nullptr

The documentation for this class was generated from the following files: