clang 22.0.0git
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:
[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.
AtomicOptions getAtomicOpts ()
 Get the current Atomic options.
void setAtomicOpts (AtomicOptions AO)
 Set the current Atomic options.
bool getExpressionLocationsEnabled () const
 Return true if we should emit location information for expressions.
CGObjCRuntimegetObjCRuntime ()
 Return a reference to the configured Objective-C runtime.
bool hasObjCRuntime ()
 Return true iff an Objective-C runtime has been configured.
const std::string & getModuleNameHash () const
CGOpenCLRuntimegetOpenCLRuntime ()
 Return a reference to the configured OpenCL runtime.
CGOpenMPRuntimegetOpenMPRuntime ()
 Return a reference to the configured OpenMP runtime.
CGCUDARuntimegetCUDARuntime ()
 Return a reference to the configured CUDA runtime.
CGHLSLRuntimegetHLSLRuntime ()
 Return a reference to the configured HLSL runtime.
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)
const ABIInfogetABIInfo ()
CGCXXABIgetCXXABI () const
llvm::LLVMContext & getLLVMContext ()
bool shouldUseTBAA () const
const TargetCodeGenInfogetTargetCodeGenInfo ()
CodeGenTypesgetTypes ()
CodeGenVTablesgetVTables ()
ItaniumVTableContextgetItaniumVTableContext ()
const ItaniumVTableContextgetItaniumVTableContext () const
MicrosoftVTableContextgetMicrosoftVTableContext ()
CtorListgetGlobalCtors ()
CtorListgetGlobalDtors ()
llvm::MDNode * getTBAATypeInfo (QualType QTy)
 getTBAATypeInfo - Get metadata used to describe accesses to objects of the given type.
TBAAAccessInfo getTBAAAccessInfo (QualType AccessType)
 getTBAAAccessInfo - Get TBAA information that describes an access to an object of the given type.
TBAAAccessInfo getTBAAVTablePtrAccessInfo (llvm::Type *VTablePtrType)
 getTBAAVTablePtrAccessInfo - Get the TBAA information that describes an access to a virtual table pointer.
llvm::MDNode * getTBAAStructInfo (QualType QTy)
llvm::MDNode * getTBAABaseTypeInfo (QualType QTy)
 getTBAABaseTypeInfo - Get metadata that describes the given base access type.
llvm::MDNode * getTBAAAccessTagInfo (TBAAAccessInfo Info)
 getTBAAAccessTagInfo - Get TBAA tag for a given memory access.
TBAAAccessInfo mergeTBAAInfoForCast (TBAAAccessInfo SourceInfo, TBAAAccessInfo TargetInfo)
 mergeTBAAInfoForCast - Get merged TBAA information for the purposes of type casts.
TBAAAccessInfo mergeTBAAInfoForConditionalOperator (TBAAAccessInfo InfoA, TBAAAccessInfo InfoB)
 mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the purposes of conditional operator.
TBAAAccessInfo mergeTBAAInfoForMemoryTransfer (TBAAAccessInfo DestInfo, TBAAAccessInfo SrcInfo)
 mergeTBAAInfoForMemoryTransfer - Get merged TBAA information for the purposes of memory transfer calls.
TBAAAccessInfo getTBAAInfoForSubobject (LValue Base, QualType AccessType)
 getTBAAInfoForSubobject - Get TBAA information for an access with a given base lvalue.
bool isPaddedAtomicType (QualType type)
bool isPaddedAtomicType (const AtomicType *type)
void DecorateInstructionWithTBAA (llvm::Instruction *Inst, TBAAAccessInfo TBAAInfo)
 DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag.
void DecorateInstructionWithInvariantGroup (llvm::Instruction *I, const CXXRecordDecl *RD)
 Adds !invariant.barrier !tag to instruction.
llvm::ConstantInt * getSize (CharUnits numChars)
 Emit the given number of characters as a value of type size_t.
void setGlobalVisibility (llvm::GlobalValue *GV, const NamedDecl *D) const
 Set the visibility for the given LLVM GlobalValue.
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.
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.
llvm::GlobalVariable::ThreadLocalMode GetDefaultLLVMTLSModel () const
 Get LLVM TLS mode from CodeGenOptions.
llvm::Constant * GetAddrOfGlobal (GlobalDecl GD, ForDefinition_t IsForDefinition=NotForDefinition)
llvm::GlobalVariable * CreateOrReplaceCXXRuntimeVariable (StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage, llvm::Align Alignment)
 Will return a global variable of the given type.
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.
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.
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.
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.
llvm::Constant * GetFunctionStart (const ValueDecl *Decl)
llvm::Constant * getRawFunctionPointer (GlobalDecl GD, llvm::Type *Ty=nullptr)
 Return a function pointer for a reference to the given function.
llvm::Constant * getFunctionPointer (GlobalDecl GD, llvm::Type *Ty=nullptr)
 Return the ABI-correct function pointer value for a reference to the given function.
llvm::Constant * getFunctionPointer (llvm::Constant *Pointer, QualType FunctionType)
 Return the ABI-correct function pointer value for a reference to the given function.
llvm::Constant * getMemberFunctionPointer (const FunctionDecl *FD, llvm::Type *Ty=nullptr)
llvm::Constant * getMemberFunctionPointer (llvm::Constant *Pointer, QualType FT)
CGPointerAuthInfo getFunctionPointerAuthInfo (QualType T)
 Return the abstract pointer authentication schema for a pointer to the given function type.
CGPointerAuthInfo getMemberFunctionPointerAuthInfo (QualType FT)
CGPointerAuthInfo getPointerAuthInfoForPointeeType (QualType type)
CGPointerAuthInfo getPointerAuthInfoForType (QualType type)
bool shouldSignPointer (const PointerAuthSchema &Schema)
 Does a given PointerAuthScheme require us to sign a value.
llvm::Constant * getConstantSignedPointer (llvm::Constant *Pointer, const PointerAuthSchema &Schema, llvm::Constant *StorageAddress, GlobalDecl SchemaDecl, QualType SchemaType)
 Sign a constant pointer using the given scheme, producing a constant with the same IR type.
llvm::Constant * getConstantSignedPointer (llvm::Constant *Pointer, unsigned Key, llvm::Constant *StorageAddress, llvm::ConstantInt *OtherDiscriminator)
llvm::ConstantInt * getPointerAuthOtherDiscriminator (const PointerAuthSchema &Schema, GlobalDecl SchemaDecl, QualType SchemaType)
 Given a pointer-authentication schema, return a concrete "other" discriminator for it.
uint16_t getPointerAuthDeclDiscriminator (GlobalDecl GD)
 Return the "other" decl-specific discriminator for the given decl.
std::optional< CGPointerAuthInfogetVTablePointerAuthInfo (CodeGenFunction *Context, const CXXRecordDecl *Record, llvm::Value *StorageAddress)
std::optional< PointerAuthQualifiergetVTablePointerAuthentication (const CXXRecordDecl *thisClass)
CGPointerAuthInfo EmitPointerAuthInfo (const RecordDecl *RD)
bool shouldEmitRTTI (bool ForEH=false)
llvm::Constant * GetAddrOfRTTIDescriptor (QualType Ty, bool ForEH=false)
 Get the address of the RTTI descriptor for the given type.
ConstantAddress GetAddrOfMSGuidDecl (const MSGuidDecl *GD)
 Get the address of a GUID.
ConstantAddress GetAddrOfUnnamedGlobalConstantDecl (const UnnamedGlobalConstantDecl *GCD)
 Get the address of a UnnamedGlobalConstant.
ConstantAddress GetAddrOfTemplateParamObject (const TemplateParamObjectDecl *TPO)
 Get the address of a template parameter object.
llvm::Constant * GetAddrOfThunk (StringRef Name, llvm::Type *FnTy, GlobalDecl GD)
 Get the address of the thunk for the given global decl.
ConstantAddress GetWeakRefReference (const ValueDecl *VD)
 Get a reference to the target of VD.
CharUnits getClassPointerAlignment (const CXXRecordDecl *CD)
 Returns the assumed alignment of an opaque pointer to the given class.
CharUnits getMinimumClassObjectSize (const CXXRecordDecl *CD)
 Returns the minimum object size for an object of the given class type (or a class derived from it).
CharUnits getMinimumObjectSize (QualType Ty)
 Returns the minimum object size for an object of the given type.
CharUnits getVBaseAlignment (CharUnits DerivedAlign, const CXXRecordDecl *Derived, const CXXRecordDecl *VBase)
 Returns the assumed alignment of a virtual base of a class.
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.
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.
int getUniqueBlockCount ()
 Fetches the global unique block count.
llvm::Type * getBlockDescriptorType ()
 Fetches the type of a generic block descriptor.
llvm::Type * getGenericBlockLiteralType ()
 The type of a generic block literal.
llvm::Constant * GetAddrOfGlobalBlock (const BlockExpr *BE, StringRef Name)
 Gets the address of a block which requires no captures.
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.
void setAddrOfGlobalBlock (const BlockExpr *BE, llvm::Constant *Addr)
 Notes that BE's global block is available via Addr.
ConstantAddress GetAddrOfConstantCFString (const StringLiteral *Literal)
 Return a pointer to a constant CFString object for the given string.
llvm::Constant * GetConstantArrayFromStringLiteral (const StringLiteral *E)
 Return a constant array for the given string.
ConstantAddress GetAddrOfConstantStringFromLiteral (const StringLiteral *S, StringRef Name=".str")
 Return a pointer to a constant array for the given string literal.
ConstantAddress GetAddrOfConstantStringFromObjCEncode (const ObjCEncodeExpr *)
 Return a pointer to a constant array for the given ObjCEncodeExpr node.
ConstantAddress GetAddrOfConstantCString (const std::string &Str, StringRef GlobalName=".str")
 Returns a pointer to a character array containing the literal and a terminating '\0' character.
ConstantAddress GetAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *E)
 Returns a pointer to a constant global variable for the given file-scope compound literal expression.
llvm::GlobalVariable * getAddrOfConstantCompoundLiteralIfEmitted (const CompoundLiteralExpr *E)
 If it's been emitted already, returns the GlobalVariable corresponding to a compound literal.
void setAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *CLE, llvm::GlobalVariable *GV)
 Notes that CLE's GlobalVariable is GV.
ConstantAddress GetAddrOfGlobalTemporary (const MaterializeTemporaryExpr *E, const Expr *Inner)
 Returns a pointer to a global variable representing a temporary with static or thread storage duration.
QualType getObjCFastEnumerationStateType ()
 Retrieve the record type that describes the state of an Objective-C fast enumeration loop (for..in).
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.
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".
llvm::Function * getIntrinsic (unsigned IID, ArrayRef< llvm::Type * > Tys={})
void AddCXXGlobalInit (llvm::Function *F)
void EmitTopLevelDecl (Decl *D)
 Emit code for a single top level declaration.
void AddDeferredUnusedCoverageMapping (Decl *D)
 Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration.
void ClearUnusedCoverageMapping (const Decl *D)
 Remove the deferred empty coverage mapping as this declaration is actually instrumented.
void EmitDeferredUnusedCoverageMappings ()
 Emit all the deferred coverage mappings for the uninstrumented functions.
void EmitMainVoidAlias ()
 Emit an alias for "main" if it has no arguments (needed for wasm).
