clang  16.0.0git
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 "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/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, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, 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...
 
const std::stringgetModuleNameHash () const
 
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...
 
CGHLSLRuntimegetHLSLRuntime ()
 Return a reference to the configured HLSL 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)
 
Address createUnnamedGlobalFrom (const VarDecl &D, llvm::Constant *Constant, CharUnits Align)
 
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 IntrusiveRefCntPtr< llvm::vfs::FileSystem > & getFileSystem () 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 (llvm::Type *VTablePtrType)
 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 mergeTBAAInfoForCast (TBAAAccessInfo SourceInfo, TBAAAccessInfo TargetInfo)
 mergeTBAAInfoForCast - Get merged TBAA information for the purposes of type casts. More...
 
TBAAAccessInfo mergeTBAAInfoForConditionalOperator (TBAAAccessInfo InfoA, TBAAAccessInfo InfoB)
 mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the purposes of conditional operator. More...
 
TBAAAccessInfo mergeTBAAInfoForMemoryTransfer (TBAAAccessInfo DestInfo, TBAAAccessInfo SrcInfo)
 mergeTBAAInfoForMemoryTransfer - Get merged TBAA information for the purposes of memory transfer calls. More...
 
TBAAAccessInfo getTBAAInfoForSubobject (LValue Base, QualType AccessType)
 getTBAAInfoForSubobject - Get TBAA information for an access with a given base lvalue. 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 setDSOLocal (llvm::GlobalValue *GV) const
 
bool shouldMapVisibilityToDLLExport (const NamedDecl *D) const
 
void setDLLImportDLLExport (llvm::GlobalValue *GV, GlobalDecl D) const
 
void setDLLImportDLLExport (llvm::GlobalValue *GV, const NamedDecl *D) const
 
void setGVProperties (llvm::GlobalValue *GV, GlobalDecl GD) const
 Set visibility, dllimport/dllexport and dso_local. More...
 
void setGVProperties (llvm::GlobalValue *GV, const NamedDecl *D) const
 
void setGVPropertiesAux (llvm::GlobalValue *GV, const NamedDecl *D) const
 
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::GlobalVariable::ThreadLocalMode GetDefaultLLVMTLSModel () const
 Get LLVM TLS mode from CodeGenOptions. More...
 
llvm::Constant * GetAddrOfGlobal (GlobalDecl GD, ForDefinition_t IsForDefinition=NotForDefinition)
 
llvm::GlobalVariable * CreateOrReplaceCXXRuntimeVariable (StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage, unsigned Alignment)
 Will return a global variable of the given type. More...
 
llvm::Function * CreateGlobalInitOrCleanUpFunction (llvm::FunctionType *ty, const Twine &name, const CGFunctionInfo &FI, SourceLocation Loc=SourceLocation(), bool TLS=false, llvm::GlobalVariable::LinkageTypes Linkage=llvm::GlobalVariable::InternalLinkage)
 
LangAS GetGlobalVarAddressSpace (const VarDecl *D)
 Return the AST address space of the underlying global variable for D, as determined by its declaration. More...
 
LangAS GetGlobalConstantAddressSpace () const
 Return the AST address space of constant literal, which is used to emit the constant literal as global variable in LLVM IR. 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 * GetFunctionStart (const ValueDecl *Decl)
 
llvm::Constant * GetAddrOfRTTIDescriptor (QualType Ty, bool ForEH=false)
 Get the address of the RTTI descriptor for the given type. More...
 
ConstantAddress GetAddrOfMSGuidDecl (const MSGuidDecl *GD)
 Get the address of a GUID. More...
 
ConstantAddress GetAddrOfUnnamedGlobalConstantDecl (const UnnamedGlobalConstantDecl *GCD)
 Get the address of a UnnamedGlobalConstant. More...
 
ConstantAddress GetAddrOfTemplateParamObject (const TemplateParamObjectDecl *TPO)
 Get the address of a template parameter object. More...
 
llvm::Constant * GetAddrOfThunk (StringRef Name, llvm::Type *FnTy, GlobalDecl GD)
 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 getMinimumClassObjectSize (const CXXRecordDecl *CD)
 Returns the minimum object size for an object of the given class type (or a class derived from it). More...
 
CharUnits getMinimumObjectSize (QualType Ty)
 Returns the minimum object size for an object of the given type. 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::Type * getBlockDescriptorType ()
 Fetches the type of a generic block descriptor. More...
 
llvm::Type * getGenericBlockLiteralType ()
 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 (GlobalDecl GD)
 
llvm::Constant * getAddrOfCXXStructor (GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition)
 Return the address of the constructor/destructor of the given type. More...
 
llvm::FunctionCallee getAddrAndTypeOfCXXStructor (GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition)
 
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 EmitMainVoidAlias ()
 Emit an alias for "main" if it has no arguments (needed for wasm). 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 addUsedOrCompilerUsedGlobal (llvm::GlobalValue *GV)
 Add a global to a list to be added to the llvm.compiler.used metadata. More...
 
void AddCXXDtorEntry (llvm::FunctionCallee DtorFn, llvm::Constant *Object)
 Add a destructor and object to add to the C++ global destructor function. More...
 
void AddCXXStermFinalizerEntry (llvm::FunctionCallee DtorFn)
 Add an sterm finalizer to the C++ global cleanup function. More...
 
void AddCXXStermFinalizerToGlobalDtor (llvm::Function *StermFinalizer, int Priority)
 Add an sterm finalizer to its own llvm.global_dtors entry. More...
 
void AddCXXPrioritizedStermFinalizerEntry (llvm::Function *StermFinalizer, int Priority)
 
llvm::FunctionCallee CreateRuntimeFunction (llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs=llvm::AttributeList(), bool Local=false, bool AssumeConvergent=false)
 Create or return a runtime function declaration 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::Function * getLLVMLifetimeStartFn ()
 Lazily declare the @llvm.lifetime.start intrinsic. More...
 
llvm::Function * getLLVMLifetimeEndFn ()
 Lazily declare the @llvm.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 (GlobalDecl GD, llvm::Function *F, const CGFunctionInfo &FI)
 Set the attributes on the LLVM function for the given decl and function info. More...
 
void SetLLVMFunctionAttributes (GlobalDecl GD, const CGFunctionInfo &Info, llvm::Function *F, bool IsThunk)
 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...
 
void setLLVMFunctionFEnvAttributes (const FunctionDecl *D, llvm::Function *F)
 Set the LLVM function attributes that represent floating point environment. 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, bool IsThunk)
 Get the LLVM attributes and calling convention to use for a particular function type. More...
 
void addDefaultFunctionDefinitionAttributes (llvm::Function &F)
 Adds attributes to F according to our CodeGenOptions and LangOptions, as though we had emitted it ourselves. More...
 
void addDefaultFunctionDefinitionAttributes (llvm::AttrBuilder &attrs)
 Like the overload taking a Function &, but intended specifically for frontends that want to build on Clang's target-configuration logic. More...
 
StringRef getMangledName (GlobalDecl GD)
 
StringRef getBlockMangledName (GlobalDecl GD, const BlockDecl *BD)
 
const GlobalDecl getMangledNameDecl (StringRef)
 
void EmitTentativeDefinition (const VarDecl *D)
 
void EmitExternalDeclaration (const VarDecl *D)
 
void EmitVTable (CXXRecordDecl *Class)
 This is a callback from Sema to tell us 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 appropriate metadata value. More...
 
llvm::GlobalVariable::LinkageTypes getFunctionLinkage (GlobalDecl GD)
 
void setFunctionLinkage (GlobalDecl GD, llvm::Function *F)
 
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 * EmitAnnotationArgs (const AnnotateAttr *Attr)
 Emit additional args of the annotation. 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 isInNoSanitizeList (SanitizerMask Kind, llvm::Function *Fn, SourceLocation Loc) const
 