void HandleCXXStaticMemberVarInstantiation (VarDecl *VD)
 Tell the consumer that this variable has been instantiated.
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.
void addUsedGlobal (llvm::GlobalValue *GV)
 Add a global to a list to be added to the llvm.used metadata.
void addCompilerUsedGlobal (llvm::GlobalValue *GV)
 Add a global to a list to be added to the llvm.compiler.used metadata.
void addUsedOrCompilerUsedGlobal (llvm::GlobalValue *GV)
 Add a global to a list to be added to the llvm.compiler.used metadata.
void AddCXXDtorEntry (llvm::FunctionCallee DtorFn, llvm::Constant *Object)
 Add a destructor and object to add to the C++ global destructor function.
void AddCXXStermFinalizerEntry (llvm::FunctionCallee DtorFn)
 Add an sterm finalizer to the C++ global cleanup function.
void AddCXXStermFinalizerToGlobalDtor (llvm::Function *StermFinalizer, int Priority)
 Add an sterm finalizer to its own llvm.global_dtors entry.
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.
llvm::FunctionCallee CreateRuntimeFunction (QualType ReturnTy, ArrayRef< QualType > ArgTys, 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.
llvm::Constant * CreateRuntimeVariable (llvm::Type *Ty, StringRef Name)
 Create a new runtime global variable with the specified type and name.
llvm::Function * getLLVMLifetimeStartFn ()
 Lazily declare the @llvm.lifetime.start intrinsic.
llvm::Function * getLLVMLifetimeEndFn ()
 Lazily declare the @llvm.lifetime.end intrinsic.
llvm::Function * getLLVMFakeUseFn ()
 Lazily declare the @llvm.fake.use intrinsic.
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.
llvm::Constant * EmitNullConstant (QualType T)
 Return the result of value-initializing the given type, i.e.
llvm::Constant * EmitNullConstantForBase (const CXXRecordDecl *Record)
 Return a null constant appropriate for zero-initializing a base class with the given type.
void Error (SourceLocation loc, StringRef error)
 Emit a general error that something can't be done.
void ErrorUnsupported (const Stmt *S, const char *Type)
 Print out an error that codegen doesn't support the specified stmt yet.
void ErrorUnsupported (const Decl *D, const char *Type)
 Print out an error that codegen doesn't support the specified decl yet.
void runWithSufficientStackSpace (SourceLocation Loc, llvm::function_ref< void()> Fn)
 Run some code with "sufficient" stack space.
void SetInternalFunctionAttributes (GlobalDecl GD, llvm::Function *F, const CGFunctionInfo &FI)
 Set the attributes on the LLVM function for the given decl and function info.
void SetLLVMFunctionAttributes (GlobalDecl GD, const CGFunctionInfo &Info, llvm::Function *F, bool IsThunk)
 Set the LLVM function attributes (sext, zext, etc).
void SetLLVMFunctionAttributesForDefinition (const Decl *D, llvm::Function *F)
 Set the LLVM function attributes which only apply to a function definition.
void setLLVMFunctionFEnvAttributes (const FunctionDecl *D, llvm::Function *F)
 Set the LLVM function attributes that represent floating point environment.
bool ReturnTypeUsesSRet (const CGFunctionInfo &FI)
 Return true iff the given type uses 'sret' when used as a return type.
bool ReturnTypeHasInReg (const CGFunctionInfo &FI)
 Return true iff the given type has inreg set.
bool ReturnSlotInterferesWithArgs (const CGFunctionInfo &FI)
 Return true iff the given type uses an argument slot when 'sret' is used as a return type.
bool ReturnTypeUsesFPRet (QualType ResultType)
 Return true iff the given type uses 'fpret' when used as a return type.
bool ReturnTypeUsesFP2Ret (QualType ResultType)
 Return true iff the given type uses 'fp2ret' when used as a return type.
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.
void AdjustMemoryAttribute (StringRef Name, CGCalleeInfo CalleeInfo, llvm::AttributeList &Attrs)
 Adjust Memory attribute to ensure that the BE gets the right attribute.
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.
StringRef getMangledName (GlobalDecl GD)
StringRef getBlockMangledName (GlobalDecl GD, const BlockDecl *BD)
const GlobalDecl getMangledNameDecl (StringRef)
void EmitTentativeDefinition (const VarDecl *D)
void EmitExternalDeclaration (const DeclaratorDecl *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.
void RefreshTypeCacheForClass (const CXXRecordDecl *Class)
void AppendLinkerOptions (StringRef Opts)
 Appends Opts to the "llvm.linker.options" metadata value.
void AddDetectMismatch (StringRef Name, StringRef Value)
 Appends a detect mismatch command to the linker options.
void AddDependentLib (StringRef Lib)
 Appends a dependent lib to the appropriate metadata value.
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.
CharUnits GetTargetTypeStoreSize (llvm::Type *Ty) const
 Return the store size, in character units, of the given LLVM type.
llvm::GlobalValue::LinkageTypes getLLVMLinkageForDeclarator (const DeclaratorDecl *D, GVALinkage Linkage)
 Returns LLVM linkage for a declarator.
llvm::GlobalValue::LinkageTypes getLLVMLinkageVarDefinition (const VarDecl *VD)
 Returns LLVM linkage for a declarator.
void EmitGlobalAnnotations ()
 Emit all the global annotations.
llvm::Constant * EmitAnnotationString (StringRef Str)
 Emit an annotation string.
llvm::Constant * EmitAnnotationUnit (SourceLocation Loc)
 Emit the annotation's translation unit.
llvm::Constant * EmitAnnotationLineNo (SourceLocation L)
 Emit the annotation line number.
llvm::Constant * EmitAnnotationArgs (const AnnotateAttr *Attr)
 Emit additional args of the annotation.
llvm::Constant * EmitAnnotateAttr (llvm::GlobalValue *GV, const AnnotateAttr *AA, SourceLocation L)
 Generate the llvm::ConstantStruct which contains the annotation information for a given GlobalValue.
void AddGlobalAnnotations (const ValueDecl *D, llvm::GlobalValue *GV)
 Add global annotations that are set on D, for the global GV.
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.
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.
bool TryEmitBaseDestructorAsAlias (const CXXDestructorDecl *D)
 Try to emit a base destructor as an alias to its primary base-class destructor.
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).
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.
void EmitOMPDeclareReduction (const OMPDeclareReductionDecl *D, CodeGenFunction *CGF=nullptr)
 Emit a code for declare reduction construct.
void EmitOMPDeclareMapper (const OMPDeclareMapperDecl *D, CodeGenFunction *CGF=nullptr)
 Emit a code for declare mapper construct.
void EmitOpenACCDeclare (const OpenACCDeclareDecl *D, CodeGenFunction *CGF=nullptr)
void EmitOpenACCRoutine (const OpenACCRoutineDecl *D, CodeGenFunction *CGF=nullptr)
void EmitOMPRequiresDecl (const OMPRequiresDecl *D)
 Emit a code for requires directive.
void EmitOMPAllocateDecl (const OMPAllocateDecl *D)
 Emit a code for the allocate directive.
std::optional< CharUnitsgetOMPAllocateAlignment (const VarDecl *VD)
 Return the alignment specified in an allocate directive, if present.
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.
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.
llvm::GlobalObject::VCallVisibility GetVCallVisibilityLevel (const CXXRecordDecl *RD, llvm::DenseSet< const CXXRecordDecl * > &Visited)
 Returns the vcall visibility of the given type.
void EmitVTableTypeMetadata (const CXXRecordDecl *RD, llvm::GlobalVariable *VTable, const VTableLayout &VTLayout)
 Emit type metadata for the given vtable using the given layout.
llvm::Type * getVTableComponentType () const
llvm::ConstantInt * CreateCrossDsoCfiTypeId (llvm::Metadata *MD)
 Generate a cross-DSO type identifier for MD.
llvm::ConstantInt * CreateKCFITypeId (QualType T, StringRef Salt)
 Generate a KCFI type identifier for T.
llvm::Metadata * CreateMetadataIdentifierForType (QualType T)
 Create a metadata identifier for the given type.
llvm::Metadata * CreateMetadataIdentifierForVirtualMemPtrType (QualType T)
 Create a metadata identifier that is intended to be used to check virtual calls via a member function pointer.
llvm::Metadata * CreateMetadataIdentifierGeneralized (QualType T)
 Create a metadata identifier for the generalization of the given type.
void createFunctionTypeMetadataForIcall (const FunctionDecl *FD, llvm::Function *F)
 Create and attach type metadata to the given function.
void setKCFIType (const FunctionDecl *FD, llvm::Function *F)
 Set type metadata to the given function.
void finalizeKCFITypes ()
 Emit KCFI type identifier constants and remove unused identifiers.
bool MayDropFunctionReturn (const ASTContext &Context, QualType ReturnType) const
 Whether this function's return type has no side effects, and thus may be trivially discarded if it is unused.
bool NeedAllVtablesTypeId () const
 Returns whether this module needs the "all-vtables" type identifier.
void AddVTableTypeMetadata (llvm::GlobalVariable *VTable, CharUnits Offset, const CXXRecordDecl *RD)
 Create and attach type metadata for the given vtable.
SmallVector< const CXXRecordDecl *, 0 > getMostBaseClasses (const CXXRecordDecl *RD)
 Return a vector of most-base classes for RD.
llvm::FunctionCallee getTerminateFn ()
 Get the declaration of std::terminate for the platform.
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.
llvm::Constant * getNullPointer (llvm::PointerType *T, QualType QT)
 Get target specific null pointer.
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.
void moveLazyEmissionStates (CodeGenModule *NewBuilder)
 Move some lazily-emitted states to the NewBuilder.
void handleCUDALaunchBoundsAttr (llvm::Function *F, const CUDALaunchBoundsAttr *A, int32_t *MaxThreadsVal=nullptr, int32_t *MinBlocksVal=nullptr, int32_t *MaxClusterRankVal=nullptr)
 Emit the IR encoding to attach the CUDA launch bounds attribute to F.
void handleAMDGPUFlatWorkGroupSizeAttr (llvm::Function *F, const AMDGPUFlatWorkGroupSizeAttr *A, const ReqdWorkGroupSizeAttr *ReqdWGS=nullptr, int32_t *MinThreadsVal=nullptr, int32_t *MaxThreadsVal=nullptr)
 Emit the IR encoding to attach the AMD GPU flat-work-group-size attribute to F.
void handleAMDGPUWavesPerEUAttr (llvm::Function *F, const AMDGPUWavesPerEUAttr *A)
 Emit the IR encoding to attach the AMD GPU waves-per-eu attribute to F.
llvm::Constant * GetOrCreateLLVMGlobal (StringRef MangledName, llvm::Type *Ty, LangAS AddrSpace, const VarDecl *D, ForDefinition_t IsForDefinition=NotForDefinition)
 GetOrCreateLLVMGlobal - If the specified mangled name is not in the module, create and return an llvm GlobalVariable with the specified type and address space.
void AddGlobalCtor (llvm::Function *Ctor, int Priority=65535, unsigned LexOrder=~0U, llvm::Constant *AssociatedData=nullptr)
 AddGlobalCtor - Add a function to the list that will be called before main() runs.
void AddGlobalDtor (llvm::Function *Dtor, int Priority=65535, bool IsDtorAttrFunc=false)
 AddGlobalDtor - Add a function to the list that will be called when the module is unloaded.
bool shouldEmitConvergenceTokens () const
void addUndefinedGlobalForTailCall (std::pair< const FunctionDecl *, SourceLocation > Global)
bool shouldZeroInitPadding () const
unsigned getVtableGlobalVarAlignment (const VarDecl *D=nullptr)
TrapReasonBuilder BuildTrapReason (unsigned DiagID, TrapReason &TR)
 Helper function to construct a TrapReasonBuilder.
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
Public Attributes inherited from clang::CodeGen::CodeGenTypeCache
llvm::Type * VoidTy
 void
llvm::IntegerType * Int8Ty
 i8, i16, i32, and i64
llvm::IntegerType * Int16Ty
llvm::IntegerType * Int32Ty
llvm::IntegerType * Int64Ty
llvm::Type * HalfTy
 half, bfloat, float, double
llvm::Type * BFloatTy
llvm::Type * FloatTy
llvm::Type * DoubleTy
llvm::IntegerType * IntTy
 int
llvm::IntegerType * CharTy
 char
union { 
   llvm::IntegerType *   IntPtrTy 
   llvm::IntegerType *   SizeTy 
   llvm::IntegerType *   PtrDiffTy 
}; 
 intptr_t, size_t, and ptrdiff_t, which we assume are the same size.
union { 
   llvm::PointerType *   UnqualPtrTy 
   llvm::PointerType *   VoidPtrTy 
   llvm::PointerType *   Int8PtrTy 
   llvm::PointerType *   VoidPtrPtrTy 
   llvm::PointerType *   Int8PtrPtrTy 
}; 
 void*, void** in the target's default address space (often 0)
union { 
   llvm::PointerType *   AllocaVoidPtrTy 
   llvm::PointerType *   AllocaInt8PtrTy 
}; 
 void* in alloca address space
union { 
   llvm::PointerType *   GlobalsVoidPtrTy 
   llvm::PointerType *   GlobalsInt8PtrTy 
}; 
 void* in default globals address space
llvm::PointerType * ConstGlobalsPtrTy
 void* in the address space for constant globals
union { 
   unsigned char   IntSizeInBytes 
   unsigned char   IntAlignInBytes 
}; 
 The size and alignment of the builtin C type 'int'.
unsigned char PointerWidthInBits
 The width of a pointer into the generic address space.
union { 
   unsigned char   PointerAlignInBytes 
   unsigned char   PointerSizeInBytes 
}; 
 The size and alignment of a pointer into the generic address space.
union { 
   unsigned char   SizeSizeInBytes 
   unsigned char   SizeAlignInBytes 
}; 
 The size and alignment of size_t.
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 326 of file CodeGenModule.h.

Member Typedef Documentation

◆ CtorList

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

References clang::CodeGen::CodeGenTypeCache::AllocaInt8PtrTy, clang::CodeGen::CodeGenTypeCache::ASTAllocaAddressSpace, clang::CodeGen::CodeGenTypeCache::BFloatTy, clang::C, clang::CodeGen::CodeGenTypeCache::CharTy, checkDataLayoutConsistency(), clang::CodeGen::CodeGenTypeCache::ConstGlobalsPtrTy, createCXXABI(), clang::Default, clang::CodeGen::CodeGenTypeCache::DoubleTy, clang::DiagnosticsEngine::Error, clang::CodeGen::CodeGenTypeCache::FloatTy, clang::CodeGen::TargetCodeGenInfo::getABIInfo(), clang::CodeGen::TargetCodeGenInfo::getASTAllocaAddressSpace(), getAtomicOpts(), getContext(), getCXXABI(), GetGlobalConstantAddressSpace(), clang::MangleContext::getKind(), getLangOpts(), clang::CodeGen::CGCXXABI::getMangleContext(), getModule(), getTargetCodeGenInfo(), getTriple(), getTypes(), clang::CodeGen::CodeGenTypeCache::GlobalsInt8PtrTy, clang::CodeGen::CodeGenTypeCache::HalfTy, clang::CodeGen::CodeGenTypeCache::Int16Ty, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntAlignInBytes, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::CodeGen::CodeGenTypeCache::IntTy, clang::MangleContext::MK_Itanium, clang::CodeGenOptions::MSSecureHotPatchFunctionsFile, clang::CodeGenOptions::MSSecureHotPatchFunctionsList, clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, clang::CodeGen::CodeGenTypeCache::PointerWidthInBits, clang::CodeGen::CodeGenTypeCache::RuntimeCC, clang::CodeGen::CodeGenTypeCache::SizeSizeInBytes, and clang::CodeGen::CodeGenTypeCache::VoidTy.

◆ ~CodeGenModule()

CodeGenModule::~CodeGenModule ( )

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

Referenced by Release().

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

◆ AddCXXGlobalInit()

void clang::CodeGen::CodeGenModule::AddCXXGlobalInit ( llvm::Function * F)
inline

Definition at line 1244 of file CodeGenModule.h.

Referenced by initializeBuffer().

◆ AddCXXPrioritizedStermFinalizerEntry()

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

Definition at line 1300 of file CodeGenModule.h.

◆ AddCXXStermFinalizerEntry()

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

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

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

References AddGlobalDtor().

◆ addDefaultFunctionDefinitionAttributes()

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

Referenced by clang::CodeGen::addDefaultFunctionDefinitionAttributes(), and clang::CodeGen::TargetCodeGenInfo::createEnqueuedBlockKernel().

◆ AddDeferredUnusedCoverageMapping()

void CodeGenModule::AddDeferredUnusedCoverageMapping ( Decl * D)

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

Definition at line 7570 of file CodeGenModule.cpp.

References clang::cast(), clang::CodeGen::Decl, clang::Decl::getBeginLoc(), getContext(), clang::Decl::getKind(), clang::ASTContext::getSourceManager(), LimitedCoverage(), SM, and llvm::coverage::SystemHeadersCoverage.

Referenced by EmitTopLevelDecl().

◆ addDeferredVTable()

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

Definition at line 1541 of file CodeGenModule.h.

◆ AddDependentLib()

void CodeGenModule::AddDependentLib ( StringRef Lib)

Appends a dependent lib to the appropriate metadata value.

Definition at line 3283 of file CodeGenModule.cpp.

References clang::C, 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 3274 of file CodeGenModule.cpp.

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

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

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

Referenced by EmitGlobalAnnotations().

◆ AddGlobalCtor()

void CodeGenModule::AddGlobalCtor ( llvm::Function * Ctor,
int Priority = 65535,
unsigned LexOrder = ~0U,
llvm::Constant * AssociatedData = nullptr )

AddGlobalCtor - Add a function to the list that will be called before main() runs.

Definition at line 2249 of file CodeGenModule.cpp.

Referenced by Release().

◆ AddGlobalDtor()

void CodeGenModule::AddGlobalDtor ( llvm::Function * Dtor,
int Priority = 65535,
bool IsDtorAttrFunc = false )

AddGlobalDtor - Add a function to the list that will be called when the module is unloaded.

Definition at line 2258 of file CodeGenModule.cpp.

References getContext(), and getTriple().

Referenced by AddCXXStermFinalizerToGlobalDtor().

◆ addGlobalValReplacement()

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

Definition at line 654 of file CodeGenModule.cpp.

References clang::C.

◆ addReplacement()

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

Definition at line 619 of file CodeGenModule.cpp.

References clang::C.

Referenced by TryEmitBaseDestructorAsAlias().

◆ addUndefinedGlobalForTailCall()

void clang::CodeGen::CodeGenModule::addUndefinedGlobalForTailCall ( std::pair< const FunctionDecl *, SourceLocation > Global)
inline

Definition at line 1762 of file CodeGenModule.h.

References clang::Global.

◆ addUsedGlobal()

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

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

Definition at line 3217 of file CodeGenModule.cpp.

References clang::isa().

Referenced by buildGlobalBlock().

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

References getTriple(), and clang::isa().

Referenced by SetCommonAttributes().

◆ AddVTableTypeMetadata()

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

◆ AdjustMemoryAttribute()

void CodeGenModule::AdjustMemoryAttribute ( StringRef Name,
CGCalleeInfo CalleeInfo,
llvm::AttributeList & Attrs )

Adjust Memory attribute to ensure that the BE gets the right attribute.

Definition at line 2381 of file CGCall.cpp.

References getLLVMContext().

◆ 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 1288 of file CGVTables.cpp.

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

Referenced by HasHiddenLTOVisibility().

◆ AppendLinkerOptions()

void CodeGenModule::AppendLinkerOptions ( StringRef Opts)

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

Definition at line 3269 of file CodeGenModule.cpp.

References getLLVMContext().

Referenced by EmitTopLevelDecl().

◆ BuildTrapReason()

TrapReasonBuilder clang::CodeGen::CodeGenModule::BuildTrapReason ( unsigned DiagID,
TrapReason & TR )
inline

Helper function to construct a TrapReasonBuilder.

Definition at line 1828 of file CodeGenModule.h.

References getDiags().

◆ clear()

void CodeGenModule::clear ( )

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

References ClearUnusedCoverageMapping(), and clang::CodeGen::Decl.

Referenced by ClearUnusedCoverageMapping().

◆ codegenCXXStructor()

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

References AddAttributesFromFunctionProtoType(), AddAttributesFromOMPAssumes(), addNoBuiltinAttributes(), clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_end(), clang::CodeGen::CGFunctionInfo::arg_size(), canApplyNoFPClass(), clang::CanPassInRegs, clang::CanQual< T >::castAs(), clang::Type::castAsRecordDecl(), clang::CC_C, clang::CC_SpirFunction, clang::CodeGen::ABIArgInfo::CoerceAndExpand, clang::CodeGen::Decl, DetermineNoUndef(), clang::CodeGen::ABIArgInfo::Direct, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::FunctionType::ExtParameterInfo::getABI(), clang::CodeGen::CGFunctionInfo::getArgStruct(), clang::Type::getAs(), clang::Type::getAsRecordDecl(), clang::Decl::getAttr(), clang::CodeGen::CGCalleeInfo::getCalleeDecl(), clang::CodeGen::CGCalleeInfo::getCalleeFunctionProtoType(), getCodeGenOpts(), getContext(), getDataLayout(), clang::GlobalDecl::getDecl(), clang::CodeGen::ABIArgInfo::getDirectAlign(), clang::CodeGen::CGFunctionInfo::getEffectiveCallingConvention(), clang::CodeGen::CGFunctionInfo::getExtParameterInfo(), clang::CodeGen::ABIArgInfo::getIndirectAlign(), clang::CodeGen::ABIArgInfo::getIndirectByVal(), clang::CodeGen::ABIArgInfo::getInReg(), clang::CodeGen::ABIArgInfo::getKind(), getLangOpts(), getLLVMContext(), getMinimumObjectSize(), getNaturalPointeeTypeAlignment(), getNaturalTypeAlignment(), getNoFPClassTestMask(), clang::CodeGen::ABIArgInfo::getPaddingInReg(), clang::PointerType::getPointeeType(), clang::Type::getPointeeType(), clang::CharUnits::getQuantity(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CanQual< T >::getTypePtr(), getTypes(), clang::Decl::hasAttr(), HasStrictReturn(), clang::HLSLInOut, clang::HLSLOut, clang::CodeGen::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::ABIArgInfo::IndirectAliased, clang::isa(), clang::CodeGen::CGFunctionInfo::isChainCall(), clang::CodeGen::CGFunctionInfo::isCmseNSCall(), clang::Type::isConstantSizeType(), clang::QualType::isDestructedType(), clang::Type::isIncompleteType(), clang::CodeGen::CGFunctionInfo::isInstanceMethod(), clang::FunctionType::ExtParameterInfo::isNoEscape(), clang::CodeGen::CGFunctionInfo::isNoReturn(), clang::Type::isObjectType(), clang::RecordDecl::isParamDestroyedInCallee(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::CodeGen::ABIArgInfo::isSignExt(), clang::CXXMethodDecl::isVirtual(), clang::Type::isVoidType(), clang::CharUnits::isZero(), clang::CodeGen::ABIArgInfo::isZeroExt(), clang::Ordinary, clang::SwiftAsyncContext, clang::SwiftContext, clang::SwiftErrorResult, clang::SwiftIndirectResult, clang::CodeGen::ABIArgInfo::TargetSpecific, and clang::CodeGen::CGFunctionInfoArgInfo::type.

Referenced by SetLLVMFunctionAttributes().

◆ CreateCrossDsoCfiTypeId()

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

Generate a cross-DSO type identifier for MD.

Definition at line 2336 of file CodeGenModule.cpp.

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

Referenced by AddVTableTypeMetadata(), and createFunctionTypeMetadataForIcall().

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

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

References clang::T.

Referenced by AddVTableTypeMetadata(), createFunctionTypeMetadataForIcall(), 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 7943 of file CodeGenModule.cpp.

References clang::T.

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

References GeneralizeFunctionType(), getContext(), and clang::T.

Referenced by createFunctionTypeMetadataForIcall().

◆ createOpenCLIntToSamplerConversion()

◆ CreateOrReplaceCXXRuntimeVariable()

llvm::GlobalVariable * CodeGenModule::CreateOrReplaceCXXRuntimeVariable ( StringRef Name,
llvm::Type * Ty,
llvm::GlobalValue::LinkageTypes Linkage,
llvm::Align 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 5457 of file CodeGenModule.cpp.

References getModule(), and supportsCOMDAT().

◆ CreateRuntimeFunction() [1/2]

llvm::FunctionCallee CodeGenModule::CreateRuntimeFunction ( llvm::FunctionType * Ty,
StringRef Name,
llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
bool Local = false,
bool AssumeConvergent = false )

◆ CreateRuntimeFunction() [2/2]

llvm::FunctionCallee CodeGenModule::CreateRuntimeFunction ( QualType ReturnTy,
ArrayRef< QualType > ArgTys,
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.

If AssumeConvergent is true, the call will have the convergent attribute added.

Definition at line 5161 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTypes::arrangeFreeFunctionType(), clang::C, clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CodeGenTypeCache::getRuntimeCC(), getTypes(), setDSOLocal(), SetLLVMFunctionAttributes(), and setWindowsItaniumDLLImport().

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

References clang::cast(), clang::Default, getContext(), clang::ASTContext::getLangOpts(), GetOrCreateLLVMGlobal(), clang::opencl_global, and setDSOLocal().

Referenced by emitGlobalDtorWithCXAAtExit(), GetAddrOfConstantCFString(), getTlsGuardVar(), and loadRISCVFeatureBits().

◆ createUnnamedGlobalFrom()

◆ DecorateInstructionWithInvariantGroup()

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

Adds !invariant.barrier !tag to instruction.

Definition at line 1705 of file CodeGenModule.cpp.

References getLLVMContext().

◆ DecorateInstructionWithTBAA()

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

DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag.

Definition at line 1699 of file CodeGenModule.cpp.

References getTBAAAccessTagInfo().

Referenced by emitLibraryCall().

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

References EmitAnnotationArgs(), EmitAnnotationLineNo(), EmitAnnotationString(), EmitAnnotationUnit(), and getDataLayout().

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

References AnnotationSection, clang::CodeGen::CodeGenTypeCache::ConstGlobalsPtrTy, getLLVMContext(), getModule(), and s.

Referenced by EmitAnnotateAttr(), 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 7608 of file CodeGenModule.cpp.

References clang::cast(), clang::Ctor_Base, clang::CodeGen::Decl, 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 )

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

Also emit proper debug info for cast types.

Definition at line 1311 of file CGExpr.cpp.

References clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), getModuleDebugInfo(), clang::Expr::getType(), and clang::Type::isVariablyModifiedType().

Referenced by EmitPointerWithAlignment().

◆ EmitExternalDeclaration()

◆ EmitGlobal()

◆ EmitGlobalAnnotations()

void CodeGenModule::EmitGlobalAnnotations ( )

Emit all the global annotations.

Definition at line 3564 of file CodeGenModule.cpp.

References AddGlobalAnnotations(), AnnotationSection, GetGlobalValue(), getModule(), and getType().

Referenced by Release().

◆ EmitMainVoidAlias()

void CodeGenModule::EmitMainVoidAlias ( )

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

Definition at line 7648 of file CodeGenModule.cpp.

References getModule().

Referenced by Release().

◆ EmitNullConstant()

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

Return the result of value-initializing the given type, i.e.

a null expression of the given type. This is usually, but not always, an LLVM null constant.

Definition at line 2724 of file CGExprConstant.cpp.

References clang::cast(), clang::CodeGen::ConstantEmitter::emitNullForMemory(), getCXXABI(), clang::ArrayType::getElementType(), getNullPointer(), getTypes(), clang::ConstantArrayType::getZExtSize(), and clang::T.

Referenced by emitInitWithReductionInitializer(), EmitNullConstant(), and getOrCreateStaticVarDecl().

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

Referenced by EmitNullBaseClassInitialization().

◆ EmitOMPAllocateDecl()

void CodeGenModule::EmitOMPAllocateDecl ( const OMPAllocateDecl * D)

Emit a code for the allocate directive.

Parameters
DThe allocate declaration

Definition at line 2894 of file CGDecl.cpp.

References clang::cast(), getContext(), GetGlobalValue(), GetGlobalVarAddressSpace(), getLLVMContext(), getMangledName(), getModule(), clang::ASTContext::getTargetAddressSpace(), and clang::OMPAllocateDecl::varlist().

Referenced by EmitTopLevelDecl().

◆ EmitOMPDeclareMapper()

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

Emit a code for declare mapper construct.

Definition at line 2872 of file CGDecl.cpp.

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

Referenced by EmitGlobal(), and EmitTopLevelDecl().

◆ EmitOMPDeclareReduction()

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

Emit a code for declare reduction construct.

Definition at line 2865 of file CGDecl.cpp.

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

Referenced by EmitGlobal(), and EmitTopLevelDecl().

◆ EmitOMPRequiresDecl()

void CodeGenModule::EmitOMPRequiresDecl ( const OMPRequiresDecl * D)

Emit a code for requires directive.

Parameters
DRequires declaration

Definition at line 2890 of file CGDecl.cpp.

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

Referenced by EmitTopLevelDecl().

◆ EmitOMPThreadPrivateDecl()

void CodeGenModule::EmitOMPThreadPrivateDecl ( const OMPThreadPrivateDecl * D)

Emit a code for threadprivate directive.

Parameters
DThreadprivate declaration.

Definition at line 7886 of file CodeGenModule.cpp.

References clang::Addr, clang::cast(), GetAddrOfGlobalVar(), getContext(), getOpenMPRuntime(), clang::ValueDecl::getType(), getTypes(), and clang::OMPThreadPrivateDecl::varlist().

Referenced by EmitTopLevelDecl().

◆ EmitOpenACCDeclare()

void CodeGenModule::EmitOpenACCDeclare ( const OpenACCDeclareDecl * D,
CodeGenFunction * CGF = nullptr )

Definition at line 2880 of file CGDecl.cpp.

Referenced by EmitTopLevelDecl().

◆ EmitOpenACCRoutine()

void CodeGenModule::EmitOpenACCRoutine ( const OpenACCRoutineDecl * D,
CodeGenFunction * CGF = nullptr )

Definition at line 2885 of file CGDecl.cpp.

Referenced by EmitTopLevelDecl().

◆ EmitPointerAuthInfo()

CGPointerAuthInfo clang::CodeGen::CodeGenModule::EmitPointerAuthInfo ( const RecordDecl * RD)

◆ EmitTentativeDefinition()

void CodeGenModule::EmitTentativeDefinition ( const VarDecl * D)

Definition at line 5529 of file CodeGenModule.cpp.

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

◆ EmitTopLevelDecl()

◆ 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 1193 of file CGVTables.cpp.

◆ EmitVTableTypeMetadata()

◆ Error()

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

Emit a general error that something can't be done.

Definition at line 1711 of file CodeGenModule.cpp.

References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), and clang::DiagnosticsEngine::Report().

Referenced by createCoroData().

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

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

◆ ErrorUnsupported() [2/2]

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

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

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

Definition at line 1718 of file CodeGenModule.cpp.

References clang::DiagnosticsEngine::Error, clang::Stmt::getBeginLoc(), clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::Stmt::getSourceRange(), clang::DiagnosticsEngine::Report(), and clang::CodeGen::Type.

Referenced by AddVariableConstraints(), and GetAddrOfTemplateParamObject().

◆ finalizeKCFITypes()

void CodeGenModule::finalizeKCFITypes ( )

Emit KCFI type identifier constants and remove unused identifiers.

Definition at line 3078 of file CodeGenModule.cpp.

References allowKCFIIdentifier(), clang::Asm, getModule(), and clang::CodeGen::Type.

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

References ArgInfoAddressSpace(), clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::CodeGen::Decl, 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::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, and removeImageAccessQualifier().

◆ getABIInfo()

const ABIInfo & CodeGenModule::getABIInfo ( )

◆ getAddrAndTypeOfCXXStructor()

◆ GetAddrOfConstantCFString()

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

References clang::CompoundLiteralExpr::isFileScope().

◆ getAddrOfConstantCompoundLiteralIfEmitted()

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

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

Otherwise, returns null.

Definition at line 2583 of file CGExprConstant.cpp.

◆ GetAddrOfConstantCString()

ConstantAddress CodeGenModule::GetAddrOfConstantCString ( const std::string & Str,
StringRef GlobalName = ".str" )

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

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

Referenced by buildBlockDescriptor(), and GetAddrOfConstantStringFromObjCEncode().

◆ GetAddrOfConstantStringFromLiteral()

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

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

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

References clang::cast(), getAddrAndTypeOfCXXStructor(), clang::ast_matchers::getCallee(), and clang::CodeGen::NotForDefinition.

Referenced by codegenCXXStructor(), 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 5059 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), clang::cast(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::Dtor_Base, clang::Dtor_Complete, clang::Decl::getAttr(), getCUDARuntime(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CGCUDARuntime::getKernelHandle(), clang::GlobalDecl::getKernelReferenceKind(), getMangledName(), getTarget(), clang::ValueDecl::getType(), getTypes(), and clang::Stub.

Referenced by EmitNewDeleteCall(), GetAddrOfGlobal(), GetFunctionStart(), and getRawFunctionPointer().

◆ GetAddrOfGlobal()

◆ GetAddrOfGlobalBlock()

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

◆ getAddrOfGlobalBlockIfEmitted()

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

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

Definition at line 1161 of file CodeGenModule.h.

Referenced by buildGlobalBlock(), and GetAddrOfGlobalBlock().

◆ GetAddrOfGlobalTemporary()

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

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

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

◆ GetAddrOfMSGuidDecl()

◆ GetAddrOfRTTIDescriptor()

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

◆ GetAddrOfTemplateParamObject()

◆ 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 35 of file CGVTables.cpp.

◆ GetAddrOfUnnamedGlobalConstantDecl()

◆ getAtomicGetterHelperFnMap()

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

Definition at line 798 of file CodeGenModule.h.

◆ getAtomicOpts()

AtomicOptions clang::CodeGen::CodeGenModule::getAtomicOpts ( )
inline

Get the current Atomic options.

Definition at line 703 of file CodeGenModule.h.

Referenced by CodeGenModule().

◆ getAtomicSetterHelperFnMap()

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

Definition at line 790 of file CodeGenModule.h.

◆ getBlockDescriptorType()

llvm::Type * CodeGenModule::getBlockDescriptorType ( )

Fetches the type of a generic block descriptor.

Definition at line 1124 of file CGBlocks.cpp.

References getContext(), getLangOpts(), getLLVMContext(), clang::ASTContext::getTargetAddressSpace(), clang::OpenCL, and clang::opencl_constant.

Referenced by getGenericBlockLiteralType(), and initializeForBlockHeader().

◆ getBlockMangledName()

◆ 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 176 of file CGBuiltin.cpp.

References clang::cast(), getMangledName(), getTarget(), getTriple(), clang::ValueDecl::getType(), getTypes(), and clang::Decl::hasAttr().

◆ getClassPointerAlignment()

CharUnits CodeGenModule::getClassPointerAlignment ( const CXXRecordDecl * CD)

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

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

Definition at line 40 of file CGClass.cpp.

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

Referenced by getNaturalTypeAlignment(), InitCatchParam(), and PerformReturnAdjustment().

◆ getCodeGenOpts()

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

Definition at line 830 of file CodeGenModule.h.

Referenced by clang::CodeGen::TargetCodeGenInfo::addStackProbeTargetAttributes(), AlwaysHasLTOVisibilityPublic(), BuildAppleKextVirtualCall(), buildBlockDescriptor(), buildGlobalBlock(), configureBlocksRuntimeObject(), ConstructAttributeList(), CreateKCFITypeId(), clang::CodeGen::createPPC32TargetCodeGenInfo(), createReferenceTemporary(), createTargetCodeGenInfo(), clang::CodeGen::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), emitAutoreleasedReturnValueMarker(), emitCheckHandlerCall(), emitCombinerOrInitializer(), EmitDeclDestroy(), EmitExternalDeclaration(), EmitObjectDelete(), emitOptimizedARCReturnCall(), emitOutlinedFunctionPrologue(), emitTaskPrivateMappingFunction(), EmitTopLevelDecl(), EmitVTableTypeMetadata(), emitWritebackArg(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), GenKernelArgMetadata(), genMapInfo(), clang::CodeGen::EHPersonality::get(), GetAddrOfConstantCFString(), GetAddrOfConstantStringFromLiteral(), getBlockDescriptorName(), getCodegenToUse(), getCopyDestroyHelperFuncName(), getFunctionPointerAuthInfo(), getMangledNameImpl(), getMemberFunctionPointerAuthInfo(), isFunctionBlockedByProfileList(), isFunctionBlockedFromProfileInstr(), needsTypeIdentifier(), Release(), requiresMemberFunctionPointerTypeMetadata(), clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes(), setWindowsItaniumDLLImport(), shouldAssumeDSOLocal(), shouldEmitAvailableExternallyVTable(), shouldEmitVTableThunk(), shouldSplitConstantStore(), TryEmitBaseDestructorAsAlias(), and TypeRequiresBuiltinLaunder().

◆ GetConstantArrayFromStringLiteral()

◆ getConstantSignedPointer() [1/2]

llvm::Constant * CodeGenModule::getConstantSignedPointer ( llvm::Constant * Pointer,
const PointerAuthSchema & Schema,
llvm::Constant * StorageAddress,
GlobalDecl SchemaDecl,
QualType SchemaType )

◆ getConstantSignedPointer() [2/2]

llvm::Constant * CodeGenModule::getConstantSignedPointer ( llvm::Constant * Pointer,
unsigned Key,
llvm::Constant * StorageAddress,
llvm::ConstantInt * OtherDiscriminator )

◆ getContext()

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

Definition at line 821 of file CodeGenModule.h.

Referenced by AddDeferredUnusedCoverageMapping(), AddGlobalDtor(), AddVTableTypeMetadata(), buildBlockDescriptor(), buildByrefHelpers(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), classifyType(), CodeGenModule(), computeBlockInfo(), computeNonVirtualBaseClassOffset(), configureBlocksRuntimeObject(), ConstructAttributeList(), createCXXABI(), clang::CodeGen::CreateItaniumCXXABI(), CreateKCFITypeId(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), CreateMetadataIdentifierGeneralized(), createPrivatesRecordDecl(), CreateRuntimeVariable(), createUnnamedGlobalFrom(), EmitAnnotationLineNo(), EmitAnnotationUnit(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), EmitDeclDestroy(), emitDependData(), emitDestructorsFunction(), EmitDoacrossOrdered(), EmitGlobal(), emitGlobalDtorWithCXAAtExit(), EmitGlobalNamedRegister(), EmitNullConstant(), EmitOMPAllocateDecl(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitRestoreIP(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), EmitTopLevelDecl(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), EmitVTableTypeMetadata(), GenerateStringLiteral(), GetAddrOfConstantCFString(), GetAddrOfConstantCString(), GetAddrOfConstantStringFromLiteral(), GetAddrOfConstantStringFromObjCEncode(), GetAddrOfGlobalTemporary(), GetAddrOfUnnamedGlobalConstantDecl(), getAsmSrcLocInfo(), getBlockCaptureStr(), getBlockDescriptorName(), getBlockDescriptorType(), getClangCallTerminateFn(), getClassPointerAlignment(), getDynamicOffsetAlignment(), getEntryInfoFromPresumedLoc(), getEnumInfo(), getFunctionLinkage(), getGuardAcquireFn(), getInstrProfSection(), getLLVMLinkageVarDefinition(), getMangledName(), getMangledNameImpl(), clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize(), getMemberFunctionPointer(), 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(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), getPointerAuthInfoForType(), getPointerAuthOtherDiscriminator(), clang::CodeGen::getPointerAuthTypeDiscriminator(), getTypeInfoLinkage(), getVBaseAlignment(), GetWeakRefReference(), handleAMDGPUFlatWorkGroupSizeAttr(), handleAMDGPUWavesPerEUAttr(), handleCUDALaunchBoundsAttr(), imbueXRayAttrs(), InitCatchParam(), InitDeviceMC(), clang::CodeGen::initializationPatternFor(), isFunctionBlockedByProfileList(), isInNoSanitizeList(), isInNoSanitizeList(), clang::CodeGen::swiftcall::isLegalIntegerType(), printPostfixForExternalizedDecl(), Release(), SetLLVMFunctionAttributesForDefinition(), setUsedBits(), setUsedBits(), setUsedBits(), setWindowsItaniumDLLImport(), shouldBeInCOMDAT(), ShouldUseExternalRTTIDescriptor(), stopAutoInit(), and TypeRequiresBuiltinLaunder().

◆ getCoverageMapping()

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

Definition at line 760 of file CodeGenModule.h.

◆ getCUDARuntime()

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

Return a reference to the configured CUDA runtime.

Definition at line 735 of file CodeGenModule.h.

Referenced by EmitDirectCallee(), GetAddrOfFunction(), getMangledName(), and GetOrCreateLLVMGlobal().

◆ getCXXABI()

◆ getDataLayout()

◆ GetDefaultLLVMTLSModel()

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

◆ getDiags()

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

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

Referenced by getVBaseAlignment().

◆ getExpressionLocationsEnabled()

bool CodeGenModule::getExpressionLocationsEnabled ( ) const

Return true if we should emit location information for expressions.

Definition at line 6772 of file CodeGenModule.cpp.

◆ getFileSystem()

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

Definition at line 823 of file CodeGenModule.h.

◆ getFunctionLinkage()

◆ getFunctionPointer() [1/2]

llvm::Constant * CodeGenModule::getFunctionPointer ( GlobalDecl GD,
llvm::Type * Ty = nullptr )

Return the ABI-correct function pointer value for a reference to the given function.

This will apply a pointer signature if necessary, caching the result for the given function.

Definition at line 493 of file CGPointerAuth.cpp.

References clang::cast(), clang::GlobalDecl::getDecl(), getFunctionPointer(), and getRawFunctionPointer().

Referenced by EmitFunctionDeclLValue(), emitGlobalDtorWithCXAAtExit(), and getFunctionPointer().

◆ getFunctionPointer() [2/2]

llvm::Constant * CodeGenModule::getFunctionPointer ( llvm::Constant * Pointer,
QualType FunctionType )

Return the ABI-correct function pointer value for a reference to the given function.

If applicable, sign a given constant function pointer with the ABI rules for functionType.

This will apply a pointer signature if necessary.

Definition at line 479 of file CGPointerAuth.cpp.

References getConstantSignedPointer(), getFunctionPointerAuthInfo(), clang::Type::isFunctionPointerType(), clang::Type::isFunctionReferenceType(), clang::Type::isFunctionType(), and Pointer.

◆ getFunctionPointerAuthInfo()

CGPointerAuthInfo CodeGenModule::getFunctionPointerAuthInfo ( QualType T)

Return the abstract pointer authentication schema for a pointer to the given function type.

Definition at line 74 of file CGPointerAuth.cpp.

References clang::PointerAuthOptions::FunctionPointers, getCodeGenOpts(), getPointerAuthOtherDiscriminator(), clang::CodeGenOptions::PointerAuth, and clang::T.

Referenced by getFunctionPointer(), and getPointerAuthInfoForPointeeType().

◆ GetFunctionStart()

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

Definition at line 5099 of file CodeGenModule.cpp.

References clang::cast(), clang::CodeGen::Decl, and GetAddrOfFunction().

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

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

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

◆ getGlobalCtors()

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

Definition at line 865 of file CodeGenModule.h.

◆ getGlobalDtors()

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

Definition at line 866 of file CodeGenModule.h.

◆ GetGlobalValue()

◆ 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 5586 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 emitCatchDispatchBlock(), EmitOMPAllocateDecl(), GetAddrOfGlobalTemporary(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), and getVtableGlobalVarAlignment().

◆ getHeaderSearchOpts()

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

Definition at line 826 of file CodeGenModule.h.

◆ getHLSLRuntime()

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

Return a reference to the configured HLSL runtime.

Definition at line 741 of file CodeGenModule.h.

Referenced by EmitTopLevelDecl(), handleHlslClip(), and Release().

◆ getIntrinsic()

◆ getItaniumVTableContext() [1/2]

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

◆ getItaniumVTableContext() [2/2]

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

Definition at line 857 of file CodeGenModule.h.

◆ getLangOpts()

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

Definition at line 822 of file CodeGenModule.h.

Referenced by addBlockLayout(), addMonoNonMonoModifier(), buildBlockDescriptor(), buildGlobalBlock(), CallBeginCatch(), castStringLiteralToDefaultAddressSpace(), CodeGenModule(), computeBlockInfo(), configureBlocksRuntimeObject(), ConstructAttributeList(), CreateGlobalInitOrCleanUpFunction(), clang::CodeGen::CreateGNUObjCRuntime(), EmitAtomicOp(), clang::CodeGen::CGOpenMPRuntime::emitBarrierCall(), EmitBaseInitializer(), emitCommonOMPTargetDirective(), EmitDirectCallee(), clang::CodeGen::CGOpenMPRuntime::emitFlush(), EmitGlobal(), emitLibraryCall(), EmitObjectDelete(), emitOMPAtomicCaptureExpr(), emitOMPForDirective(), emitOMPSimdDirective(), emitTargetTeamsLoopCodegenStatus(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskyieldCall(), EmitThreadPrivateVarDeclLValue(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), GenerateStringLiteral(), GenKernelArgMetadata(), clang::CodeGen::EHPersonality::get(), GetAddrOfConstantCFString(), getAsmSrcLocInfo(), getBlockDescriptorName(), getBlockDescriptorType(), getCopyDestroyHelperFuncName(), getGenericBlockLiteralType(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), getLLVMLinkageForDeclarator(), getMangledName(), getMangledNameImpl(), getNaturalTypeAlignment(), GetOrCreateLLVMGlobal(), getStaticDeclName(), getTBAAAccessInfo(), getTerminateFn(), getTypeInfoLinkage(), hasMRCWeakIvars(), initializeForBlockHeader(), MaybeHandleStaticInExternC(), printPostfixForExternalizedDecl(), Release(), setARCRuntimeFunctionLinkage(), setGlobalVisibility(), SetLLVMFunctionAttributesForDefinition(), shouldAssumeDSOLocal(), shouldEmitBuiltinAsIR(), shouldEmitRTTI(), shouldMapVisibilityToDLLExport(), shouldZeroInitPadding(), tryCaptureAsConstant(), tryGenerateSpecializedMessageSend(), and UseOptimizedSetter().

◆ getLLVMContext()

◆ getLLVMFakeUseFn()

llvm::Function * CodeGenModule::getLLVMFakeUseFn ( )

Lazily declare the @llvm.fake.use intrinsic.

Definition at line 2625 of file CGDecl.cpp.

References getModule().

◆ getLLVMLifetimeEndFn()

llvm::Function * CodeGenModule::getLLVMLifetimeEndFn ( )

Lazily declare the @llvm.lifetime.end intrinsic.

Definition at line 2616 of file CGDecl.cpp.

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

◆ getLLVMLifetimeStartFn()

llvm::Function * CodeGenModule::getLLVMLifetimeStartFn ( )

Lazily declare the @llvm.lifetime.start intrinsic.

Definition at line 2607 of file CGDecl.cpp.

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

◆ getLLVMLinkageForDeclarator()

◆ getLLVMLinkageVarDefinition()

llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageVarDefinition ( const VarDecl * VD)

◆ GetLLVMVisibility()

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

◆ getMangledName()

◆ getMangledNameDecl()

const GlobalDecl CodeGenModule::getMangledNameDecl ( StringRef Name)

Definition at line 2233 of file CodeGenModule.cpp.

◆ getMemberFunctionPointer() [1/2]

llvm::Constant * CodeGenModule::getMemberFunctionPointer ( const FunctionDecl * FD,
llvm::Type * Ty = nullptr )

◆ getMemberFunctionPointer() [2/2]

llvm::Constant * CodeGenModule::getMemberFunctionPointer ( llvm::Constant * Pointer,
QualType FT )

◆ getMemberFunctionPointerAuthInfo()

◆ getMemberPointerConstant()

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

◆ getMicrosoftVTableContext()

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

Definition at line 861 of file CodeGenModule.h.

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

References clang::ASTContext::getASTRecordLayout(), getContext(), clang::ASTRecordLayout::getSize(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::isEffectivelyFinal(), 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 1115 of file CodeGenModule.h.

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

Referenced by ConstructAttributeList().

◆ getModule()

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

Definition at line 831 of file CodeGenModule.h.

Referenced by clang::CodeGen::CGHLSLRuntime::addBuffer(), clang::CodeGen::CGHLSLRuntime::addRootSignature(), buildBlockDescriptor(), buildGlobalBlock(), CodeGenModule(), clang::CodeGen::TargetCodeGenInfo::createEnqueuedBlockKernel(), CreateGlobalInitOrCleanUpFunction(), CreateOrReplaceCXXRuntimeVariable(), createReferenceTemporary(), createUnnamedGlobalFrom(), EmitAnnotationArgs(), EmitAnnotationString(), emitAutoreleasedReturnValueMarker(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), EmitDoacrossOrdered(), clang::CodeGen::CGHLSLRuntime::emitEntryFunction(), EmitGlobalAnnotations(), EmitGlobalDeclMetadata(), EmitGlobalNamedRegister(), EmitHipStdParUnsupportedAsm(), EmitHipStdParUnsupportedBuiltin(), emitInitWithReductionInitializer(), clang::CodeGen::CGHLSLRuntime::emitInputSemantic(), EmitMainVoidAlias(), EmitNullBaseClassInitialization(), EmitOMPAllocateDecl(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), EmitTopLevelDecl(), emitUsed(), finalizeKCFITypes(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CGHLSLRuntime::generateGlobalCtorDtorCalls(), GenerateStringLiteral(), GetAddrOfConstantCFString(), GetAddrOfGlobalTemporary(), GetAddrOfMSGuidDecl(), GetAddrOfTemplateParamObject(), GetAddrOfUnnamedGlobalConstantDecl(), getClangCallTerminateFn(), GetGlobalValue(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUNumThreads(), getInitThreadEpochPtr(), getIntrinsic(), getLLVMFakeUseFn(), getLLVMLifetimeEndFn(), getLLVMLifetimeStartFn(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), getSanStats(), getTypeInfoVTable(), initializeBuffer(), Release(), setThunkProperties(), and TryEmitBaseDestructorAsAlias().

◆ getModuleDebugInfo()

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

◆ getModuleNameHash()

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

Definition at line 720 of file CodeGenModule.h.

Referenced by getMangledNameImpl(), and isUniqueInternalLinkageDecl().

◆ getMostBaseClasses()

SmallVector< const CXXRecordDecl *, 0 > 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 2642 of file CodeGenModule.cpp.

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

Referenced by SetLLVMFunctionAttributesForDefinition().

◆ getNaturalPointeeTypeAlignment()

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

Definition at line 8002 of file CodeGenModule.cpp.

References getNaturalTypeAlignment(), and clang::T.

Referenced by ConstructAttributeList(), and EmitPointerWithAlignment().

◆ getNaturalTypeAlignment()

◆ GetNonVirtualBaseClassOffset()

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

Returns the offset from a derived class to a class.

Returns null if the offset is 0.

Definition at line 194 of file CGClass.cpp.

References computeNonVirtualBaseClassOffset(), clang::CodeGen::CodeGenTypes::ConvertType(), getContext(), getTypes(), and clang::CodeGen::CodeGenTypeCache::PtrDiffTy.

◆ getNoObjCARCExceptionsMetadata()

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

Definition at line 815 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 2041 of file CGExprConstant.cpp.

References getTargetCodeGenInfo(), and clang::T.

Referenced by EmitNullConstant().

◆ getObjCEntrypoints()

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

◆ getObjCFastEnumerationStateType()

QualType CodeGenModule::getObjCFastEnumerationStateType ( )

Retrieve the record type that describes the state of an Objective-C fast enumeration loop (for..in).

Definition at line 6776 of file CodeGenModule.cpp.

References clang::DeclContext::addDecl(), clang::AS_public, clang::RecordDecl::completeDefinition(), clang::FieldDecl::Create(), clang::ICIS_NoInit, clang::Normal, and clang::TagDecl::startDefinition().

◆ getObjCRuntime()

◆ getOMPAllocateAlignment()

std::optional< CharUnits > CodeGenModule::getOMPAllocateAlignment ( const VarDecl * VD)

◆ getOpenCLRuntime()

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

Return a reference to the configured OpenCL runtime.

Definition at line 723 of file CodeGenModule.h.

Referenced by buildGlobalBlock(), createOpenCLIntToSamplerConversion(), getGenericBlockLiteralType(), and initializeForBlockHeader().

◆ getOpenMPRuntime()

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

Return a reference to the configured OpenMP runtime.

Definition at line 729 of file CodeGenModule.h.

Referenced by checkForLastprivateConditionalUpdate(), emitCombinerOrInitializer(), emitCommonOMPParallelDirective(), emitCommonOMPTargetDirective(), emitCommonOMPTeamsDirective(), emitCommonSimdLoop(), emitCopyprivateCopyFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), emitDeclTargetVarDeclLValue(), emitDestructorsFunction(), EmitDoacrossOrdered(), clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(), EmitGlobal(), emitInitWithReductionInitializer(), emitMasked(), emitMaster(), emitOffloadingArraysAndArgs(), emitOMPAtomicCaptureExpr(), emitOMPAtomicCompareExpr(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), emitOMPAtomicWriteExpr(), emitOMPCopyinClause(), EmitOMPDeclareMapper(), EmitOMPDeclareReduction(), emitOMPDistributeDirective(), emitOMPForDirective(), EmitOMPRequiresDecl(), emitOMPSimdDirective(), emitOMPSimdRegion(), clang::CodeGen::CodeGenFunction::EmitOMPTargetDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskgroupDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeParallelForDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeParallelForSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsGenericLoopDirective(), EmitOMPThreadPrivateDecl(), clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(), emitOutlinedFunctionPrologue(), clang::CodeGen::CGOpenMPRuntime::emitParallelCall(), emitParallelOrTeamsOutlinedFunction(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReduction(), emitReductionCombiner(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), emitTargetParallelRegion(), emitTargetRegion(), emitTargetTeamsDistributeParallelForRegion(), emitTargetTeamsDistributeParallelForSimdRegion(), emitTargetTeamsDistributeRegion(), emitTargetTeamsDistributeSimdRegion(), emitTargetTeamsGenericLoopRegionAsDistribute(), emitTargetTeamsGenericLoopRegionAsParallel(), emitTargetTeamsRegion(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), EmitThreadPrivateVarDeclLValue(), emitWorksharingDirective(), generateUniqueName(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntimeGPU::getDefaultDistScheduleAndChunk(), GetOrCreateLLVMGlobal(), and clang::CodeGen::CodeGenFunction::processInReduction().

◆ GetOrCreateLLVMGlobal()

llvm::Constant * CodeGenModule::GetOrCreateLLVMGlobal ( StringRef MangledName,
llvm::Type * Ty,
LangAS AddrSpace,
const VarDecl * D,
ForDefinition_t IsForDefinition = NotForDefinition )

GetOrCreateLLVMGlobal - If the specified mangled name is not in the module, create and return an llvm GlobalVariable with the specified type and address space.

If there is something in the module with the specified name, return it potentially bitcasted to the right type.

If D is non-null, it specifies a decl that correspond to this. This is used to set the attributes on the global when it is first created.

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

References clang::cast(), clang::CLanguageLinkage, clang::CUDA, clang::VarDecl::DeclarationOnly, clang::Default, clang::CodeGen::ConstantEmitter::finalize(), clang::QualType::getAddressSpace(), GetAddrOfGlobalVar(), clang::VarDecl::getAnyInitializer(), clang::Decl::getAttr(), clang::GlobalDecl::getCanonicalDecl(), clang::VarDecl::getCanonicalDecl(), getContext(), getCUDARuntime(), clang::GlobalDecl::getDecl(), getDiags(), GetGlobalValue(), GetGlobalVarAddressSpace(), getLangOpts(), clang::VarDecl::getLanguageLinkage(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), getLLVMContext(), clang::Decl::getLocation(), getModule(), getOpenMPRuntime(), clang::ASTContext::getTargetAddressSpace(), getTargetCodeGenInfo(), clang::VarDecl::getTLSKind(), getTriple(), clang::ValueDecl::getType(), clang::CodeGen::CGCUDARuntime::handleVarRegistration(), clang::Decl::hasAttr(), clang::VarDecl::hasDefinition(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasInit(), clang::Init, clang::QualType::isConstant(), clang::QualType::isConstantStorage(), clang::QualType::isConstQualified(), clang::isExternallyVisible(), clang::VarDecl::isThisDeclarationADefinition(), lookupRepresentativeDecl(), clang::opencl_global, clang::CodeGen::TargetCodeGenInfo::performAddrSpaceCast(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), clang::DiagnosticsEngine::Report(), setGVProperties(), setLinkageForGV(), clang::CodeGen::TargetCodeGenInfo::setTargetAttributes(), setTLSMode(), clang::VarDecl::TLS_Dynamic, and clang::CodeGen::ConstantEmitter::tryEmitForInitializer().

Referenced by CreateRuntimeVariable(), GetAddrOfGlobalVar(), getNSConcreteGlobalBlock(), getNSConcreteStackBlock(), and GetWeakRefReference().

◆ getOrCreateStaticVarDecl()

◆ getPGOReader()

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

Definition at line 758 of file CodeGenModule.h.

◆ getPGOStats()

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

Definition at line 757 of file CodeGenModule.h.

◆ getPointerAuthDeclDiscriminator()

uint16_t CodeGenModule::getPointerAuthDeclDiscriminator ( GlobalDecl GD)

Return the "other" decl-specific discriminator for the given decl.

Definition at line 61 of file CGPointerAuth.cpp.

References clang::Declaration, and getMangledName().

Referenced by clang::CodeGen::getPointerAuthDeclDiscriminator(), and getPointerAuthOtherDiscriminator().

◆ getPointerAuthInfoForPointeeType()

CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForPointeeType ( QualType type)

Definition at line 170 of file CGPointerAuth.cpp.

References clang::T.

Referenced by emitPointerArithmetic().

◆ getPointerAuthInfoForType()

CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType ( QualType type)

Definition at line 192 of file CGPointerAuth.cpp.

References clang::T.

◆ getPointerAuthOtherDiscriminator()

◆ getPreprocessorOpts()

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

Definition at line 828 of file CodeGenModule.h.

◆ getRawFunctionPointer()

llvm::Constant * CodeGenModule::getRawFunctionPointer ( GlobalDecl GD,
llvm::Type * Ty = nullptr )

Return a function pointer for a reference to the given function.

This correctly handles weak references, but does not apply a pointer signature.

Definition at line 3096 of file CGExpr.cpp.

References clang::cast(), GetAddrOfFunction(), clang::GlobalDecl::getDecl(), clang::CodeGen::ConstantAddress::getPointer(), GetWeakRefReference(), clang::Decl::hasAttr(), and V.

Referenced by EmitDirectCallee(), getFunctionPointer(), and getMemberFunctionPointer().

◆ getSanitizerMetadata()

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

Definition at line 1537 of file CodeGenModule.h.

Referenced by Release().

◆ getSanStats()

llvm::SanitizerStatReport & CodeGenModule::getSanStats ( )

Definition at line 7984 of file CodeGenModule.cpp.

References getModule().

◆ getSize()

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

Emit the given number of characters as a value of type size_t.

Definition at line 1740 of file CodeGenModule.cpp.

References clang::CharUnits::getQuantity(), and clang::CodeGen::CodeGenTypeCache::SizeTy.

Referenced by EmitNullBaseClassInitialization(), emitStructGetterCall(), and emitStructSetterCall().

◆ getStaticLocalDeclAddress()

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

Definition at line 764 of file CodeGenModule.h.

◆ getStaticLocalDeclGuardAddress()

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

Definition at line 776 of file CodeGenModule.h.

◆ getTarget()

◆ getTargetCodeGenInfo()

◆ GetTargetTypeStoreSize()

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

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

Definition at line 5581 of file CodeGenModule.cpp.

References getDataLayout().

Referenced by EmitVTableTypeMetadata().

◆ getTBAAAccessInfo()

TBAAAccessInfo CodeGenModule::getTBAAAccessInfo ( QualType AccessType)

getTBAAAccessInfo - Get TBAA information that describes an access to an object of the given type.

Definition at line 1632 of file CodeGenModule.cpp.

References getLangOpts(), getTargetCodeGenInfo(), clang::Type::isCUDADeviceBuiltinSurfaceType(), and clang::Type::isCUDADeviceBuiltinTextureType().

Referenced by emitLibraryCall(), EmitPointerWithAlignment(), getNaturalTypeAlignment(), and getTBAAInfoForSubobject().

◆ getTBAAAccessTagInfo()

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

getTBAAAccessTagInfo - Get TBAA tag for a given memory access.

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

◆ getTBAAInfoForSubobject()

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

getTBAAInfoForSubobject - Get TBAA information for an access with a given base lvalue.

Definition at line 906 of file CodeGenModule.h.

References clang::CodeGen::TBAAAccessInfo::getMayAliasInfo(), and getTBAAAccessInfo().

Referenced by loadToBegin().

◆ getTBAAStructInfo()

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

Definition at line 1658 of file CodeGenModule.cpp.

◆ getTBAATypeInfo()

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

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

Definition at line 1626 of file CodeGenModule.cpp.

◆ getTBAAVTablePtrAccessInfo()

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

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

Definition at line 1652 of file CodeGenModule.cpp.

◆ getTerminateFn()

llvm::FunctionCallee CodeGenModule::getTerminateFn ( )

◆ getTriple()

◆ getTypeDescriptorFromMap()

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

Definition at line 806 of file CodeGenModule.h.

◆ getTypes()

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

Definition at line 849 of file CodeGenModule.h.

Referenced by addX86InterruptAttrs(), clang::CodeGen::arrangeCXXMethodCall(), clang::CodeGen::arrangeCXXMethodType(), clang::CodeGen::arrangeFreeFunctionCall(), clang::CodeGen::arrangeFreeFunctionType(), clang::CodeGen::arrangeFreeFunctionType(), clang::CodeGen::arrangeObjCMessageSendSignature(), buildBlockDescriptor(), buildGlobalBlock(), canEmitDelegateCallArgs(), codegenCXXStructor(), CodeGenModule(), computeBlockInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), ConstructAttributeList(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::convertTypeForMemory(), clang::CodeGen::createAArch64TargetCodeGenInfo(), clang::CodeGen::createAIXTargetCodeGenInfo(), clang::CodeGen::createAMDGPUTargetCodeGenInfo(), clang::CodeGen::createARCTargetCodeGenInfo(), clang::CodeGen::createARMTargetCodeGenInfo(), clang::CodeGen::createAVRTargetCodeGenInfo(), clang::CodeGen::createBPFTargetCodeGenInfo(), clang::CodeGen::createCommonSPIRTargetCodeGenInfo(), clang::CodeGen::createCSKYTargetCodeGenInfo(), clang::CodeGen::createDefaultTargetCodeGenInfo(), clang::CodeGen::createDirectXTargetCodeGenInfo(), createGlobalInitOrCleanupFn(), clang::CodeGen::createHexagonTargetCodeGenInfo(), clang::CodeGen::createLanaiTargetCodeGenInfo(), clang::CodeGen::createLoongArchTargetCodeGenInfo(), clang::CodeGen::createM68kTargetCodeGenInfo(), clang::CodeGen::createMIPSTargetCodeGenInfo(), clang::CodeGen::createMSP430TargetCodeGenInfo(), clang::CodeGen::createNVPTXTargetCodeGenInfo(), clang::CodeGen::createPPC32TargetCodeGenInfo(), clang::CodeGen::createPPC64_SVR4_TargetCodeGenInfo(), clang::CodeGen::createPPC64TargetCodeGenInfo(), clang::CodeGen::createRISCVTargetCodeGenInfo(), CreateRuntimeFunction(), clang::CodeGen::createSparcV8TargetCodeGenInfo(), clang::CodeGen::createSparcV9TargetCodeGenInfo(), clang::CodeGen::createSPIRVTargetCodeGenInfo(), clang::CodeGen::createSystemZTargetCodeGenInfo(), clang::CodeGen::createTCETargetCodeGenInfo(), clang::CodeGen::createVETargetCodeGenInfo(), clang::CodeGen::createWebAssemblyTargetCodeGenInfo(), clang::CodeGen::createWindowsAArch64TargetCodeGenInfo(), clang::CodeGen::createWindowsARMTargetCodeGenInfo(), clang::CodeGen::createWindowsMIPSTargetCodeGenInfo(), clang::CodeGen::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createWinX86_64TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_64TargetCodeGenInfo(), clang::CodeGen::createXCoreTargetCodeGenInfo(), emitAddrOfFieldStorage(), emitAtomicLibcall(), emitCombinerOrInitializer(), emitConstantObjCStringLiteral(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), EmitGlobal(), EmitHipStdParUnsupportedBuiltin(), EmitNewDeleteCall(), EmitNullConstant(), EmitNullConstant(), EmitNullConstantForBase(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitPreserveStructAccess(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), generateByrefCopyHelper(), generateByrefDisposeHelper(), getAddrAndTypeOfCXXStructor(), GetAddrOfConstantCFString(), GetAddrOfFunction(), GetAddrOfGlobal(), GetAddrOfGlobalTemporary(), GetAddrOfGlobalVar(), GetAddrOfMSGuidDecl(), getAllocatorVal(), getBuiltinLibFunction(), getClangCallTerminateFn(), GetConstantArrayFromStringLiteral(), getGEPIndicesToField(), getGuardAcquireFn(), getInlineSpirvType(), clang::CodeGen::getLLVMFieldNumber(), GetNonVirtualBaseClassOffset(), getOrCreateStaticVarDecl(), GetWeakRefReference(), RefreshTypeCacheForClass(), setUsedBits(), TryEmitBaseDestructorAsAlias(), and UpdateCompletedType().

◆ getUniqueBlockCount()

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

Fetches the global unique block count.

Definition at line 1148 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 76 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 1324 of file CGVTables.cpp.

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

Referenced by EmitVTableTypeMetadata(), and GetVCallVisibilityLevel().

◆ getVTableComponentType()

llvm::Type * CodeGenModule::getVTableComponentType ( ) const

◆ getVtableGlobalVarAlignment()

unsigned clang::CodeGen::CodeGenModule::getVtableGlobalVarAlignment ( const VarDecl * D = nullptr)
inline

◆ getVTableLinkage()

◆ getVTablePointerAuthentication()

std::optional< PointerAuthQualifier > CodeGenModule::getVTablePointerAuthentication ( const CXXRecordDecl * thisClass)

Definition at line 614 of file CGPointerAuth.cpp.

Referenced by getVTablePointerAuthInfo().

◆ getVTablePointerAuthInfo()

std::optional< CGPointerAuthInfo > CodeGenModule::getVTablePointerAuthInfo ( CodeGenFunction * Context,
const CXXRecordDecl * Record,
llvm::Value * StorageAddress )

◆ getVTables()

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

◆ GetWeakRefReference()

◆ handleAMDGPUFlatWorkGroupSizeAttr()

void CodeGenModule::handleAMDGPUFlatWorkGroupSizeAttr ( llvm::Function * F,
const AMDGPUFlatWorkGroupSizeAttr * A,
const ReqdWorkGroupSizeAttr * ReqdWGS = nullptr,
int32_t * MinThreadsVal = nullptr,
int32_t * MaxThreadsVal = nullptr )

Emit the IR encoding to attach the AMD GPU flat-work-group-size attribute to F.

Alternatively, the work group size can be taken from a ReqdWGS. If MinThreadsVal is not nullptr, the min threads value is stored in it, if a valid one was found. If MaxThreadsVal is not nullptr, the max threads value is stored in it, if a valid one was found.

Definition at line 706 of file AMDGPU.cpp.

References getContext(), clang::Max, and clang::Min.

◆ handleAMDGPUWavesPerEUAttr()

void CodeGenModule::handleAMDGPUWavesPerEUAttr ( llvm::Function * F,
const AMDGPUWavesPerEUAttr * A )

Emit the IR encoding to attach the AMD GPU waves-per-eu attribute to F.

Definition at line 737 of file AMDGPU.cpp.

References getContext(), clang::Max, and clang::Min.

◆ handleCUDALaunchBoundsAttr()

void CodeGenModule::handleCUDALaunchBoundsAttr ( llvm::Function * F,
const CUDALaunchBoundsAttr * A,
int32_t * MaxThreadsVal = nullptr,
int32_t * MinBlocksVal = nullptr,
int32_t * MaxClusterRankVal = nullptr )

Emit the IR encoding to attach the CUDA launch bounds attribute to F.

If MaxThreadsVal is not nullptr, the max threads value is stored in it, if a valid one was found.

Definition at line 320 of file NVPTX.cpp.

References getContext().

◆ HandleCXXStaticMemberVarInstantiation()

void CodeGenModule::HandleCXXStaticMemberVarInstantiation ( VarDecl * VD)

◆ HasHiddenLTOVisibility()

bool CodeGenModule::HasHiddenLTOVisibility ( const CXXRecordDecl * RD)

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

Definition at line 1312 of file CGVTables.cpp.

References AlwaysHasLTOVisibilityPublic(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), getTriple(), clang::LinkageInfo::getVisibility(), clang::HiddenVisibility, and clang::isExternallyVisible().

Referenced by GetVCallVisibilityLevel(), and requiresMemberFunctionPointerTypeMetadata().

◆ hasObjCRuntime()

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

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

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

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

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

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

◆ isInNoSanitizeList() [1/2]

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

◆ isInNoSanitizeList() [2/2]

◆ isPaddedAtomicType() [1/2]

bool CodeGenModule::isPaddedAtomicType ( const AtomicType * type)

Definition at line 787 of file CodeGenTypes.cpp.

References clang::ast_matchers::type.

◆ isPaddedAtomicType() [2/2]

bool CodeGenModule::isPaddedAtomicType ( QualType type)

Definition at line 783 of file CodeGenTypes.cpp.

References isPaddedAtomicType(), and clang::ast_matchers::type.

Referenced by isPaddedAtomicType().

◆ lookupRepresentativeDecl()

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

Definition at line 7778 of file CodeGenModule.cpp.

References clang::Result.

Referenced by GetOrCreateLLVMGlobal().

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

References clang::CPlusPlus, clang::First, getLangOpts(), hasAttr(), and clang::Internal.

◆ maybeSetTrivialComdat()

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

Definition at line 5729 of file CodeGenModule.cpp.

References clang::CodeGen::Decl, and shouldBeInCOMDAT().

◆ MayDropFunctionReturn()

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

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

Definition at line 1893 of file CGCall.cpp.

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

◆ mergeTBAAInfoForCast()

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

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

Definition at line 1676 of file CodeGenModule.cpp.

Referenced by emitOMPArraySectionBase(), and EmitPointerWithAlignment().

◆ mergeTBAAInfoForConditionalOperator()

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

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

Definition at line 1684 of file CodeGenModule.cpp.

◆ mergeTBAAInfoForMemoryTransfer()

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

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

Definition at line 1692 of file CodeGenModule.cpp.

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

◆ NeedAllVtablesTypeId()

bool CodeGenModule::NeedAllVtablesTypeId ( ) const

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

Definition at line 7953 of file CodeGenModule.cpp.

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

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

Referenced by getMangledNameImpl().

◆ RefreshTypeCacheForClass()

void CodeGenModule::RefreshTypeCacheForClass ( const CXXRecordDecl * Class)

◆ Release()

void CodeGenModule::Release ( )

Finalize LLVM code generation.

Definition at line 957 of file CodeGenModule.cpp.

References addCompilerUsedGlobal(), AddGlobalCtor(), clang::CodeGenOptions::All, clang::Default, clang::CodeGen::SanitizerMetadata::disableSanitizerForGlobal(), clang::EmbedObject(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), EmitDeferredUnusedCoverageMappings(), EmitGlobalAnnotations(), EmitMainVoidAlias(), clang::CodeGen::TargetCodeGenInfo::emitTargetGlobals(), clang::CodeGen::TargetCodeGenInfo::emitTargetMetadata(), clang::TargetOptions::Features, finalizeKCFITypes(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), GetAddrOfGlobal(), clang::getCFBranchLabelSchemeFlagVal(), clang::getClangVendor(), getCodeGenOpts(), getContext(), clang::ASTContext::getCurrentNamedModule(), getDiags(), clang::Decl::getEndLoc(), GetGlobalValue(), getHLSLRuntime(), getLangOpts(), clang::LangStandard::getLangStandardForKind(), getLLVMContext(), getMangledName(), getModule(), getModuleDebugInfo(), getSanitizerMetadata(), getTarget(), getTargetCodeGenInfo(), clang::TargetInfo::getTargetOpts(), getTriple(), clang::TargetOptions::Hostcall, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, INT_MAX, clang::Module::isHeaderLikeModule(), clang::Module::isInterfaceOrPartition(), clang::Kernel, clang::languageToString(), clang::CodeGen::CodeGenModule::Structor::LexOrder, clang::CodeGenOptions::None, clang::LangOptionsBase::None, clang::CodeGenOptions::NonLeaf, clang::DiagnosticsEngine::Report(), clang::CodeGenOptions::Reserved, clang::CodeGen::CodeGenPGO::setProfileVersion(), clang::CodeGen::CodeGenPGO::setValueProfilingFlag(), setVisibilityFromDLLStorageClass(), and clang::T.

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

References getTargetCodeGenInfo(), and ReturnTypeUsesSRet().

◆ ReturnTypeHasInReg()

bool CodeGenModule::ReturnTypeHasInReg ( const CGFunctionInfo & FI)

Return true iff the given type has inreg set.

Definition at line 1658 of file CGCall.cpp.

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

◆ ReturnTypeUsesFP2Ret()

bool CodeGenModule::ReturnTypeUsesFP2Ret ( QualType ResultType)

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

Definition at line 1685 of file CGCall.cpp.

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

◆ ReturnTypeUsesFPRet()

bool CodeGenModule::ReturnTypeUsesFPRet ( QualType ResultType)

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

Definition at line 1668 of file CGCall.cpp.

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

◆ ReturnTypeUsesSRet()

bool CodeGenModule::ReturnTypeUsesSRet ( const CGFunctionInfo & FI)

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

Definition at line 1653 of file CGCall.cpp.

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

Referenced by ReturnSlotInterferesWithArgs().

◆ runWithSufficientStackSpace()

void CodeGenModule::runWithSufficientStackSpace ( SourceLocation Loc,
llvm::function_ref< void()> Fn )

Run some code with "sufficient" stack space.

(Currently, at least 256K is guaranteed). Produces a warning if we're low on stack space and allocates more in that case. Use this in code that may recurse deeply to avoid stack overflow.

Definition at line 1735 of file CodeGenModule.cpp.

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

References Ok.

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

References clang::Addr, and Ok.

Referenced by buildGlobalBlock().

◆ setAtomicGetterHelperFnMap()

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

Definition at line 801 of file CodeGenModule.h.

◆ setAtomicOpts()

void clang::CodeGen::CodeGenModule::setAtomicOpts ( AtomicOptions AO)
inline

Set the current Atomic options.

Definition at line 706 of file CodeGenModule.h.

◆ setAtomicSetterHelperFnMap()

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

Definition at line 793 of file CodeGenModule.h.

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

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

Referenced by emitConstructorDestructorAlias(), and TryEmitBaseDestructorAsAlias().

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

◆ setFunctionLinkage()

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

Definition at line 1464 of file CodeGenModule.h.

References getFunctionLinkage().

Referenced by codegenCXXStructor(), and setThunkProperties().

◆ setGlobalVisibility()

◆ setGVProperties() [1/2]

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

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

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

Referenced by GetAddrOfGlobalTemporary(), GetAddrOfTemplateParamObject(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), SetCommonAttributes(), and setThunkProperties().

◆ setGVPropertiesAux()

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

Definition at line 1937 of file CodeGenModule.cpp.

References setDSOLocal(), and setGlobalVisibility().

Referenced by setGVProperties(), and setGVProperties().

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

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

◆ SetLLVMFunctionAttributes()

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

◆ SetLLVMFunctionAttributesForDefinition()

◆ setLLVMFunctionFEnvAttributes()

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

Set the LLVM function attributes that represent floating point environment.

References clang::Class.

◆ setStaticLocalDeclAddress()

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

Definition at line 767 of file CodeGenModule.h.

References clang::C.

Referenced by getOrCreateStaticVarDecl().

◆ setStaticLocalDeclGuardAddress()

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

Definition at line 779 of file CodeGenModule.h.

References clang::C.

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

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

Referenced by GetAddrOfGlobalTemporary(), GetOrCreateLLVMGlobal(), and getOrCreateStaticVarDecl().

◆ setTypeDescriptorInMap()

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

Definition at line 809 of file CodeGenModule.h.

References clang::C.

◆ shouldEmitConvergenceTokens()

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

◆ shouldEmitRTTI()

bool clang::CodeGen::CodeGenModule::shouldEmitRTTI ( bool ForEH = false)
inline

◆ shouldMapVisibilityToDLLExport()

◆ shouldSignPointer()

bool CodeGenModule::shouldSignPointer ( const PointerAuthSchema & Schema)

Does a given PointerAuthScheme require us to sign a value.

Definition at line 449 of file CGPointerAuth.cpp.

References clang::PointerAuthSchema::getAuthenticationMode(), clang::SignAndAuth, and clang::SignAndStrip.

Referenced by getConstantSignedPointer().

◆ shouldUseTBAA()

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

Definition at line 845 of file CodeGenModule.h.

◆ shouldZeroInitPadding()

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

Definition at line 1767 of file CodeGenModule.h.

References getLangOpts().

◆ stopAutoInit()

◆ supportsCOMDAT()

◆ TryEmitBaseDestructorAsAlias()

◆ UpdateCompletedType()

void CodeGenModule::UpdateCompletedType ( const TagDecl * TD)

Member Data Documentation

◆ ByrefHelpersCache

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

Definition at line 1145 of file CodeGenModule.h.

Referenced by buildByrefHelpers().

◆ GlobalUniqueCount

int clang::CodeGen::CodeGenModule::GlobalUniqueCount

Definition at line 638 of file CodeGenModule.h.

◆ IsOSVersionAtLeastFn

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

Definition at line 753 of file CodeGenModule.h.

◆ IsPlatformVersionAtLeastFn

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

Definition at line 755 of file CodeGenModule.h.

Referenced by emitIsPlatformVersionAtLeast().


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