bool isInNoSanitizeList (SanitizerMask Kind, 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...
 
ProfileList::ExclusionType isFunctionBlockedByProfileList (llvm::Function *Fn, SourceLocation Loc) const
 
ProfileList::ExclusionType isFunctionBlockedFromProfileInstr (llvm::Function *Fn, SourceLocation Loc) const
 
SanitizerMetadatagetSanitizerMetadata ()
 
void addDeferredVTable (const CXXRecordDecl *RD)
 
void EmitGlobal (GlobalDecl D)
 Emit code for a single global function or var decl. More...
 
bool TryEmitBaseDestructorAsAlias (const CXXDestructorDecl *D)
 Try to emit a base destructor as an alias to its primary base-class destructor. More...
 
llvm::GlobalValue * GetGlobalValue (StringRef Ref)
 
void SetCommonAttributes (GlobalDecl GD, llvm::GlobalValue *GV)
 Set attributes which are common to any form of a global definition (alias, Objective-C method, function, global variable). 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...
 
void EmitOMPDeclareMapper (const OMPDeclareMapperDecl *D, CodeGenFunction *CGF=nullptr)
 Emit a code for declare mapper construct. More...
 
void EmitOMPRequiresDecl (const OMPRequiresDecl *D)
 Emit a code for requires directive. More...
 
void EmitOMPAllocateDecl (const OMPAllocateDecl *D)
 Emit a code for the allocate directive. More...
 
llvm::Optional< CharUnitsgetOMPAllocateAlignment (const VarDecl *VD)
 Return the alignment specified in an allocate directive, if present. 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...
 
bool AlwaysHasLTOVisibilityPublic (const CXXRecordDecl *RD)
 Returns whether the given record has public LTO visibility (regardless of -lto-whole-program-visibility) and therefore may not participate in (single-module) CFI and whole-program vtable optimization. More...
 
llvm::GlobalObject::VCallVisibility GetVCallVisibilityLevel (const CXXRecordDecl *RD, llvm::DenseSet< const CXXRecordDecl * > &Visited)
 Returns the vcall visibility of the given type. More...
 
void EmitVTableTypeMetadata (const CXXRecordDecl *RD, 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::ConstantInt * CreateKCFITypeId (QualType T)
 Generate a KCFI type identifier for T. More...
 
llvm::Metadata * CreateMetadataIdentifierForType (QualType T)
 Create a metadata identifier for the given type. More...
 
llvm::Metadata * CreateMetadataIdentifierForVirtualMemPtrType (QualType T)
 Create a metadata identifier that is intended to be used to check virtual calls via a member function pointer. More...
 
llvm::Metadata * CreateMetadataIdentifierGeneralized (QualType T)
 Create a metadata identifier for the generalization of the given type. More...
 
void CreateFunctionTypeMetadataForIcall (const FunctionDecl *FD, llvm::Function *F)
 Create and attach type metadata to the given function. More...
 
void setKCFIType (const FunctionDecl *FD, llvm::Function *F)
 Set type metadata to the given function. More...
 
void finalizeKCFITypes ()
 Emit KCFI type identifier constants and remove unused identifiers. More...
 
bool MayDropFunctionReturn (const ASTContext &Context, QualType ReturnType)
 Whether this function's return type has no side effects, and thus may be trivially discarded if it is unused. 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...
 
std::vector< const CXXRecordDecl * > getMostBaseClasses (const CXXRecordDecl *RD)
 Return a vector of most-base classes for RD. More...
 
llvm::GlobalVariable * GetOrCreateRTTIProxyGlobalVariable (llvm::Constant *Addr)
 
llvm::FunctionCallee getTerminateFn ()
 Get the declaration of std::terminate for the platform. More...
 
llvm::SanitizerStatReport & getSanStats ()
 
llvm::Value * createOpenCLIntToSamplerConversion (const Expr *E, CodeGenFunction &CGF)
 
void GenKernelArgMetadata (llvm::Function *FN, const FunctionDecl *FD=nullptr, CodeGenFunction *CGF=nullptr)
 OpenCL v1.2 s5.6.4.6 allows the compiler to store kernel argument information in the program executable. More...
 
llvm::Constant * getNullPointer (llvm::PointerType *T, QualType QT)
 Get target specific null pointer. More...
 
CharUnits getNaturalTypeAlignment (QualType T, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr, bool forPointeeType=false)
 
CharUnits getNaturalPointeeTypeAlignment (QualType T, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)
 
bool stopAutoInit ()
 
void printPostfixForExternalizedDecl (llvm::raw_ostream &OS, const Decl *D) const
 Print the postfix for externalized static variable or kernels for single source offloading languages CUDA and HIP. More...
 
void moveLazyEmissionStates (CodeGenModule *NewBuilder)
 Move some lazily-emitted states to the NewBuilder. More...
 
Custom Blocks Runtime Interfaces
llvm::Constant * getNSConcreteGlobalBlock ()
 
llvm::Constant * getNSConcreteStackBlock ()
 
llvm::FunctionCallee getBlockObjectAssign ()
 
llvm::FunctionCallee 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
 
LangAS getASTAllocaAddressSpace () const
 

Static Public Member Functions

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

Public Attributes

llvm::FunctionCallee IsOSVersionAtLeastFn = nullptr
 
llvm::FunctionCallee IsPlatformVersionAtLeastFn = nullptr
 
llvm::FoldingSet< BlockByrefHelpersByrefHelpersCache
 
int GlobalUniqueCount
 
- Public Attributes inherited from clang::CodeGen::CodeGenTypeCache
llvm::Type * VoidTy
 void More...
 
llvm::IntegerType * Int8Ty
 i8, i16, i32, and i64 More...
 
llvm::IntegerType * Int16Ty
 
llvm::IntegerType * Int32Ty
 
llvm::IntegerType * Int64Ty
 
llvm::Type * HalfTy
 half, bfloat, float, double More...
 
llvm::Type * BFloatTy
 
llvm::Type * FloatTy
 
llvm::Type * DoubleTy
 
llvm::IntegerType * IntTy
 int More...
 
llvm::IntegerType * CharTy
 char 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 {
   llvm::PointerType *   GlobalsVoidPtrTy
 
   llvm::PointerType *   GlobalsInt8PtrTy
 
}; 
 void* in default globals 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
 

Detailed Description

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

Definition at line 279 of file CodeGenModule.h.

Member Typedef Documentation

◆ CtorList

Definition at line 298 of file CodeGenModule.h.

Constructor & Destructor Documentation

◆ CodeGenModule()

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

Definition at line 102 of file CodeGenModule.cpp.

◆ ~CodeGenModule()

CodeGenModule::~CodeGenModule ( )

Definition at line 211 of file CodeGenModule.cpp.

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 2474 of file CodeGenModule.cpp.

Referenced by emitInterWarpCopyFunction(), Release(), and clang::CodeGen::CodeGenFunction::StartFunction().

◆ AddCXXDtorEntry()

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

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

Definition at line 1121 of file CodeGenModule.h.

◆ AddCXXPrioritizedStermFinalizerEntry()

void clang::CodeGen::CodeGenModule::AddCXXPrioritizedStermFinalizerEntry ( llvm::Function *  StermFinalizer,
int  Priority 
)
inline

Definition at line 1138 of file CodeGenModule.h.

References Priority.

◆ AddCXXStermFinalizerEntry()

void clang::CodeGen::CodeGenModule::AddCXXStermFinalizerEntry ( llvm::FunctionCallee  DtorFn)
inline

Add an sterm finalizer to the C++ global cleanup function.

Definition at line 1127 of file CodeGenModule.h.

◆ AddCXXStermFinalizerToGlobalDtor()

void clang::CodeGen::CodeGenModule::AddCXXStermFinalizerToGlobalDtor ( llvm::Function *  StermFinalizer,
int  Priority 
)
inline

Add an sterm finalizer to its own llvm.global_dtors entry.

Definition at line 1133 of file CodeGenModule.h.

References Priority.

◆ addDefaultFunctionDefinitionAttributes() [1/2]

void CodeGenModule::addDefaultFunctionDefinitionAttributes ( llvm::AttrBuilder &  attrs)

Like the overload taking a Function &, but intended specifically for frontends that want to build on Clang's target-configuration logic.

Definition at line 1964 of file CGCall.cpp.

◆ addDefaultFunctionDefinitionAttributes() [2/2]

void CodeGenModule::addDefaultFunctionDefinitionAttributes ( 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 1956 of file CGCall.cpp.

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

◆ AddDeferredUnusedCoverageMapping()

void CodeGenModule::AddDeferredUnusedCoverageMapping ( Decl D)

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

Definition at line 6470 of file CodeGenModule.cpp.

References clang::Decl::getBeginLoc(), getContext(), clang::Decl::getKind(), clang::ASTContext::getSourceManager(), LimitedCoverage(), and SM.

Referenced by EmitTopLevelDecl().

◆ addDeferredVTable()

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

Definition at line 1370 of file CodeGenModule.h.

◆ AddDependentLib()

void CodeGenModule::AddDependentLib ( StringRef  Lib)

Appends a dependent lib to the appropriate metadata value.

Definition at line 2534 of file CodeGenModule.cpp.

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

Referenced by EmitTopLevelDecl().

◆ AddDetectMismatch()

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

Appends a detect mismatch command to the linker options.

Definition at line 2525 of file CodeGenModule.cpp.

Referenced by EmitTopLevelDecl().

◆ 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 2892 of file CodeGenModule.cpp.

References EmitAnnotateAttr(), clang::Decl::getLocation(), clang::Decl::hasAttr(), and clang::Decl::specific_attrs().

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

◆ addGlobalValReplacement()

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

Definition at line 300 of file CodeGenModule.cpp.

◆ addReplacement()

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

Definition at line 265 of file CodeGenModule.cpp.

◆ addUsedGlobal()

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

◆ addUsedOrCompilerUsedGlobal()

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

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

Definition at line 2480 of file CodeGenModule.cpp.

References getTriple().

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

◆ AddVTableTypeMetadata()

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

Create and attach type metadata for the given vtable.

Definition at line 6902 of file CodeGenModule.cpp.

References CreateCrossDsoCfiTypeId(), CreateMetadataIdentifierForType(), getLLVMContext(), clang::TypeDecl::getTypeForDecl(), NeedAllVtablesTypeId(), and Offset.

Referenced by EmitVTableTypeMetadata().

◆ AlwaysHasLTOVisibilityPublic()

bool CodeGenModule::AlwaysHasLTOVisibilityPublic ( const CXXRecordDecl RD)

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

Definition at line 1205 of file CGVTables.cpp.

References getCodeGenOpts(), clang::DeclContext::getParent(), clang::DeclContext::getRedeclContext(), and clang::Decl::hasAttr().

Referenced by clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), and HasHiddenLTOVisibility().

◆ AppendLinkerOptions()

void CodeGenModule::AppendLinkerOptions ( StringRef  Opts)

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

Definition at line 2520 of file CodeGenModule.cpp.

References getLLVMContext().

Referenced by EmitTopLevelDecl().

◆ clear()

void CodeGenModule::clear ( )

Definition at line 440 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 6496 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters().

◆ codegenCXXStructor()

llvm::Function * CodeGenModule::codegenCXXStructor ( GlobalDecl  GD)

◆ computeNonVirtualBaseClassOffset()

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

◆ ConstructAttributeList()

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

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

Construct the IR attribute list of a function or call.

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.

When adding an attribute, please consider where it should be handled:

  • getDefaultFunctionAttributes is for attributes that are essentially part of the global target configuration (but perhaps can be overridden on a per-function basis). Adding attributes there will cause them to also be set in frontends that build on Clang's target-configuration logic, as well as for code defined in library modules such as CUDA's libdevice.
  • ConstructAttributeList builds on top of getDefaultFunctionAttributes and adds declaration-specific, convention-specific, and frontend-specific logic. The last is of particular importance: attributes that restrict how the frontend generates code must be added here rather than getDefaultFunctionAttributes.

Definition at line 2094 of file CGCall.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitMustTailThunk(), and SetLLVMFunctionAttributes().

◆ CreateCrossDsoCfiTypeId()

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

◆ CreateFunctionTypeMetadataForIcall()

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

◆ CreateGlobalInitOrCleanUpFunction()

llvm::Function * CodeGenModule::CreateGlobalInitOrCleanUpFunction ( llvm::FunctionType *  ty,
const Twine &  name,
const CGFunctionInfo FI,
SourceLocation  Loc = SourceLocation(),
bool  TLS = false,
llvm::GlobalVariable::LinkageTypes  Linkage = llvm::GlobalVariable::InternalLinkage 
)

◆ CreateKCFITypeId()

llvm::ConstantInt * CodeGenModule::CreateKCFITypeId ( QualType  T)

◆ 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 6842 of file CodeGenModule.cpp.

Referenced by AddVTableTypeMetadata(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), and SetLLVMFunctionAttributesForDefinition().

◆ CreateMetadataIdentifierForVirtualMemPtrType()

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

Create a metadata identifier that is intended to be used to check virtual calls via a member function pointer.

Definition at line 6847 of file CodeGenModule.cpp.

Referenced by EmitVTableTypeMetadata().

◆ CreateMetadataIdentifierGeneralized()

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

Create a metadata identifier for the generalization of the given type.

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

Definition at line 6883 of file CodeGenModule.cpp.

References GeneralizeFunctionType(), and getContext().

Referenced by CreateFunctionTypeMetadataForIcall(), and clang::CodeGen::CodeGenFunction::EmitCall().

◆ createOpenCLIntToSamplerConversion()

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

◆ CreateOrReplaceCXXRuntimeVariable()

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

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 4497 of file CodeGenModule.cpp.

◆ CreateRuntimeFunction()

llvm::FunctionCallee CodeGenModule::CreateRuntimeFunction ( llvm::FunctionType *  Ty,
StringRef  Name,
llvm::AttributeList  ExtraAttrs = llvm::AttributeList(),
bool  Local = false,
bool  AssumeConvergent = 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 4562 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), GetAddrOfConstantCFString(), and getTlsGuardVar().

◆ createUnnamedGlobalFrom()

Address CodeGenModule::createUnnamedGlobalFrom ( const VarDecl D,
llvm::Constant *  Constant,
CharUnits  Align 
)

◆ DecorateInstructionWithInvariantGroup()

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

Adds !invariant.barrier !tag to instruction.

Definition at line 1061 of file CodeGenModule.cpp.

References getLLVMContext().

Referenced by clang::CodeGen::CodeGenFunction::GetVTablePtr(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointer().

◆ DecorateInstructionWithTBAA()

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

◆ 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 2864 of file CodeGenModule.cpp.

References EmitAnnotationArgs(), EmitAnnotationLineNo(), EmitAnnotationString(), EmitAnnotationUnit(), getDataLayout(), and clang::CodeGen::CodeGenTypeCache::GlobalsInt8PtrTy.

Referenced by AddGlobalAnnotations().

◆ EmitAnnotationArgs()

llvm::Constant * CodeGenModule::EmitAnnotationArgs ( const AnnotateAttr *  Attr)

◆ EmitAnnotationLineNo()

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

◆ EmitAnnotationString()

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

Emit an annotation string.

Definition at line 2799 of file CodeGenModule.cpp.

References AnnotationSection, getLLVMContext(), getModule(), and s.

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 6511 of file CodeGenModule.cpp.

References clang::Ctor_Base, clang::Dtor_Base, clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping(), getFunctionLinkage(), clang::Decl::getKind(), and getMangledName().

Referenced by Release().

◆ EmitExplicitCastExprType()

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

◆ EmitExternalDeclaration()

void CodeGenModule::EmitExternalDeclaration ( const VarDecl D)

Definition at line 4594 of file CodeGenModule.cpp.

◆ EmitGlobal()

void CodeGenModule::EmitGlobal ( GlobalDecl  D)

◆ EmitGlobalAnnotations()

void CodeGenModule::EmitGlobalAnnotations ( )

Emit all the global annotations.

Definition at line 2786 of file CodeGenModule.cpp.

References AnnotationSection, and getModule().

Referenced by Release().

◆ EmitMainVoidAlias()

void CodeGenModule::EmitMainVoidAlias ( )

Emit an alias for "main" if it has no arguments (needed for wasm).

Definition at line 6551 of file CodeGenModule.cpp.

References clang::serialized_diags::create(), clang::TargetInfo::getIntWidth(), getModule(), clang::ASTContext::getTargetInfo(), and clang::HiddenVisibility.

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 2373 of file CGExprConstant.cpp.

References EmitNullConstant().

Referenced by EmitNullBaseClassInitialization().

◆ EmitOMPAllocateDecl()

void CodeGenModule::EmitOMPAllocateDecl ( const OMPAllocateDecl D)

◆ EmitOMPDeclareMapper()

void CodeGenModule::EmitOMPDeclareMapper ( const OMPDeclareMapperDecl D,
CodeGenFunction CGF = nullptr 
)

Emit a code for declare mapper construct.

Definition at line 2634 of file CGDecl.cpp.

References clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), getOpenMPRuntime(), and clang::Decl::isUsed().

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

◆ EmitOMPDeclareReduction()

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

Emit a code for declare reduction construct.

Definition at line 2627 of file CGDecl.cpp.

References clang::CodeGen::CGOpenMPRuntime::emitUserDefinedReduction(), getOpenMPRuntime(), and clang::Decl::isUsed().

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

◆ EmitOMPRequiresDecl()

void CodeGenModule::EmitOMPRequiresDecl ( const OMPRequiresDecl D)

Emit a code for requires directive.

Parameters
DRequires declaration

Definition at line 2642 of file CGDecl.cpp.

References getOpenMPRuntime(), and clang::CodeGen::CGOpenMPRuntime::processRequiresDirective().

◆ EmitOMPThreadPrivateDecl()

void CodeGenModule::EmitOMPThreadPrivateDecl ( const OMPThreadPrivateDecl D)

Emit a code for threadprivate directive.

Parameters
DThreadprivate declaration.

Definition at line 6795 of file CodeGenModule.cpp.

References GetAddrOfGlobalVar(), getContext(), getOpenMPRuntime(), clang::ValueDecl::getType(), getTypes(), and clang::OMPThreadPrivateDecl::varlists().

◆ EmitTentativeDefinition()

void CodeGenModule::EmitTentativeDefinition ( const VarDecl D)

Definition at line 4571 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 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 1115 of file CGVTables.cpp.

References clang::CodeGen::CodeGenVTables::GenerateClassData().

◆ EmitVTableTypeMetadata()

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

◆ Error()

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

◆ ErrorUnsupported() [1/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 1084 of file CodeGenModule.cpp.

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

◆ ErrorUnsupported() [2/2]

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

◆ finalizeKCFITypes()

void CodeGenModule::finalizeKCFITypes ( )

Emit KCFI type identifier constants and remove unused identifiers.

Definition at line 2328 of file CodeGenModule.cpp.

References getModule().

Referenced by Release().

◆ GenKernelArgMetadata()

void CodeGenModule::GenKernelArgMetadata ( llvm::Function *  FN,
const FunctionDecl FD = nullptr,
CodeGenFunction CGF = nullptr 
)

OpenCL v1.2 s5.6.4.6 allows the compiler to store kernel argument information in the program executable.

The argument information stored includes the argument name, its type, the address and access qualifiers used. This helper can be used to generate metadata for source code kernel function as well as generated implicitly kernels. If a kernel is generated implicitly null value has to be passed to the last two parameters, otherwise all parameters must have valid non-null values.

Parameters
FNis a pointer to IR function being generated.
FDis a pointer to function declaration if any.
CGFis a pointer to CodeGenFunction that generates this function.

Definition at line 1746 of file CodeGenModule.cpp.

References ArgInfoAddressSpace(), clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Decl::getAttr(), clang::QualType::getCanonicalType(), getCodeGenOpts(), getLangOpts(), clang::NamedDecl::getName(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::ASTContext::getPrintingPolicy(), clang::ValueDecl::getType(), clang::QualType::isConstQualified(), clang::Type::isImageType(), clang::Type::isPipeType(), clang::Type::isPointerType(), clang::QualType::isRestrictQualified(), clang::QualType::isVolatileQualified(), clang::OpenCL, clang::opencl_constant, clang::opencl_global, removeImageAccessQualifier(), and string().

◆ getAddrAndTypeOfCXXStructor()

llvm::FunctionCallee CodeGenModule::getAddrAndTypeOfCXXStructor ( GlobalDecl  GD,
const CGFunctionInfo FnInfo = nullptr,
llvm::FunctionType *  FnType = nullptr,
bool  DontDefer = false,
ForDefinition_t  IsForDefinition = NotForDefinition 
)

◆ 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 2213 of file CGExprConstant.cpp.

References clang::CompoundLiteralExpr::isFileScope().

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

◆ 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 2200 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 5887 of file CodeGenModule.cpp.

References castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CodeGenTypeCache::CharTy, GenerateStringLiteral(), clang::ASTContext::getAlignOfGlobalVarInChars(), clang::CharUnits::getAsAlign(), getContext(), getLLVMContext(), and clang::CharUnits::getQuantity().

Referenced by buildBlockDescriptor(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), and GetAddrOfConstantStringFromObjCEncode().

◆ 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 5825 of file CodeGenModule.cpp.

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

◆ 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 5877 of file CodeGenModule.cpp.

References GetAddrOfConstantCString(), getContext(), clang::ObjCEncodeExpr::getEncodedType(), clang::ASTContext::getObjCEncodingForType(), and string().

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

◆ getAddrOfCXXStructor()

llvm::Constant* clang::CodeGen::CodeGenModule::getAddrOfCXXStructor ( GlobalDecl  GD,
const CGFunctionInfo FnInfo = nullptr,
llvm::FunctionType *  FnType = nullptr,
bool  DontDefer = false,
ForDefinition_t  IsForDefinition = NotForDefinition 
)
inline

Return the address of the constructor/destructor of the given type.

Definition at line 1062 of file CodeGenModule.h.

References getAddrAndTypeOfCXXStructor().

Referenced by codegenCXXStructor(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), and GetAddrOfGlobal().

◆ 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 4118 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTypes::ConvertType(), clang::Dtor_Base, clang::Dtor_Complete, getCUDARuntime(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CGCUDARuntime::getKernelHandle(), getMangledName(), getTarget(), clang::ValueDecl::getType(), and getTypes().

Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), EmitFunctionDeclPointer(), EmitNewDeleteCall(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfGlobal(), and GetFunctionStart().

◆ GetAddrOfGlobal()

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

◆ GetAddrOfGlobalBlock()

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

Gets the address of a block which requires no captures.

Definition at line 1292 of file CGBlocks.cpp.

◆ 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 995 of file CodeGenModule.h.

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

◆ GetAddrOfGlobalTemporary()

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

◆ 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 guaranteed 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 4546 of file CodeGenModule.cpp.

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

Referenced by EmitGlobal(), EmitGlobalVarDeclLValue(), EmitOMPThreadPrivateDecl(), GetAddrOfGlobal(), and HandleCXXStaticMemberVarInstantiation().

◆ GetAddrOfMSGuidDecl()

ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl ( const MSGuidDecl GD)

◆ GetAddrOfRTTIDescriptor()

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

◆ GetAddrOfTemplateParamObject()

ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject ( const TemplateParamObjectDecl TPO)

Get the address of a template parameter object.

Definition at line 3161 of file CodeGenModule.cpp.

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

◆ GetAddrOfThunk()

llvm::Constant * CodeGenModule::GetAddrOfThunk ( StringRef  Name,
llvm::Type *  FnTy,
GlobalDecl  GD 
)

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

Definition at line 34 of file CGVTables.cpp.

◆ GetAddrOfUnnamedGlobalConstantDecl()

ConstantAddress CodeGenModule::GetAddrOfUnnamedGlobalConstantDecl ( const UnnamedGlobalConstantDecl GCD)

◆ 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 ( )

◆ getBlockMangledName()

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

◆ getBlockObjectAssign()

llvm::FunctionCallee CodeGenModule::getBlockObjectAssign ( )

◆ getBlockObjectDispose()

llvm::FunctionCallee 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 89 of file CGBuiltin.cpp.

References clang::ASTContext::BuiltinInfo, and clang::Builtin::Context::isLibFunction().

◆ getClassPointerAlignment()

CharUnits CodeGenModule::getClassPointerAlignment ( const CXXRecordDecl CD)

◆ getCodeGenOpts()

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

Definition at line 731 of file CodeGenModule.h.

Referenced by clang::CodeGen::CoverageMappingModuleGen::addFunctionMappingRecord(), clang::CodeGen::CGDebugInfo::addHeapAllocSiteMetadata(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayCustomEvents(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayTypedEvents(), AlwaysHasLTOVisibilityPublic(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), clang::CodeGen::CGDebugInfo::CGDebugInfo(), clang::CodeGen::CodeGenFunction::checkIfFunctionMustProgress(), clang::CodeGen::CodeGenFunction::checkIfLoopMustProgress(), clang::CodeGen::CGCXXABI::constructorsAndDestructorsReturnThis(), clang::CodeGen::CoverageMappingModuleGen::CoverageMappingModuleGen(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitARCDestroyStrong(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitBranchToCounterBlock(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), emitCheckHandlerCall(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDeclRefExprDbgValue(), clang::CodeGen::CodeGenFunction::EmitDestructorBody(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), EmitObjectDelete(), emitOptimizedARCReturnCall(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitSanitizerStatReport(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), EmitVTableTypeMetadata(), emitWritebackArg(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), GenKernelArgMetadata(), clang::CodeGen::CodeGenFunction::getARCCleanupKind(), clang::CodeGen::CodeGenTypes::getCodeGenOpts(), getCodegenToUse(), clang::CodeGen::CGDebugInfo::getOrCreateRecordType(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::CodeGen::CodeGenFunction::GetVTablePtr(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), isFunctionBlockedByProfileList(), isFunctionBlockedFromProfileInstr(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), needsTypeIdentifier(), Release(), requiresMemberFunctionPointerTypeMetadata(), clang::CodeGen::CodeGenFunction::setBlockContextParameter(), clang::CodeGen::CodeGenPGO::setValueProfilingFlag(), shouldAssumeDSOLocal(), shouldEmitAvailableExternallyVTable(), shouldEmitVTableThunk(), clang::CodeGen::CodeGenFunction::ShouldEmitVTableTypeCheckedLoad(), clang::CodeGen::CodeGenFunction::ShouldInstrumentFunction(), shouldSplitConstantStore(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), clang::CodeGen::CodeGenFunction::ShouldXRayInstrumentFunction(), clang::CodeGen::CodeGenFunction::StartFunction(), TryEmitBaseDestructorAsAlias(), and TypeRequiresBuiltinLaunder().

◆ GetConstantArrayFromStringLiteral()

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

◆ getContext()

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

Definition at line 722 of file CodeGenModule.h.

Referenced by AddDeferredUnusedCoverageMapping(), clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), buildBlockDescriptor(), buildByrefHelpers(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), buildGlobalBlock(), clang::CodeGen::CGCXXABI::buildThisParam(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), classifyType(), clang::CodeGen::CGOpenMPRuntimeGPU::clear(), clang::CodeGen::CGDebugInfo::completeClass(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CodeGen::CGDebugInfo::completeType(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), clang::CodeGen::CGObjCRuntime::ComputeBitfieldBitOffset(), computeBlockInfo(), clang::CodeGen::CGObjCRuntime::ComputeIvarBaseOffset(), computeNonVirtualBaseClassOffset(), configureBlocksRuntimeObject(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), createCXXABI(), clang::CodeGen::CreateItaniumCXXABI(), CreateKCFITypeId(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), CreateMetadataIdentifierGeneralized(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), createPrivatesRecordDecl(), createUnnamedGlobalFrom(), EmitAnnotationLineNo(), EmitAnnotationUnit(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), emitCopyprivateCopyFunction(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetVarDefinition(), EmitDeclDestroy(), clang::CodeGen::CGOpenMPRuntime::emitDependClause(), emitDependData(), clang::CodeGen::CGOpenMPRuntime::emitDepobjDependClause(), clang::CodeGen::CGOpenMPRuntime::emitDestroyClause(), emitDestructorsFunction(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossOrdered(), clang::CodeGen::ConstantEmitter::emitForMemory(), EmitFunctionDeclPointer(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::CGOpenMPRuntime::emitKmpRoutineEntryT(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalInit(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CGCXXABI::EmitMemberFunctionPointer(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), EmitOMPAllocateDecl(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), clang::CodeGen::CGOpenMPRuntime::emitRequiresDirectiveRegFun(), clang::CodeGen::CodeGenFunction::EmitScalarRangeCheck(), emitShuffleAndReduceFunction(), clang::CodeGen::CGOpenMPRuntime::emitSingleRegion(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), emitTaskDupFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFixups(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), EmitTopLevelDecl(), clang::CodeGen::CGOpenMPRuntime::emitUpdateClause(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), extractFieldType(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), GenerateStringLiteral(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), GetAddrOfConstantCFString(), GetAddrOfConstantCString(), GetAddrOfConstantStringFromObjCEncode(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfGlobalTemporary(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), GetAddrOfUnnamedGlobalConstantDecl(), getAsmSrcLocInfo(), getBlockCaptureStr(), getBlockDescriptorType(), getClassPointerAlignment(), clang::CodeGen::CGCXXABI::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), clang::CodeGen::CGOpenMPRuntime::getDepobjElements(), getDynamicOffsetAlignment(), getFunctionLinkage(), clang::CodeGen::CGDebugInfo::getFunctionType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAcquireFn(), getInstrProfSection(), getLLVMLinkageVarDefinition(), getMangledName(), clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize(), getMemberPointerConstant(), getMinimumClassObjectSize(), getMinimumObjectSize(), getNaturalTypeAlignment(), getNonMemoryType(), clang::CodeGen::getNonTrivialCStructCopyAssignmentOperator(), clang::CodeGen::getNonTrivialCStructCopyConstructor(), clang::CodeGen::getNonTrivialCStructDefaultConstructor(), clang::CodeGen::getNonTrivialCStructDestructor(), clang::CodeGen::getNonTrivialCStructMoveAssignmentOperator(), clang::CodeGen::getNonTrivialCStructMoveConstructor(), GetNonVirtualBaseClassOffset(), getOMPAllocateAlignment(), clang::CodeGen::CGOpenMPRuntime::getOrCreateThreadPrivateCache(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), getTypeInfoLinkage(), getVBaseAlignment(), GetWeakRefReference(), imbueXRayAttrs(), InitCatchParam(), InitDeviceMC(), clang::CodeGen::initializationPatternFor(), initializeForBlockHeader(), isFunctionBlockedByProfileList(), isInNoSanitizeList(), clang::CodeGen::swiftcall::isLegalIntegerType(), clang::CodeGen::CodeGenVTables::isVTableExternal(), printPostfixForExternalizedDecl(), Release(), SetLLVMFunctionAttributesForDefinition(), clang::CodeGen::CGDebugInfo::setLocation(), setUsedBits(), shouldBeInCOMDAT(), ShouldUseExternalRTTIDescriptor(), clang::CodeGen::CodeGenFunction::StartThunk(), stopAutoInit(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), clang::CodeGen::ConstantEmitter::tryEmitConstantExpr(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(), and TypeRequiresBuiltinLaunder().

◆ getCoverageMapping()

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

Definition at line 661 of file CodeGenModule.h.

◆ getCUDARuntime()

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

◆ getCXXABI()

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

Definition at line 742 of file CodeGenModule.h.

Referenced by BuildAppleKextVirtualCall(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), CalculateCookiePadding(), commonEmitCXXMemberOrOperatorCall(), EmitArrayDelete(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitCXXMemberDataPointerAddress(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDelegateCallArg(), clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), EmitDestroyingObjectDelete(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), EmitDynamicCastToNull(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitInlinedInheritingCXXConstructorCall(), EmitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNonNullRValueCheck(), EmitNullBaseClassInitialization(), EmitNullConstant(), EmitObjectDelete(), EmitTopLevelDecl(), EmitTypeidFromVTable(), clang::CodeGen::CodeGenFunction::EmitVTableAssumptionLoad(), clang::CodeGen::CodeGenFunction::EmitVTableAssumptionLoads(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), EmitVTableTypeMetadata(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalCleanUpFunc(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), getAddrAndTypeOfCXXStructor(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), GetAddrOfFunction(), GetAddrOfRTTIDescriptor(), GetAddrOfVTTVTable(), getBlockMangledName(), clang::CodeGen::getCXXDestructorImplicitParam(), getFunctionLinkage(), clang::CodeGen::getImplicitCXXConstructorArgs(), getMangledName(), getMemberPointerConstant(), clang::CodeGen::CGObjCRuntime::getSymbolNameForMethod(), getTerminateFn(), clang::CodeGen::CodeGenFunction::getTerminateFunclet(), clang::CodeGen::CodeGenFunction::getTerminateHandler(), clang::CodeGen::CodeGenFunction::getTerminateLandingPad(), getVTableLinkage(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), hasInAllocaArgs(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), clang::CodeGen::CodeGenFunction::InitializeVTablePointers(), PerformReturnAdjustment(), clang::CodeGen::CGCallee::prepareConcreteCallee(), pushTemporaryCleanup(), setDLLImportDLLExport(), SetLLVMFunctionAttributesForDefinition(), setThunkProperties(), shouldEmitAvailableExternallyVTable(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::StartThunk(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().

◆ getDataLayout()

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

Definition at line 734 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::ConstantAggregateBuilderBase::addPlaceholderWithSize(), CoerceIntOrPtrToIntOrPtr(), complexTempStructure(), constStructWithPadding(), CreateCoercedLoad(), CreateCoercedStore(), clang::CodeGen::CodeGenFunction::emitAlignmentAssumption(), EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitLifetimeEnd(), clang::CodeGen::CodeGenFunction::EmitLifetimeStart(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), emitOMPAtomicRMW(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), emitPointerArithmetic(), emitVoidPtrDirectVAArg(), emitWriteback(), emitWritebackArg(), EnterStructPointerForCoercedAccess(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalInitFunc(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), GetAddrOfConstantCFString(), clang::CodeGen::CodeGenFunction::getBlockByrefInfo(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), clang::CodeGen::swiftcall::getNaturalAlignment(), getOpaquePersonalityFn(), GetTargetTypeStoreSize(), getTypeAllocSize(), getTypeStoreSize(), initializeForBlockHeader(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), isFullSizeType(), clang::CodeGen::DominatingLLVMValue::save(), and setUsedBits().

◆ GetDefaultLLVMTLSModel()

llvm::GlobalVariable::ThreadLocalMode CodeGenModule::GetDefaultLLVMTLSModel ( ) const

◆ 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 89 of file CGClass.cpp.

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

Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberDataPointerAddress(), and getVBaseAlignment().

◆ getExpressionLocationsEnabled()

bool CodeGenModule::getExpressionLocationsEnabled ( ) const

Return true if we should emit location information for expressions.

Definition at line 5722 of file CodeGenModule.cpp.

◆ getFileSystem()

const IntrusiveRefCntPtr<llvm::vfs::FileSystem>& clang::CodeGen::CodeGenModule::getFileSystem ( ) const
inline

Definition at line 724 of file CodeGenModule.h.

◆ getFunctionLinkage()

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

◆ GetFunctionStart()

llvm::Constant * CodeGenModule::GetFunctionStart ( const ValueDecl Decl)

Definition at line 4157 of file CodeGenModule.cpp.

References GetAddrOfFunction().

◆ getGenericBlockLiteralType()

llvm::Type * CodeGenModule::getGenericBlockLiteralType ( )

◆ GetGlobalConstantAddressSpace()

LangAS CodeGenModule::GetGlobalConstantAddressSpace ( ) const

Return the AST address space of constant literal, which is used to emit the constant literal as global variable in LLVM IR.

Note: This is not necessarily the address space of the constant literal in AST. For address space agnostic language, e.g. C++, constant literal in AST is always in default address space.

Definition at line 4640 of file CodeGenModule.cpp.

References clang::cuda_device, clang::Default, getTarget(), getTriple(), clang::opencl_constant, and clang::sycl_global.

Referenced by castStringLiteralToDefaultAddressSpace(), createUnnamedGlobalFrom(), and GenerateStringLiteral().

◆ getGlobalCtors()

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

Definition at line 761 of file CodeGenModule.h.

◆ getGlobalDtors()

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

Definition at line 762 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 4603 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::QualType::isConstQualified(), clang::opencl_constant, clang::opencl_global, clang::opencl_global_device, clang::opencl_global_host, clang::opencl_local, and clang::sycl_global.

Referenced by EmitOMPAllocateDecl().

◆ getHeaderSearchOpts()

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

Definition at line 727 of file CodeGenModule.h.

◆ getHLSLRuntime()

CGHLSLRuntime& clang::CodeGen::CodeGenModule::getHLSLRuntime ( )
inline

Return a reference to the configured HLSL runtime.

Definition at line 642 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(), Release(), and clang::CodeGen::CodeGenFunction::StartFunction().

◆ getIntrinsic()

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

Definition at line 5486 of file CodeGenModule.cpp.

References getModule().

Referenced by clang::CodeGen::CallArgList::allocateArgumentMemory(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCNoopIntrinsicUse(), emitBinaryBuiltin(), emitBinaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCallMaybeConstrainedFPBuiltin(), emitCatchDispatchBlock(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCoroutineIntrinsic(), EmitCXXNewAllocSize(), EmitFAbs(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), emitFPIntBuiltin(), clang::CodeGen::CGHLSLRuntime::emitInputSemantic(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), emitMaybeConstrainedFPToIntRoundBuiltin(), EmitOverflowIntrinsic(), emitRangedBuiltin(), EmitScalarFMAExpr(), EmitSystemZIntrinsicWithCC(), emitTernaryBuiltin(), emitTernaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), emitUnaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), emitWasmCatchPadBlock(), EmitX86CompressExpand(), EmitX86CompressStore(), EmitX86ConvertIntToFp(), EmitX86CvtF16ToFloatExpr(), EmitX86ExpandLoad(), EmitX86FMAExpr(), EmitX86FunnelShift(), EmitX86Ternlog(), clang::CodeGen::CallArgList::freeArgumentMemory(), and getARCIntrinsic().

◆ getItaniumVTableContext()

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

◆ getLangOpts()

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

Definition at line 723 of file CodeGenModule.h.

Referenced by addMonoNonMonoModifier(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), buildBlockDescriptor(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CGOpenMPRuntime::CGOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CodeGen::CGDebugInfo::completeType(), computeBlockInfo(), configureBlocksRuntimeObject(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CreateGNUObjCRuntime(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitARCReclaimReturnedObject(), EmitAtomicOp(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CGOpenMPRuntime::emitBarrierCall(), EmitBaseInitializer(), clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetVarDefinition(), clang::CodeGen::CodeGenFunction::EmitDelegatingCXXConstructorCall(), EmitDirectCallee(), clang::CodeGen::CGOpenMPRuntime::emitDistributeStaticInit(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), clang::CodeGen::CGOpenMPRuntime::emitFlush(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), EmitGlobal(), clang::CodeGen::CodeGenFunction::EmitLandingPad(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalUpdate(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolCleanup(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), EmitObjectDelete(), emitOMPAtomicCaptureExpr(), clang::CodeGen::CGOpenMPRuntime::emitRequiresDirectiveRegFun(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskyieldCall(), EmitThreadPrivateVarDeclLValue(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), GenerateStringLiteral(), GenKernelArgMetadata(), clang::CodeGen::EHPersonality::get(), GetAddrOfConstantCFString(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfRTTIDescriptor(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getBlockDescriptorType(), getDataSharingMode(), getGenericBlockLiteralType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), clang::CodeGen::CodeGenFunction::getInvokeDestImpl(), clang::CodeGen::CodeGenFunction::getLangOpts(), getLLVMLinkageForDeclarator(), getMangledName(), getNaturalTypeAlignment(), clang::CodeGen::CGOpenMPRuntime::getOrCreateThreadPrivateCache(), getStaticDeclName(), getTBAAAccessInfo(), getTerminateFn(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), getTypeInfoLinkage(), hasMRCWeakIvars(), initializeForBlockHeader(), clang::CodeGen::CGOpenMPRuntime::isNontemporalDecl(), clang::CodeGen::CGOpenMPRuntime::loadOffloadInfoMetadata(), clang::CodeGen::CodeGenFunction::LValueIsSuitableForInlineAtomic(), clang::CodeGen::CGOpenMPRuntime::markAsGlobalTarget(), MaybeHandleStaticInExternC(), printPostfixForExternalizedDecl(), Release(), clang::CodeGen::CodeGenVTables::RemoveHwasanMetadata(), clang::CodeGen::SanitizerMetadata::reportGlobal(), setARCRuntimeFunctionLinkage(), setGlobalVisibility(), shouldAssumeDSOLocal(), shouldMapVisibilityToDLLExport(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), tryCaptureAsConstant(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), UseOptimizedSetter(), clang::CodeGen::CodeGenFunction::~CodeGenFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII(), and clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII().

◆ getLLVMContext()

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

Definition at line 743 of file CodeGenModule.h.

Referenced by AddDependentLib(), clang::CodeGen::CoverageMappingModuleGen::addFunctionMappingRecord(), clang::CodeGen::CGDebugInfo::addHeapAllocSiteMetadata(), addLinkOptionsPostorder(), AddVTableTypeMetadata(), AppendLinkerOptions(), buildBlockDescriptor(), buildGlobalBlock(), computeBlockInfo(), constStructWithPadding(), DecorateInstructionWithInvariantGroup(), clang::CodeGen::SanitizerMetadata::disableSanitizerForInstruction(), clang::CodeGen::CoverageMappingModuleGen::emit(), EmitAnnotationString(), EmitAtomicOp(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInitBranch(), EmitGlobalDeclMetadata(), EmitSignBit(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), clang::CodeGen::ConstantAggregateBuilderBase::finishStruct(), GetAddrOfConstantCString(), getClangCallTerminateFn(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), getDynTlsOnDemandInitFn(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAbortFn(), getGuardAcquireFn(), getGuardReleaseFn(), getInitThreadAbortFn(), getInitThreadFooterFn(), getInitThreadHeaderFn(), clang::CodeGen::CodeGenFunction::getLLVMContext(), getNoObjCARCExceptionsMetadata(), getOpaquePersonalityFn(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), clang::CodeGen::CodeGenFunction::getTerminateFunclet(), getTlsGuardVar(), clang::CodeGen::CodeGenVTables::getVTableType(), clang::CodeGen::initializationPatternFor(), initializeAlloca(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().

◆ getLLVMLifetimeEndFn()

llvm::Function * CodeGenModule::getLLVMLifetimeEndFn ( )

Lazily declare the @llvm.lifetime.end intrinsic.

Definition at line 2416 of file CGDecl.cpp.

References clang::CodeGen::CodeGenTypeCache::AllocaInt8PtrTy, and getModule().

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

◆ getLLVMLifetimeStartFn()

llvm::Function * CodeGenModule::getLLVMLifetimeStartFn ( )

Lazily declare the @llvm.lifetime.start intrinsic.

Definition at line 2407 of file CGDecl.cpp.

References clang::CodeGen::CodeGenTypeCache::AllocaInt8PtrTy, and getModule().

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)

◆ getMangledNameDecl()

const GlobalDecl CodeGenModule::getMangledNameDecl ( StringRef  Name)

Definition at line 1573 of file CodeGenModule.cpp.

◆ getMemberPointerConstant()

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

◆ getMicrosoftVTableContext()

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

◆ getMinimumClassObjectSize()

CharUnits CodeGenModule::getMinimumClassObjectSize ( const CXXRecordDecl RD)

Returns the minimum object size for an object of the given class type (or a class derived from it).

Return the smallest possible amount of storage that might be allocated starting from the beginning of an object of a particular class.

This may be smaller than sizeof(RD) if RD has virtual base classes.

Definition at line 57 of file CGClass.cpp.

References clang::ASTContext::getASTRecordLayout(), getContext(), clang::ASTRecordLayout::getSize(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::isEffectivelyFinal(), max(), and clang::CharUnits::One().

Referenced by getMinimumObjectSize().

◆ getMinimumObjectSize()

CharUnits clang::CodeGen::CodeGenModule::getMinimumObjectSize ( QualType  Ty)
inline

Returns the minimum object size for an object of the given type.

Definition at line 949 of file CodeGenModule.h.

References clang::Type::getAsCXXRecordDecl(), getContext(), getMinimumClassObjectSize(), and clang::ASTContext::getTypeSizeInChars().

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

◆ getModule()

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

Definition at line 732 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), buildBlockDescriptor(), buildGlobalBlock(), clang::CodeGen::CGOpenMPRuntimeGPU::clear(), createRuntimeShuffleFunction(), clang::CodeGen::CoverageMappingModuleGen::emit(), EmitAnnotationArgs(), EmitAnnotationString(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), clang::CodeGen::CGOpenMPRuntime::emitBarrierCall(), clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), clang::CodeGen::CGOpenMPRuntime::emitCancellationPointCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntime::emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossOrdered(), clang::CodeGen::CGHLSLRuntime::emitEntryFunction(), clang::CodeGen::CGOpenMPRuntime::emitFlush(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), EmitGlobalAnnotations(), EmitGlobalDeclMetadata(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalFinalUpdate(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), EmitMainVoidAlias(), clang::CodeGen::CGOpenMPRuntime::emitMaskedRegion(), clang::CodeGen::CGOpenMPRuntime::emitMasterRegion(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CGOpenMPRuntime::emitNumTeamsClause(), clang::CodeGen::CGOpenMPRuntime::emitNumThreadsClause(), clang::CodeGen::CodeGenFunction::EmitNVPTXDevicePrintfCallExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), EmitOMPAllocateDecl(), clang::CodeGen::CGOpenMPRuntime::emitOrderedRegion(), emitOutlinedFunctionPrologue(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), clang::CodeGen::CGOpenMPRuntime::emitParallelCall(), clang::CodeGen::CGOpenMPRuntime::emitProcBindClause(), clang::CodeGen::CGOpenMPRuntime::emitRequiresDirectiveRegFun(), emitShuffleAndReduceFunction(), clang::CodeGen::CGOpenMPRuntime::emitSingleRegion(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataStandAloneCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskgroupRegion(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskLoopCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskOutlinedFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFini(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskyieldCall(), clang::CodeGen::CGOpenMPRuntime::emitTeamsCall(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarInit(), EmitTopLevelDecl(), finalizeKCFITypes(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CGHLSLRuntime::generateGlobalCtorDtorCalls(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenVTables::GenerateRelativeVTableAlias(), GenerateStringLiteral(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::ConstantAggregateBuilderBase::getAddrOfCurrentPosition(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfGlobalTemporary(), clang::CodeGen::ConstantAggregateBuilderBase::getAddrOfPosition(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), GetAddrOfUnnamedGlobalConstantDecl(), getClangCallTerminateFn(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUNumThreads(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUThreadID(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUWarpSize(), getInitThreadEpochPtr(), getIntrinsic(), getLLVMLifetimeEndFn(), getLLVMLifetimeStartFn(), getSanStats(), clang::CodeGen::CGOpenMPRuntime::getTaskReductionItem(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), getTypeInfoVTable(), clang::CodeGen::CodeGenFunction::recoverAddrOfEscapedLocal(), Release(), and setThunkProperties().

◆ getModuleDebugInfo()

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

◆ getModuleNameHash()

const std::string& clang::CodeGen::CodeGenModule::getModuleNameHash ( ) const
inline

Definition at line 621 of file CodeGenModule.h.

Referenced by isUniqueInternalLinkageDecl().

◆ getMostBaseClasses()

std::vector< const CXXRecordDecl * > CodeGenModule::getMostBaseClasses ( const CXXRecordDecl RD)

Return a vector of most-base classes for RD.

This is used to implement control flow integrity checks for member function pointers.

A most-base class of a class C is defined as a recursive base class of C, including C itself, that does not have any bases.

Definition at line 1925 of file CodeGenModule.cpp.

References clang::CXXRecordDecl::bases(), and clang::CXXRecordDecl::getNumBases().

Referenced by SetLLVMFunctionAttributesForDefinition().

◆ getNaturalPointeeTypeAlignment()

CharUnits CodeGenModule::getNaturalPointeeTypeAlignment ( QualType  T,
LValueBaseInfo BaseInfo = nullptr,
TBAAAccessInfo TBAAInfo = nullptr 
)

◆ getNaturalTypeAlignment()

CharUnits CodeGenModule::getNaturalTypeAlignment ( QualType  T,
LValueBaseInfo BaseInfo = nullptr,
TBAAAccessInfo TBAAInfo = nullptr,
bool  forPointeeType = false 
)

◆ 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 716 of file CodeGenModule.h.

References getLLVMContext().

◆ getNSConcreteGlobalBlock()

llvm::Constant * CodeGenModule::getNSConcreteGlobalBlock ( )

◆ 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 1762 of file CGExprConstant.cpp.

References clang::CodeGen::TargetCodeGenInfo::getNullPointer(), and getTargetCodeGenInfo().

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

◆ getObjCEntrypoints()

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

Definition at line 647 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitARCAutorelease(), clang::CodeGen::CodeGenFunction::EmitARCAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::EmitARCCopyWeak(), clang::CodeGen::CodeGenFunction::EmitARCDestroyWeak(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCLoadWeak(), clang::CodeGen::CodeGenFunction::EmitARCLoadWeakRetained(), clang::CodeGen::CodeGenFunction::EmitARCMoveWeak(), clang::CodeGen::CodeGenFunction::EmitARCNoopIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCRelease(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseNonBlock(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::EmitARCRetainBlock(), clang::CodeGen::CodeGenFunction::EmitARCRetainNonBlock(), clang::CodeGen::CodeGenFunction::EmitARCStoreStrongCall(), clang::CodeGen::CodeGenFunction::EmitARCStoreWeak(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitObjCAlloc(), clang::CodeGen::CodeGenFunction::EmitObjCAllocInit(), clang::CodeGen::CodeGenFunction::EmitObjCAllocWithZone(), clang::CodeGen::CodeGenFunction::EmitObjCAutorelease(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPush(), clang::CodeGen::CodeGenFunction::EmitObjCRelease(), clang::CodeGen::CodeGenFunction::EmitObjCRetainNonBlock(), emitOptimizedARCReturnCall(), tryEmitFusedAutoreleaseOfResult(), and tryRemoveRetainOfSelf().

◆ getObjCFastEnumerationStateType()

QualType CodeGenModule::getObjCFastEnumerationStateType ( )

◆ getObjCRuntime()

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

◆ getOMPAllocateAlignment()

llvm::Optional< CharUnits > CodeGenModule::getOMPAllocateAlignment ( const VarDecl VD)

◆ getOpenCLRuntime()

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

◆ getOpenMPRuntime()

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

Return a reference to the configured OpenMP runtime.

Definition at line 630 of file CodeGenModule.h.

Referenced by createRuntimeShuffleFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), clang::CodeGen::CodeGenFunction::EmitComplexAssignmentLValue(), clang::CodeGen::CodeGenFunction::EmitComplexPrePostIncDec(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), emitDeclTargetVarDeclLValue(), clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(), EmitGlobal(), emitGlobalToListReduceFunction(), emitInitWithReductionInitializer(), emitInterWarpCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), emitOMPAtomicCaptureExpr(), emitOMPAtomicCompareExpr(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), emitOMPAtomicWriteExpr(), EmitOMPDeclareMapper(), EmitOMPDeclareReduction(), EmitOMPRequiresDecl(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), clang::CodeGen::CGOpenMPRuntime::emitParallelCall(), emitParallelOrTeamsOutlinedFunction(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), emitReductionCombiner(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitSimpleOMPExecutableDirective(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), EmitThreadPrivateVarDeclLValue(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getNVPTXLaneID(), getNVPTXWarpID(), clang::CodeGen::CGOpenMPRuntime::isNontemporalDecl(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::UntiedTaskLocalDeclsRAII(), clang::CodeGen::CodeGenFunction::~CodeGenFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::~NontemporalDeclsRAII(), and clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::~UntiedTaskLocalDeclsRAII().

◆ GetOrCreateRTTIProxyGlobalVariable()

llvm::GlobalVariable * CodeGenModule::GetOrCreateRTTIProxyGlobalVariable ( llvm::Constant *  Addr)

Definition at line 1940 of file CodeGenModule.cpp.

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

◆ getOrCreateStaticVarDecl()

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

◆ getPGOReader()

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

Definition at line 659 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters().

◆ getPGOStats()

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

Definition at line 658 of file CodeGenModule.h.

◆ getPreprocessorOpts()

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

Definition at line 729 of file CodeGenModule.h.

◆ getSanitizerMetadata()

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

◆ getSanStats()

llvm::SanitizerStatReport & CodeGenModule::getSanStats ( )

Definition at line 6920 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 665 of file CodeGenModule.h.

◆ getStaticLocalDeclGuardAddress()

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

Definition at line 677 of file CodeGenModule.h.

◆ getTarget()

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

Definition at line 737 of file CodeGenModule.h.

References clang::Target.

Referenced by AddDependentLib(), addLinkOptionsPostorder(), ApplyNonVirtualAndVirtualOffset(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), BuildAppleKextVirtualCall(), buildGlobalBlock(), clang::CodeGen::computeSPIRKernelABIInfo(), configureBlocksRuntimeObject(), clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CGCXXABI::EmitCtorCompleteObjectHandler(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::CodeGen::CodeGenFunction::EmitInheritedCXXConstructorCall(), emitIsPlatformVersionAtLeast(), clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitSEHExceptionCodeSave(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::EHPersonality::get(), getAddrAndTypeOfCXXStructor(), GetAddrOfFunction(), getCodegenToUse(), getCudaArch(), GetGlobalConstantAddressSpace(), getMangledName(), getTargetCodeGenInfo(), getTerminateFn(), getVTableLinkage(), hasInAllocaArgs(), initializeForBlockHeader(), isThreadWrapperReplaceable(), clang::CodeGen::CodeGenVTables::isVTableExternal(), Release(), ReturnTypeUsesFP2Ret(), ReturnTypeUsesFPRet(), SetLLVMFunctionAttributesForDefinition(), shouldEmitVTableThunk(), and ShouldUseExternalRTTIDescriptor().

◆ getTargetCodeGenInfo()

const TargetCodeGenInfo & CodeGenModule::getTargetCodeGenInfo ( )

◆ GetTargetTypeStoreSize()

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

◆ 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 1026 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 1020 of file CodeGenModule.cpp.

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

◆ getTBAAInfoForSubobject()

TBAAAccessInfo clang::CodeGen::CodeGenModule::getTBAAInfoForSubobject ( LValue  Base,
QualType  AccessType 
)
inline

◆ getTBAAStructInfo()

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

◆ getTBAATypeInfo()

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

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

Definition at line 982 of file CodeGenModule.cpp.

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

◆ getTBAAVTablePtrAccessInfo()

TBAAAccessInfo CodeGenModule::getTBAAVTablePtrAccessInfo ( llvm::Type *  VTablePtrType)

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

Definition at line 1008 of file CodeGenModule.cpp.

Referenced by clang::CodeGen::CodeGenFunction::GetVTablePtr(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointer().

◆ getTerminateFn()

llvm::FunctionCallee 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 749 of file CodeGenModule.h.

Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), addX86InterruptAttrs(), clang::CodeGen::arrangeCXXMethodType(), clang::CodeGen::arrangeFreeFunctionCall(), clang::CodeGen::arrangeFreeFunctionType(), clang::CodeGen::arrangeObjCMessageSendSignature(), clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), buildBlockDescriptor(), buildGlobalBlock(), canEmitDelegateCallArgs(), clang::CodeGen::CGOpenMPRuntimeGPU::clear(), codegenCXXStructor(), computeBlockInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::convertTypeForMemory(), createGlobalInitOrCleanupFn(), emitAddrOfFieldStorage(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementLValue(), clang::CodeGen::ConstantEmitter::emitForMemory(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), EmitFunctionDeclPointer(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGlobal(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::CGOpenMPRuntime::emitKmpRoutineEntryT(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNewDeleteCall(), EmitNullConstant(), EmitNullConstant(), EmitNullConstantForBase(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), EmitOMPAllocateDecl(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitPreserveStructAccess(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), clang::CodeGen::CGOpenMPRuntime::emitRequiresDirectiveRegFun(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall(), emitTaskDupFunction(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CodeGenFunction::EmitVAArg(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), getAddrAndTypeOfCXXStructor(), GetAddrOfConstantCFString(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfFunction(), GetAddrOfGlobal(), GetAddrOfGlobalTemporary(), GetAddrOfGlobalVar(), getBlockDescriptorType(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), GetConstantArrayFromStringLiteral(), getGuardAcquireFn(), clang::CodeGen::getLLVMFieldNumber(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), clang::CodeGen::CodeGenFunction::getTypes(), GetWeakRefReference(), setUsedBits(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().

◆ getUniqueBlockCount()

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

Fetches the global unique block count.

Definition at line 982 of file CodeGenModule.h.

◆ getVBaseAlignment()

CharUnits CodeGenModule::getVBaseAlignment ( CharUnits  DerivedAlign,
const CXXRecordDecl Derived,
const CXXRecordDecl VBase 
)

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 74 of file CGClass.cpp.

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

Referenced by ApplyNonVirtualAndVirtualOffset().

◆ GetVCallVisibilityLevel()

llvm::GlobalObject::VCallVisibility CodeGenModule::GetVCallVisibilityLevel ( const CXXRecordDecl RD,
llvm::DenseSet< const CXXRecordDecl * > &  Visited 
)

Returns the vcall visibility of the given type.

This is the scope in which a virtual function call could be made which ends up being dispatched to a member function of this class. This scope can be wider than the visibility of the class itself when the class has a more-visible dynamic base class. The client should pass in an empty Visited set, which is used to prevent redundant recursive processing.

Definition at line 1244 of file CGVTables.cpp.

References clang::CXXRecordDecl::bases(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), HasHiddenLTOVisibility(), clang::isExternallyVisible(), min(), and clang::CXXRecordDecl::vbases().

Referenced by EmitVTableTypeMetadata().

◆ getVTableLinkage()

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

◆ getVTables()

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

◆ GetWeakRefReference()

ConstantAddress CodeGenModule::GetWeakRefReference ( const ValueDecl VD)

◆ HandleCXXStaticMemberVarInstantiation()

void CodeGenModule::HandleCXXStaticMemberVarInstantiation ( VarDecl VD)

◆ HasHiddenLTOVisibility()

bool CodeGenModule::HasHiddenLTOVisibility ( const CXXRecordDecl RD)

◆ hasObjCRuntime()

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

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

Definition at line 619 of file CodeGenModule.h.

◆ imbueXRayAttrs()

bool CodeGenModule::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.

Returns true if we did imbue attributes this way, false otherwise.

Definition at line 2951 of file CodeGenModule.cpp.

References Category, getContext(), clang::ASTContext::getXRayFilter(), and clang::SourceLocation::isValid().

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

◆ isFunctionBlockedByProfileList()

ProfileList::ExclusionType CodeGenModule::isFunctionBlockedByProfileList ( llvm::Function *  Fn,
SourceLocation  Loc 
) const

◆ isFunctionBlockedFromProfileInstr()

ProfileList::ExclusionType CodeGenModule::isFunctionBlockedFromProfileInstr ( llvm::Function *  Fn,
SourceLocation  Loc 
) const
Returns
true if Fn at Loc should be excluded from profile instrumentation.

Definition at line 3002 of file CodeGenModule.cpp.

References clang::ProfileList::Allow, getCodeGenOpts(), isFunctionBlockedByProfileList(), clang::ProfileList::Skip, and V.

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

◆ isInNoSanitizeList() [1/2]

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

◆ isInNoSanitizeList() [2/2]

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

◆ isPaddedAtomicType() [1/2]

bool CodeGenModule::isPaddedAtomicType ( const AtomicType type)

◆ isPaddedAtomicType() [2/2]

bool CodeGenModule::isPaddedAtomicType ( QualType  type)

Definition at line 835 of file CodeGenTypes.cpp.

References clang::ast_matchers::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 4249 of file CodeGenModule.cpp.

References clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), clang::ASTContext::getLangOpts(), clang::QualType::isConstant(), and clang::Type::isReferenceType().

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

◆ lookupRepresentativeDecl()

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

Definition at line 6681 of file CodeGenModule.cpp.

◆ 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 4683 of file CodeGenModule.cpp.

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

◆ maybeSetTrivialComdat()

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

Definition at line 4740 of file CodeGenModule.cpp.

References shouldBeInCOMDAT().

◆ MayDropFunctionReturn()

bool CodeGenModule::MayDropFunctionReturn ( const ASTContext Context,
QualType  ReturnType 
)

Whether this function's return type has no side effects, and thus may be trivially discarded if it is unused.

Definition at line 1785 of file CGCall.cpp.

References clang::Type::getAs(), clang::QualType::getCanonicalType(), and clang::QualType::isTriviallyCopyableType().

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

◆ mergeTBAAInfoForCast()

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

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

Definition at line 1032 of file CodeGenModule.cpp.

Referenced by emitOMPArraySectionBase(), and clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment().

◆ mergeTBAAInfoForConditionalOperator()

TBAAAccessInfo CodeGenModule::mergeTBAAInfoForConditionalOperator ( TBAAAccessInfo  InfoA,
TBAAAccessInfo  InfoB 
)

mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the purposes of conditional operator.

Definition at line 1040 of file CodeGenModule.cpp.

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

◆ mergeTBAAInfoForMemoryTransfer()

TBAAAccessInfo CodeGenModule::mergeTBAAInfoForMemoryTransfer ( TBAAAccessInfo  DestInfo,
TBAAAccessInfo  SrcInfo 
)

mergeTBAAInfoForMemoryTransfer - Get merged TBAA information for the purposes of memory transfer calls.

Definition at line 1048 of file CodeGenModule.cpp.

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

◆ moveLazyEmissionStates()

void CodeGenModule::moveLazyEmissionStates ( CodeGenModule NewBuilder)

Move some lazily-emitted states to the NewBuilder.

This is especially essential for the incremental parsing environment like Clang Interpreter, because we'll lose all important information after each repl.

Definition at line 7073 of file CodeGenModule.cpp.

◆ NeedAllVtablesTypeId()

bool CodeGenModule::NeedAllVtablesTypeId ( ) const

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

Definition at line 6889 of file CodeGenModule.cpp.

References clang::SanitizerSet::has(), clang::LangOptions::Sanitize, and clang::CodeGenOptions::SanitizeTrap.

Referenced by AddVTableTypeMetadata().

◆ printPostfixForExternalizedDecl()

void CodeGenModule::printPostfixForExternalizedDecl ( llvm::raw_ostream &  OS,
const Decl D 
) const

Print the postfix for externalized static variable or kernels for single source offloading languages CUDA and HIP.

The unique postfix is created using either the CUID argument, or the file's UniqueID and active macros. The fallback method without a CUID requires that the offloading toolchain does not define separate macros via the -cc1 options.

Definition at line 7035 of file CodeGenModule.cpp.

References clang::LangOptions::CUID, getContext(), clang::ASTContext::getCUIDHash(), clang::PresumedLoc::getFilename(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getSourceManager(), clang::PresumedLoc::isValid(), clang::PreprocessorOptions::Macros, and SM.

◆ RefreshTypeCacheForClass()

void CodeGenModule::RefreshTypeCacheForClass ( const CXXRecordDecl Class)

◆ Release()

void CodeGenModule::Release ( )

Finalize LLVM code generation.

Definition at line 506 of file CodeGenModule.cpp.

References addCompilerUsedGlobal(), clang::XRayInstrKind::All, clang::CodeGenOptions::All, clang::TargetInfo::checkCFProtectionBranchSupported(), clang::TargetInfo::checkCFProtectionReturnSupported(), clang::TargetOptions::COV_None, clang::ASTContext::CUDAExternalDeviceDeclODRUsedByHost, clang::EmbedObject(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), EmitDeferredUnusedCoverageMappings(), EmitGlobalAnnotations(), EmitMainVoidAlias(), clang::CodeGen::TargetCodeGenInfo::emitTargetMetadata(), clang::ExternalLinkage, finalizeKCFITypes(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), clang::CodeGenOptions::FP32DenormalMode, clang::TargetInfo::getABI(), GetAddrOfGlobal(), getCodeGenOpts(), getContext(), getDiags(), getHLSLRuntime(), getLangOpts(), clang::ASTContext::getLangOpts(), getModule(), getModuleDebugInfo(), clang::ASTContext::getModuleForCodeGen(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::CharUnits::getQuantity(), getTarget(), getTargetCodeGenInfo(), clang::ASTContext::getTargetInfo(), getTriple(), clang::TargetInfo::getTriple(), clang::ASTContext::getTypeSizeInChars(), clang::ASTContext::getWideCharType(), clang::SanitizerSet::has(), clang::CodeGen::InstrProfStats::hasDiagnostics(), clang::TargetInfo::hasFeature(), clang::LangOptions::hasSignReturnAddress(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, INT_MAX, clang::InternalLinkage, clang::Module::isHeaderLikeModule(), clang::Module::isInterfaceOrPartition(), clang::LangOptions::isSignReturnAddressScopeAll(), clang::LangOptions::isSignReturnAddressWithAKey(), clang::Kernel, clang::CodeGen::CodeGenModule::Structor::LexOrder, clang::CodeGenOptions::MemoryProfileOutput, clang::CodeGenOptions::None, clang::LangOptions::None, clang::CodeGenOptions::NonLeaf, clang::CodeGen::InstrProfStats::reportDiagnostics(), clang::LangOptions::Sanitize, clang::CodeGen::CodeGenPGO::setValueProfilingFlag(), setVisibilityFromDLLStorageClass(), clang::CodeGen::CodeGenTypeCache::VoidTy, and clang::serialized_diags::Warning.

◆ 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 1576 of file CGCall.cpp.

References clang::CodeGen::TargetCodeGenInfo::doesReturnSlotInterfereWithArgs(), getTargetCodeGenInfo(), and ReturnTypeUsesSRet().

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

◆ ReturnTypeUsesFP2Ret()

bool CodeGenModule::ReturnTypeUsesFP2Ret ( QualType  ResultType)

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

Definition at line 1598 of file CGCall.cpp.

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

◆ ReturnTypeUsesFPRet()

bool CodeGenModule::ReturnTypeUsesFPRet ( QualType  ResultType)

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

Definition at line 1581 of file CGCall.cpp.

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

◆ ReturnTypeUsesSRet()

bool CodeGenModule::ReturnTypeUsesSRet ( const CGFunctionInfo FI)

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

Definition at line 1571 of file CGCall.cpp.

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

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

◆ 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 2205 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 1284 of file CGBlocks.cpp.

Referenced by buildGlobalBlock().

◆ 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 ( GlobalDecl  GD,
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 2129 of file CodeGenModule.cpp.

References addUsedOrCompilerUsedGlobal(), clang::DefaultVisibility, clang::GlobalDecl::getDecl(), clang::Decl::hasAttr(), clang::SD_Static, and setGVProperties().

Referenced by emitConstructorDestructorAlias().

◆ setDLLImportDLLExport() [1/2]

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

◆ setDLLImportDLLExport() [2/2]

void CodeGenModule::setDLLImportDLLExport ( llvm::GlobalValue *  GV,
GlobalDecl  D 
) const

◆ setDSOLocal()

void CodeGenModule::setDSOLocal ( llvm::GlobalValue *  GV) const

◆ setFunctionLinkage()

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

Definition at line 1292 of file CodeGenModule.h.

References getFunctionLinkage().

Referenced by codegenCXXStructor(), and setThunkProperties().

◆ setGlobalVisibility()

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

◆ setGVProperties() [1/2]

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

Definition at line 1261 of file CodeGenModule.cpp.

References setDLLImportDLLExport(), and setGVPropertiesAux().

◆ setGVProperties() [2/2]

void CodeGenModule::setGVProperties ( llvm::GlobalValue *  GV,
GlobalDecl  GD 
) const

Set visibility, dllimport/dllexport and dso_local.

This must be called after dllimport/dllexport is set.

Definition at line 1255 of file CodeGenModule.cpp.

References clang::GlobalDecl::getDecl(), setDLLImportDLLExport(), and setGVPropertiesAux().

Referenced by SetCommonAttributes(), and setThunkProperties().

◆ setGVPropertiesAux()

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

◆ SetInternalFunctionAttributes()

void CodeGenModule::SetInternalFunctionAttributes ( GlobalDecl  GD,
llvm::Function *  F,
const CGFunctionInfo FI 
)

◆ setKCFIType()

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

Set type metadata to the given function.

Definition at line 2308 of file CodeGenModule.cpp.

References CreateKCFITypeId(), and clang::ValueDecl::getType().

◆ SetLLVMFunctionAttributes()

void CodeGenModule::SetLLVMFunctionAttributes ( GlobalDecl  GD,
const CGFunctionInfo Info,
llvm::Function *  F,
bool  IsThunk 
)

◆ SetLLVMFunctionAttributesForDefinition()

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

◆ setLLVMFunctionFEnvAttributes()

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

Set the LLVM function attributes that represent floating point environment.

Definition at line 2120 of file CodeGenModule.cpp.

References clang::Decl::hasAttr().

◆ setStaticLocalDeclAddress()

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

Definition at line 668 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 680 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 1297 of file CodeGenModule.cpp.

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

◆ setTypeDescriptorInMap()

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

Definition at line 710 of file CodeGenModule.h.

◆ shouldMapVisibilityToDLLExport()

bool clang::CodeGen::CodeGenModule::shouldMapVisibilityToDLLExport ( const NamedDecl D) const
inline

◆ shouldUseTBAA()

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

Definition at line 745 of file CodeGenModule.h.

◆ stopAutoInit()

bool CodeGenModule::stopAutoInit ( )

◆ supportsCOMDAT()

bool CodeGenModule::supportsCOMDAT ( ) const

◆ TryEmitBaseDestructorAsAlias()

bool CodeGenModule::TryEmitBaseDestructorAsAlias ( const CXXDestructorDecl D)

Try to emit a base destructor as an alias to its primary base-class destructor.

Definition at line 34 of file CGCXX.cpp.

References clang::RecordDecl::field_empty(), getCodeGenOpts(), clang::RecordType::getDecl(), clang::CXXMethodDecl::getParent(), and clang::FunctionDecl::hasTrivialBody().

◆ UpdateCompletedType()

void CodeGenModule::UpdateCompletedType ( const TagDecl TD)

Member Data Documentation

◆ ByrefHelpersCache

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

Definition at line 979 of file CodeGenModule.h.

Referenced by buildByrefHelpers().

◆ GlobalUniqueCount

int clang::CodeGen::CodeGenModule::GlobalUniqueCount

Definition at line 565 of file CodeGenModule.h.

◆ IsOSVersionAtLeastFn

llvm::FunctionCallee clang::CodeGen::CodeGenModule::IsOSVersionAtLeastFn = nullptr

◆ IsPlatformVersionAtLeastFn

llvm::FunctionCallee clang::CodeGen::CodeGenModule::IsPlatformVersionAtLeastFn = nullptr

Definition at line 656 of file CodeGenModule.h.

Referenced by emitIsPlatformVersionAtLeast().


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