clang 22.0.0git
|
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"
Classes | |
struct | Structor |
Public Types | |
typedef std::vector< Structor > | CtorList |
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. | |
CGObjCRuntime & | getObjCRuntime () |
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 |
CGOpenCLRuntime & | getOpenCLRuntime () |
Return a reference to the configured OpenCL runtime. | |
CGOpenMPRuntime & | getOpenMPRuntime () |
Return a reference to the configured OpenMP runtime. | |
CGCUDARuntime & | getCUDARuntime () |
Return a reference to the configured CUDA runtime. | |
CGHLSLRuntime & | getHLSLRuntime () |
Return a reference to the configured HLSL runtime. | |
ObjCEntrypoints & | getObjCEntrypoints () const |
InstrProfStats & | getPGOStats () |
llvm::IndexedInstrProfReader * | getPGOReader () const |
CoverageMappingModuleGen * | getCoverageMapping () 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) |
CGDebugInfo * | getModuleDebugInfo () |
llvm::MDNode * | getNoObjCARCExceptionsMetadata () |
ASTContext & | getContext () const |
const LangOptions & | getLangOpts () const |
const IntrusiveRefCntPtr< llvm::vfs::FileSystem > & | getFileSystem () const |
const HeaderSearchOptions & | getHeaderSearchOpts () const |
const PreprocessorOptions & | getPreprocessorOpts () const |
const CodeGenOptions & | getCodeGenOpts () const |
llvm::Module & | getModule () const |
DiagnosticsEngine & | getDiags () const |
const llvm::DataLayout & | getDataLayout () const |
const TargetInfo & | getTarget () const |
const llvm::Triple & | getTriple () const |
bool | supportsCOMDAT () const |
void | maybeSetTrivialComdat (const Decl &D, llvm::GlobalObject &GO) |
const ABIInfo & | getABIInfo () |
CGCXXABI & | getCXXABI () const |
llvm::LLVMContext & | getLLVMContext () |
bool | shouldUseTBAA () const |
const TargetCodeGenInfo & | getTargetCodeGenInfo () |
CodeGenTypes & | getTypes () |
CodeGenVTables & | getVTables () |
ItaniumVTableContext & | getItaniumVTableContext () |
const ItaniumVTableContext & | getItaniumVTableContext () const |
MicrosoftVTableContext & | getMicrosoftVTableContext () |
CtorList & | getGlobalCtors () |
CtorList & | getGlobalDtors () |
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< CGPointerAuthInfo > | getVTablePointerAuthInfo (CodeGenFunction *Context, const CXXRecordDecl *Record, llvm::Value *StorageAddress) |
std::optional< PointerAuthQualifier > | getVTablePointerAuthentication (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, const char *GlobalName=nullptr) |
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 |
SanitizerMetadata * | getSanitizerMetadata () |
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< CharUnits > | getOMPAllocateAlignment (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 () |
![]() | |
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< BlockByrefHelpers > | ByrefHelpersCache |
int | GlobalUniqueCount |
![]() | |
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 |
This class organizes the cross-function state that is used while generating LLVM code.
Definition at line 326 of file CodeGenModule.h.
typedef std::vector<Structor> clang::CodeGen::CodeGenModule::CtorList |
Definition at line 345 of file CodeGenModule.h.
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, clang::CodeGenOptions::CoverageDataFile, clang::CodeGenOptions::CoverageNotesFile, clang::Default, clang::CodeGen::CodeGenTypeCache::DoubleTy, E, clang::DiagnosticsEngine::Error, clang::CodeGen::CodeGenTypeCache::FloatTy, clang::CodeGen::TargetCodeGenInfo::getABIInfo(), clang::CodeGen::TargetCodeGenInfo::getASTAllocaAddressSpace(), clang::ASTContext::getAuxTargetInfo(), clang::DiagnosticsEngine::getCustomDiagID(), getCXXABI(), clang::ASTContext::getDiagnostics(), GetGlobalConstantAddressSpace(), clang::MangleContext::getKind(), getLangOpts(), clang::CodeGen::CGCXXABI::getMangleContext(), getModule(), getTargetCodeGenInfo(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), getTriple(), getTypes(), clang::CodeGen::CodeGenTypeCache::GlobalsInt8PtrTy, clang::CodeGen::CodeGenTypeCache::HalfTy, clang::SanitizerSet::hasOneOf(), clang::CodeGenOptions::hasProfileClangUse(), 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::LangOptions::MacroPrefixMap, clang::MangleContext::MK_Itanium, clang::CodeGenOptions::MSSecureHotPatchFunctionsFile, clang::CodeGenOptions::MSSecureHotPatchFunctionsList, Path, clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, clang::CodeGen::CodeGenTypeCache::PointerWidthInBits, clang::CodeGenOptions::ProfileInstrumentUsePath, clang::CodeGenOptions::ProfileRemappingFile, clang::CodeGen::CodeGenTypeCache::RuntimeCC, clang::LangOptions::Sanitize, clang::CodeGen::CodeGenTypeCache::SizeSizeInBytes, and clang::CodeGen::CodeGenTypeCache::VoidTy.
CodeGenModule::~CodeGenModule | ( | ) |
Definition at line 558 of file CodeGenModule.cpp.
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 clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), and Release().
|
inline |
Add a destructor and object to add to the C++ global destructor function.
Definition at line 1284 of file CodeGenModule.h.
|
inline |
Definition at line 1245 of file CodeGenModule.h.
Referenced by initializeBuffer().
|
inline |
Definition at line 1301 of file CodeGenModule.h.
References Priority.
|
inline |
Add an sterm finalizer to the C++ global cleanup function.
Definition at line 1290 of file CodeGenModule.h.
|
inline |
Add an sterm finalizer to its own llvm.global_dtors entry.
Definition at line 1296 of file CodeGenModule.h.
References AddGlobalDtor(), and Priority.
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 2236 of file CGCall.cpp.
Referenced by clang::CodeGen::addDefaultFunctionDefinitionAttributes(), and clang::CodeGen::TargetCodeGenInfo::createEnqueuedBlockKernel().
void CodeGenModule::AddDeferredUnusedCoverageMapping | ( | Decl * | D | ) |
Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration.
Definition at line 7565 of file CodeGenModule.cpp.
References D, clang::Decl::getBeginLoc(), getContext(), clang::Decl::getKind(), clang::ASTContext::getSourceManager(), LimitedCoverage(), SM, and llvm::coverage::SystemHeadersCoverage.
Referenced by EmitTopLevelDecl().
|
inline |
Definition at line 1542 of file CodeGenModule.h.
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().
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().
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 D, EmitAnnotateAttr(), clang::Decl::getLocation(), clang::Decl::hasAttr(), and clang::Decl::specific_attrs().
Referenced by EmitGlobalAnnotations(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
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.
References Priority.
Referenced by Release().
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(), getTriple(), and Priority.
Referenced by AddCXXStermFinalizerToGlobalDtor(), and clang::CodeGen::CodeGenFunction::registerGlobalDtorWithLLVM().
void CodeGenModule::addGlobalValReplacement | ( | llvm::GlobalValue * | GV, |
llvm::Constant * | C | ||
) |
Definition at line 654 of file CodeGenModule.cpp.
References clang::C.
void CodeGenModule::addReplacement | ( | StringRef | Name, |
llvm::Constant * | C | ||
) |
Definition at line 619 of file CodeGenModule.cpp.
References clang::C.
Referenced by TryEmitBaseDestructorAsAlias().
|
inline |
Definition at line 1763 of file CodeGenModule.h.
References clang::Global.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall().
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.
Referenced by buildGlobalBlock(), clang::CodeGen::CoverageMappingModuleGen::emit(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
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().
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), and SetCommonAttributes().
void CodeGenModule::AddVTableTypeMetadata | ( | llvm::GlobalVariable * | VTable, |
CharUnits | Offset, | ||
const CXXRecordDecl * | RD | ||
) |
Create and attach type metadata for the given vtable.
Definition at line 7961 of file CodeGenModule.cpp.
References CreateCrossDsoCfiTypeId(), CreateMetadataIdentifierForType(), clang::ASTContext::getCanonicalTagType(), getContext(), getLLVMContext(), NeedAllVtablesTypeId(), and clang::T.
Referenced by EmitVTableTypeMetadata().
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 2382 of file CGCall.cpp.
References getLLVMContext().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall().
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 D, getCodeGenOpts(), clang::DeclContext::getParent(), clang::DeclContext::getRedeclContext(), and clang::Decl::hasAttr().
Referenced by clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), and HasHiddenLTOVisibility().
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().
|
inline |
Helper function to construct a TrapReasonBuilder.
Definition at line 1829 of file CodeGenModule.h.
References getDiags().
void CodeGenModule::clear | ( | ) |
Definition at line 854 of file CodeGenModule.cpp.
void CodeGenModule::ClearUnusedCoverageMapping | ( | const Decl * | D | ) |
Remove the deferred empty coverage mapping as this declaration is actually instrumented.
Definition at line 7592 of file CodeGenModule.cpp.
References ClearUnusedCoverageMapping(), and D.
Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters(), and ClearUnusedCoverageMapping().
llvm::Function * CodeGenModule::codegenCXXStructor | ( | GlobalDecl | GD | ) |
Definition at line 203 of file CGCXX.cpp.
References clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::ForDefinition, clang::CodeGen::CodeGenFunction::GenerateCode(), getAddrOfCXXStructor(), clang::GlobalDecl::getDecl(), getTypes(), setFunctionLinkage(), and SetLLVMFunctionAttributesForDefinition().
CharUnits CodeGenModule::computeNonVirtualBaseClassOffset | ( | const CXXRecordDecl * | DerivedClass, |
CastExpr::path_const_iterator | Start, | ||
CastExpr::path_const_iterator | End | ||
) |
Definition at line 168 of file CGClass.cpp.
References clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), getContext(), and clang::CharUnits::Zero().
Referenced by clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), and GetNonVirtualBaseClassOffset().
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.
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:
Definition at line 2410 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, DetermineNoUndef(), clang::CodeGen::ABIArgInfo::Direct, E, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::FunctionType::ExtParameterInfo::getABI(), clang::CodeGen::CGFunctionInfo::getArgStruct(), clang::Type::getAs(), clang::CharUnits::getAsAlign(), 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::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::CharUnits::getQuantity(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::ASTContext::getTypeInfoInChars(), 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::CodeGen::CGFunctionInfo::isChainCall(), clang::CodeGen::CGFunctionInfo::isCmseNSCall(), clang::Type::isConstantSizeType(), clang::QualType::isDestructedType(), clang::Type::isIncompleteType(), clang::CodeGen::CGFunctionInfo::isInstanceMethod(), clang::CodeGenOptions::isLoaderReplaceableFunctionName(), 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 clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitMustTailThunk(), and SetLLVMFunctionAttributes().
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(), createFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenFunction::EmitCall(), and clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck().
void CodeGenModule::createFunctionTypeMetadataForIcall | ( | const FunctionDecl * | FD, |
llvm::Function * | F | ||
) |
Create and attach type metadata to the given function.
Definition at line 3034 of file CodeGenModule.cpp.
References CreateCrossDsoCfiTypeId(), CreateMetadataIdentifierForType(), CreateMetadataIdentifierGeneralized(), clang::ValueDecl::getType(), clang::SanitizerSet::has(), and clang::LangOptions::Sanitize.
Referenced by SetLLVMFunctionAttributesForDefinition().
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 |
||
) |
Definition at line 438 of file CGDeclCXX.cpp.
References getLangOpts(), getModule(), clang::CodeGen::CodeGenTypeCache::getRuntimeCC(), getTarget(), getTargetCodeGenInfo(), isInNoSanitizeList(), Loc, SetInternalFunctionAttributes(), SetLLVMFunctionAttributes(), SetLLVMFunctionAttributesForDefinition(), and clang::CodeGen::TargetCodeGenInfo::setTargetAttributes().
Referenced by clang::CodeGen::CodeGenFunction::createAtExitStub(), createGlobalInitOrCleanupFn(), clang::CodeGen::CodeGenFunction::createTLSAtExitStub(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), and clang::CodeGen::CodeGenFunction::generateDestroyHelper().
llvm::ConstantInt * CodeGenModule::CreateKCFITypeId | ( | QualType | T, |
StringRef | Salt | ||
) |
Generate a KCFI type identifier for T.
Definition at line 2374 of file CodeGenModule.cpp.
References clang::EST_None, GeneralizeFunctionType(), clang::Type::getAs(), getCodeGenOpts(), getContext(), getCXXABI(), clang::ASTContext::getFunctionType(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::MangleContext::mangleCanonicalTypeName(), and clang::T.
Referenced by clang::CodeGen::CodeGenFunction::EmitKCFIOperandBundle(), and setKCFIType().
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 7933 of file CodeGenModule.cpp.
References clang::T.
Referenced by AddVTableTypeMetadata(), createFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), and SetLLVMFunctionAttributesForDefinition().
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 7938 of file CodeGenModule.cpp.
References clang::T.
Referenced by EmitVTableTypeMetadata().
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 7942 of file CodeGenModule.cpp.
References GeneralizeFunctionType(), getContext(), and clang::T.
Referenced by createFunctionTypeMetadataForIcall(), and clang::CodeGen::CodeGenFunction::EmitCall().
llvm::Value * CodeGenModule::createOpenCLIntToSamplerConversion | ( | const Expr * | E, |
CodeGenFunction & | CGF | ||
) |
Definition at line 7987 of file CodeGenModule.cpp.
References clang::C, clang::Call, CreateRuntimeFunction(), E, clang::CodeGen::ConstantEmitter::emitAbstract(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), getOpenCLRuntime(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), clang::Expr::getType(), and clang::QualType::getTypePtr().
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().
Referenced by clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), and clang::CodeGen::CodeGenVTables::GetAddrOfVTT().
llvm::FunctionCallee CodeGenModule::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.
CreateRuntimeFunction - Create a new runtime function with the specified type and name.
If AssumeConvergent
is true, the call will have the convergent attribute added.
For new code, please use the overload that takes a QualType; it sets function attributes more accurately.
Definition at line 5193 of file CodeGenModule.cpp.
References clang::C, clang::CodeGen::CodeGenTypeCache::getRuntimeCC(), setDSOLocal(), and setWindowsItaniumDLLImport().
Referenced by createOpenCLIntToSamplerConversion(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCheckHandlerCall(), emitGlobalDtorWithCXAAtExit(), emitGlobalDtorWithTLRegDtor(), clang::CodeGen::CodeGenFunction::EmitHLSLBuiltinExpr(), emitIsPlatformVersionAtLeast(), EmitMSVCRTSetJmp(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCRelease(), emitObjCValueOperation(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitRISCVCpuInit(), emitRTtypeidCall(), getAllocateExceptionFn(), getBadCastFn(), getBadTypeidFn(), getBeginCatchFn(), getBlockObjectAssign(), getBlockObjectDispose(), getCatchallRethrowFn(), getClangCallTerminateFn(), getDynTlsOnDemandInitFn(), getEndCatchFn(), getFreeExceptionFn(), getGetExceptionPtrFn(), getGuardAbortFn(), getGuardAcquireFn(), getGuardReleaseFn(), getInitThreadAbortFn(), getInitThreadFooterFn(), getInitThreadHeaderFn(), getItaniumDynamicCastFn(), getPersonalityFn(), getSehTryBeginFn(), getSehTryEndFn(), getTerminateFn(), getThrowFn(), getUnexpectedFn(), clang::CodeGen::CodeGenFunction::registerGlobalDtorWithAtExit(), and clang::CodeGen::CodeGenFunction::unregisterGlobalDtorWithUnAtExit().
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::CanQual< T >::castAs(), clang::ASTContext::getCanonicalType(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::ASTContext::getFunctionType(), clang::CodeGen::CodeGenTypeCache::getRuntimeCC(), getTypes(), setDSOLocal(), SetLLVMFunctionAttributes(), and setWindowsItaniumDLLImport().
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::Default, getContext(), clang::ASTContext::getLangOpts(), GetOrCreateLLVMGlobal(), clang::opencl_global, and setDSOLocal().
Referenced by emitGlobalDtorWithCXAAtExit(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitRISCVCpuIs(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), GetAddrOfConstantCFString(), getTlsGuardVar(), and loadRISCVFeatureBits().
Address CodeGenModule::createUnnamedGlobalFrom | ( | const VarDecl & | D, |
llvm::Constant * | Constant, | ||
CharUnits | Align | ||
) |
Definition at line 1130 of file CGDecl.cpp.
References D, clang::CharUnits::getAsAlign(), getContext(), GetGlobalConstantAddressSpace(), getMangledName(), getModule(), clang::Decl::getParentFunctionOrMethod(), clang::CharUnits::getQuantity(), and clang::ASTContext::getTargetAddressSpace().
Referenced by createUnnamedGlobalForMemcpyFrom(), and clang::CodeGen::CodeGenFunction::EmitDeclRefLValue().
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().
Referenced by clang::CodeGen::CodeGenFunction::GetVTablePtr(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointer().
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 clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitAtomicStore(), emitLibraryCall(), clang::CodeGen::CodeGenFunction::EmitLoadOfReference(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedLoad(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedStore(), clang::CodeGen::CodeGenFunction::GetVTablePtr(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointer().
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().
llvm::Constant * CodeGenModule::EmitAnnotationArgs | ( | const AnnotateAttr * | Attr | ) |
Emit additional args of the annotation.
Definition at line 3617 of file CodeGenModule.cpp.
References AnnotationSection, clang::CodeGen::CodeGenTypeCache::ConstGlobalsPtrTy, E, clang::CodeGen::ConstantEmitter::emitAbstract(), getModule(), and clang::Struct.
Referenced by EmitAnnotateAttr(), and clang::CodeGen::CodeGenFunction::EmitAnnotationCall().
llvm::Constant * CodeGenModule::EmitAnnotationLineNo | ( | SourceLocation | L | ) |
Emit the annotation line number.
Definition at line 3609 of file CodeGenModule.cpp.
References getContext(), clang::PresumedLoc::getLine(), clang::ASTContext::getSourceManager(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::PresumedLoc::isValid(), and SM.
Referenced by EmitAnnotateAttr(), and clang::CodeGen::CodeGenFunction::EmitAnnotationCall().
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(), clang::CodeGen::CodeGenFunction::EmitAnnotationCall(), and EmitAnnotationUnit().
llvm::Constant * CodeGenModule::EmitAnnotationUnit | ( | SourceLocation | Loc | ) |
Emit the annotation's translation unit.
Definition at line 3601 of file CodeGenModule.cpp.
References EmitAnnotationString(), getContext(), clang::PresumedLoc::getFilename(), clang::ASTContext::getSourceManager(), clang::PresumedLoc::isValid(), Loc, and SM.
Referenced by EmitAnnotateAttr(), and clang::CodeGen::CodeGenFunction::EmitAnnotationCall().
void CodeGenModule::EmitDeferredUnusedCoverageMappings | ( | ) |
Emit all the deferred coverage mappings for the uninstrumented functions.
Definition at line 7603 of file CodeGenModule.cpp.
References clang::Ctor_Base, D, clang::Dtor_Base, clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping(), getFunctionLinkage(), clang::Decl::getKind(), and getMangledName().
Referenced by Release().
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 E, clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), getModuleDebugInfo(), clang::Expr::getType(), and clang::Type::isVariablyModifiedType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), and EmitPointerWithAlignment().
void CodeGenModule::EmitExternalDeclaration | ( | const DeclaratorDecl * | D | ) |
Definition at line 5561 of file CodeGenModule.cpp.
References clang::Addr, D, clang::CodeGen::CGDebugInfo::EmitExternalVariable(), clang::CodeGen::CGDebugInfo::EmitFunctionDecl(), GetAddrOfGlobal(), getBaseVariantGlobalDecl(), getCodeGenOpts(), clang::Decl::getLocation(), getModuleDebugInfo(), and clang::ValueDecl::getType().
void CodeGenModule::EmitGlobal | ( | GlobalDecl | D | ) |
Emit code for a single global function or var decl.
Forward declarations are emitted lazily.
Definition at line 4031 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), clang::CPlusPlus, clang::VarDecl::Definition, clang::FunctionDecl::doesDeclarationForceExternallyVisibleDefinition(), clang::FunctionDecl::doesThisDeclarationHaveABody(), EmitOMPDeclareMapper(), EmitOMPDeclareReduction(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfGlobalVar(), clang::Decl::getAttr(), getContext(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), clang::ASTContext::getInlineVariableDefinitionKind(), getLangOpts(), getMangledName(), getOpenMPRuntime(), getTarget(), getTriple(), getTypes(), clang::Global, clang::Decl::hasAttr(), clang::CodeGen::CGOpenMPRuntime::hasRequiresUnifiedSharedMemory(), clang::FunctionDecl::isConstexpr(), clang::isLambdaCallOperator(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), clang::FunctionDecl::isMultiVersion(), clang::ASTContext::Strong, and clang::Stub.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitDeferredTargetDecls(), and EmitTopLevelDecl().
void CodeGenModule::EmitGlobalAnnotations | ( | ) |
Emit all the global annotations.
Definition at line 3564 of file CodeGenModule.cpp.
References AddGlobalAnnotations(), AnnotationSection, GetGlobalValue(), and getModule().
Referenced by Release().
void CodeGenModule::EmitMainVoidAlias | ( | ) |
Emit an alias for "main" if it has no arguments (needed for wasm).
Definition at line 7643 of file CodeGenModule.cpp.
References clang::TargetInfo::getIntWidth(), getModule(), and clang::ASTContext::getTargetInfo().
Referenced by Release().
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::Type::castAs(), clang::CodeGen::ConstantEmitter::emitNullForMemory(), clang::CodeGen::CGCXXABI::EmitNullMemberPointer(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::Type::getAsRecordDecl(), getCXXABI(), clang::ArrayType::getElementType(), getNullPointer(), getTypes(), clang::ConstantArrayType::getZExtSize(), clang::Type::isMemberDataPointerType(), and clang::T.
Referenced by clang::CodeGen::ConstantEmitter::emitAbstract(), emitInitWithReductionInitializer(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitNullConstant(), clang::CodeGen::ConstantEmitter::emitNullForMemory(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), getOrCreateStaticVarDecl(), and clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit().
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().
void CodeGenModule::EmitOMPAllocateDecl | ( | const OMPAllocateDecl * | D | ) |
Emit a code for the allocate directive.
D | The allocate declaration |
Definition at line 2894 of file CGDecl.cpp.
References D, E, getContext(), GetGlobalValue(), GetGlobalVarAddressSpace(), getLLVMContext(), getMangledName(), getModule(), and clang::ASTContext::getTargetAddressSpace().
Referenced by EmitTopLevelDecl().
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 D, clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), getOpenMPRuntime(), and clang::Decl::isUsed().
Referenced by clang::CodeGen::CodeGenFunction::EmitDecl(), EmitGlobal(), and EmitTopLevelDecl().
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 D, clang::CodeGen::CGOpenMPRuntime::emitUserDefinedReduction(), getOpenMPRuntime(), and clang::Decl::isUsed().
Referenced by clang::CodeGen::CodeGenFunction::EmitDecl(), EmitGlobal(), and EmitTopLevelDecl().
void CodeGenModule::EmitOMPRequiresDecl | ( | const OMPRequiresDecl * | D | ) |
Emit a code for requires directive.
D | Requires declaration |
Definition at line 2890 of file CGDecl.cpp.
References D, getOpenMPRuntime(), and clang::CodeGen::CGOpenMPRuntime::processRequiresDirective().
Referenced by EmitTopLevelDecl().
void CodeGenModule::EmitOMPThreadPrivateDecl | ( | const OMPThreadPrivateDecl * | D | ) |
Emit a code for threadprivate directive.
D | Threadprivate declaration. |
Definition at line 7881 of file CodeGenModule.cpp.
References clang::Addr, D, GetAddrOfGlobalVar(), getContext(), getOpenMPRuntime(), clang::ValueDecl::getType(), and getTypes().
Referenced by EmitTopLevelDecl().
void CodeGenModule::EmitOpenACCDeclare | ( | const OpenACCDeclareDecl * | D, |
CodeGenFunction * | CGF = nullptr |
||
) |
Definition at line 2880 of file CGDecl.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitDecl(), and EmitTopLevelDecl().
void CodeGenModule::EmitOpenACCRoutine | ( | const OpenACCRoutineDecl * | D, |
CodeGenFunction * | CGF = nullptr |
||
) |
Definition at line 2885 of file CGDecl.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitDecl(), and EmitTopLevelDecl().
CGPointerAuthInfo clang::CodeGen::CodeGenModule::EmitPointerAuthInfo | ( | const RecordDecl * | RD | ) |
void CodeGenModule::EmitTentativeDefinition | ( | const VarDecl * | D | ) |
Definition at line 5529 of file CodeGenModule.cpp.
References D, GetGlobalValue(), and getMangledName().
void CodeGenModule::EmitTopLevelDecl | ( | Decl * | D | ) |
Emit code for a single top level declaration.
EmitTopLevelDecl - Emit code for a single top level declaration.
Definition at line 7248 of file CodeGenModule.cpp.
References clang::CodeGen::CGHLSLRuntime::addBuffer(), AddDeferredUnusedCoverageMapping(), AddDependentLib(), AddDetectMismatch(), AppendLinkerOptions(), D, clang::DeclContext::decls(), clang::ExternalASTSource::EK_Never, clang::CodeGen::CGCXXABI::EmitCXXConstructors(), clang::CodeGen::CGCXXABI::EmitCXXDestructors(), EmitGlobal(), EmitOMPAllocateDecl(), EmitOMPDeclareMapper(), EmitOMPDeclareReduction(), EmitOMPRequiresDecl(), EmitOMPThreadPrivateDecl(), EmitOpenACCDeclare(), EmitOpenACCRoutine(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), clang::Decl::getASTContext(), getCodeGenOpts(), getContext(), getCXXABI(), getDefinition(), clang::ASTContext::getExternalSource(), getHLSLRuntime(), clang::Decl::getKind(), getModule(), getModuleDebugInfo(), clang::ASTContext::getModuleInitializers(), clang::CXXRecordDecl::hasDefinition(), clang::FunctionDecl::isImmediateFunction(), clang::Decl::isTemplated(), clang::None, clang::PCK_Compiler, clang::PCK_ExeStr, clang::PCK_Lib, clang::PCK_Linker, clang::PCK_Unknown, clang::PCK_User, clang::Module::submodules(), clang::TSK_ExplicitInstantiationDefinition, and Visited.
Referenced by EmitTopLevelDecl(), and HandleCXXStaticMemberVarInstantiation().
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.
References clang::CodeGen::CodeGenVTables::GenerateClassData().
void CodeGenModule::EmitVTableTypeMetadata | ( | const CXXRecordDecl * | RD, |
llvm::GlobalVariable * | VTable, | ||
const VTableLayout & | VTLayout | ||
) |
Emit type metadata for the given vtable using the given layout.
Definition at line 1358 of file CGVTables.cpp.
References AddVTableTypeMetadata(), clang::VTableComponent::CK_FunctionPointer, CreateMetadataIdentifierForVirtualMemPtrType(), D, clang::VTableLayout::getAddressPoints(), clang::ASTContext::getCanonicalTagType(), getCodeGenOpts(), getContext(), getCXXABI(), getKind(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::ASTContext::getMemberPointerType(), GetTargetTypeStoreSize(), GetVCallVisibilityLevel(), getVTableComponentType(), clang::VTableLayout::getVTableOffset(), clang::MangleContext::mangleCanonicalTypeName(), clang::operator<(), clang::T, clang::TypeName, Visited, and clang::VTableLayout::vtable_components().
Referenced by clang::CodeGen::CodeGenVTables::GenerateConstructionVTable().
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(), clang::ASTContext::getFullLoc(), and clang::DiagnosticsEngine::Report().
Referenced by clang::CodeGen::CodeGenFunction::AddAMDGPUFenceAddressSpaceMMRA(), createCoroData(), clang::CodeGen::ConstantEmitter::emitAbstract(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), clang::CodeGen::CodeGenFunction::EmitBPFBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCoroutineIntrinsic(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), and clang::CodeGen::CGOpenMPRuntimeGPU::processRequiresDirective().
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 D, clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getFullLoc(), clang::Decl::getLocation(), clang::DiagnosticsEngine::Report(), and clang::CodeGen::Type.
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::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getFullLoc(), clang::DiagnosticsEngine::Report(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), AddVariableConstraints(), clang::CodeGen::CodeGenFunction::EmitAMDGPUDevicePrintfCallExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCapturedLocals(), clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaCallOpBody(), clang::CodeGen::CodeGenFunction::EmitLambdaStaticInvokeBody(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitStmt(), clang::CodeGen::CodeGenFunction::ErrorUnsupported(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), and GetAddrOfTemplateParamObject().
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().
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.
FN | is a pointer to IR function being generated. |
FD | is a pointer to function declaration if any. |
CGF | is 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::QualType::getAddressSpace(), clang::Type::getAs(), clang::Decl::getAttr(), clang::QualType::getCanonicalType(), getCodeGenOpts(), getLangOpts(), clang::NamedDecl::getName(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::ASTContext::getPrintingPolicy(), clang::ValueDecl::getType(), clang::QualType::isConstQualified(), clang::Type::isImageType(), clang::Type::isPipeType(), clang::Type::isPointerType(), clang::QualType::isRestrictQualified(), clang::QualType::isVolatileQualified(), clang::OpenCL, clang::opencl_constant, clang::opencl_global, and removeImageAccessQualifier().
const ABIInfo & CodeGenModule::getABIInfo | ( | ) |
Definition at line 5736 of file CodeGenModule.cpp.
References clang::CodeGen::TargetCodeGenInfo::getABIInfo(), and getTargetCodeGenInfo().
Referenced by clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitVAArg(), and isTrivialForMSVC().
llvm::FunctionCallee CodeGenModule::getAddrAndTypeOfCXXStructor | ( | GlobalDecl | GD, |
const CGFunctionInfo * | FnInfo = nullptr , |
||
llvm::FunctionType * | FnType = nullptr , |
||
bool | DontDefer = false , |
||
ForDefinition_t | IsForDefinition = NotForDefinition |
||
) |
Definition at line 217 of file CGCXX.cpp.
References clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::Dtor_Base, clang::Dtor_Complete, getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getMangledName(), getTarget(), getTypes(), and clang::GlobalDecl::getWithDtorType().
Referenced by EmitDeclDestroy(), getAddrOfCXXStructor(), and pushTemporaryCleanup().
ConstantAddress CodeGenModule::GetAddrOfConstantCFString | ( | const StringLiteral * | Literal | ) |
Return a pointer to a constant CFString object for the given string.
Definition at line 6577 of file CodeGenModule.cpp.
References clang::C, clang::TranslationUnitDecl::castToDeclContext(), clang::LangOptions::CFRuntime, clang::ASTContext::CharTy, clang::CodeGen::CodeGenTypes::ConvertType(), CreateRuntimeVariable(), clang::CharUnits::fromQuantity(), clang::IdentifierTable::get(), clang::CharUnits::getAsAlign(), clang::ASTContext::getCFConstantStringType(), getCodeGenOpts(), GetConstantCFStringEntry(), getContext(), getDataLayout(), getLangOpts(), clang::TargetInfo::getLongWidth(), getModule(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTranslationUnitDecl(), getTriple(), clang::ASTContext::getTypeAlignInChars(), getTypes(), clang::Decl::hasAttr(), clang::ASTContext::Idents, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::CodeGen::CodeGenTypeCache::IntTy, clang::DeclContext::lookup(), clang::Result, setDSOLocal(), clang::ASTContext::ShortTy, clang::LangOptionsBase::Swift, clang::LangOptionsBase::Swift4_1, clang::LangOptionsBase::Swift4_2, clang::LangOptionsBase::Swift5_0, and clang::ASTContext::toCharUnitsFromBits().
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 E.
Referenced by clang::CodeGen::CodeGenFunction::EmitCompoundLiteralLValue().
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.
References E.
ConstantAddress CodeGenModule::GetAddrOfConstantCString | ( | const std::string & | Str, |
const char * | GlobalName = nullptr |
||
) |
Returns a pointer to a character array containing the literal and a terminating '\0' character.
GetAddrOfConstantCString - Returns a pointer to a character array containing the literal and a terminating '\0' character.
The result has pointer to array type.
GlobalName | If provided, the name to use for the global (if one is created). |
The result has pointer to array type.
Definition at line 6929 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(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitPredefinedLValue(), and GetAddrOfConstantStringFromObjCEncode().
ConstantAddress CodeGenModule::GetAddrOfConstantStringFromLiteral | ( | const StringLiteral * | S, |
StringRef | Name = ".str" |
||
) |
Return a pointer to a constant array for the given string literal.
GetAddrOfConstantStringFromLiteral - Return a pointer to a constant array for the given string literal.
Definition at line 6866 of file CodeGenModule.cpp.
References clang::CodeGen::CGDebugInfo::AddStringLiteralDebugInfo(), clang::C, castStringLiteralToDefaultAddressSpace(), GenerateStringLiteral(), clang::ASTContext::getAlignOfGlobalVarInChars(), clang::CharUnits::getAsAlign(), getCodeGenOpts(), GetConstantArrayFromStringLiteral(), getContext(), getCXXABI(), clang::CodeGen::CGCXXABI::getMangleContext(), getModuleDebugInfo(), clang::CharUnits::getQuantity(), LT, and clang::MangleContext::mangleStringLiteral().
Referenced by clang::CodeGen::CodeGenFunction::EmitPredefinedLValue(), and clang::CodeGen::CodeGenFunction::EmitStringLiteralLValue().
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 6919 of file CodeGenModule.cpp.
References E, GetAddrOfConstantCString(), getContext(), and clang::ASTContext::getObjCEncodingForType().
Referenced by clang::CodeGen::CodeGenFunction::EmitObjCEncodeExprLValue().
|
inline |
Return the address of the constructor/destructor of the given type.
Definition at line 1223 of file CodeGenModule.h.
References getAddrAndTypeOfCXXStructor(), and clang::ast_matchers::getCallee().
Referenced by codegenCXXStructor(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), and GetAddrOfGlobal().
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::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 clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), EmitNewDeleteCall(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfGlobal(), GetFunctionStart(), and getRawFunctionPointer().
llvm::Constant * CodeGenModule::GetAddrOfGlobal | ( | GlobalDecl | GD, |
ForDefinition_t | IsForDefinition = NotForDefinition |
||
) |
Definition at line 5432 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(), clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), D, getAddrOfCXXStructor(), GetAddrOfFunction(), GetAddrOfGlobalVar(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenTypes::GetFunctionType(), and getTypes().
Referenced by emitConstructorDestructorAlias(), EmitExternalDeclaration(), clang::CodeGen::CodeGenFunction::EmitOMPCopyinClause(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), getOrCreateStaticVarDecl(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), Release(), and TryEmitBaseDestructorAsAlias().
llvm::Constant * CodeGenModule::GetAddrOfGlobalBlock | ( | const BlockExpr * | BE, |
StringRef | Name | ||
) |
Gets the address of a block which requires no captures.
Definition at line 1283 of file CGBlocks.cpp.
References clang::CodeGen::CGBlockInfo::BlockExpression, computeBlockInfo(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), getAddrOfGlobalBlockIfEmitted(), and clang::BlockExpr::getBlockDecl().
|
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(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), and GetAddrOfGlobalBlock().
ConstantAddress CodeGenModule::GetAddrOfGlobalTemporary | ( | const MaterializeTemporaryExpr * | E, |
const Expr * | Inner | ||
) |
Returns a pointer to a global variable representing a temporary with static or thread storage duration.
Definition at line 6963 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::Default, E, clang::CharUnits::getAsAlign(), getContext(), getCXXABI(), GetGlobalVarAddressSpace(), clang::Decl::getLexicalDeclContext(), getLLVMContext(), getLLVMLinkageVarDefinition(), clang::CodeGen::CGCXXABI::getMangleContext(), getModule(), clang::ASTContext::getTargetAddressSpace(), getTargetCodeGenInfo(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), getTypes(), clang::Expr::EvalStatus::hasSideEffects(), clang::Init, clang::QualType::isConstantStorage(), clang::MangleContext::mangleReferenceTemporary(), clang::CodeGen::TargetCodeGenInfo::performAddrSpaceCast(), clang::SD_Static, clang::SD_Thread, setGVProperties(), setTLSMode(), supportsCOMDAT(), clang::CodeGen::Type, and clang::Expr::EvalResult::Val.
Referenced by createReferenceTemporary().
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(), D, clang::QualType::getAddressSpace(), getMangledName(), GetOrCreateLLVMGlobal(), and getTypes().
Referenced by EmitGlobal(), EmitGlobalVarDeclLValue(), EmitOMPThreadPrivateDecl(), GetAddrOfGlobal(), GetOrCreateLLVMGlobal(), and HandleCXXStaticMemberVarInstantiation().
ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl | ( | const MSGuidDecl * | GD | ) |
Get the address of a GUID.
Definition at line 3869 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::CharUnits::fromQuantity(), clang::QualType::getAddressSpace(), clang::MSGuidDecl::getAsAPValue(), getMangledName(), getModule(), clang::MSGuidDecl::getParts(), clang::ValueDecl::getType(), getTypes(), clang::Init, clang::CodeGen::CodeGenTypeCache::Int16Ty, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::MSGuidDeclParts::Part1, clang::MSGuidDeclParts::Part2, clang::MSGuidDeclParts::Part3, clang::MSGuidDeclParts::Part4And5, clang::CodeGen::CodeGenTypeCache::PointerAlignInBytes, setDSOLocal(), supportsCOMDAT(), and V.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXUuidofExpr(), and clang::CodeGen::CodeGenFunction::EmitDeclRefLValue().
Get the address of the RTTI descriptor for the given type.
Definition at line 7866 of file CodeGenModule.cpp.
References clang::CodeGen::CGCXXABI::getAddrOfRTTIDescriptor(), getCXXABI(), clang::CodeGen::CodeGenTypeCache::GlobalsInt8PtrTy, clang::ObjCRuntime::isGNUFamily(), clang::Type::isObjCObjectPointerType(), clang::LangOptions::ObjCRuntime, and shouldEmitRTTI().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXTypeidExpr(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), and clang::CodeGen::CodeGenVTables::GenerateConstructionVTable().
ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject | ( | const TemplateParamObjectDecl * | TPO | ) |
Get the address of a template parameter object.
Definition at line 3951 of file CodeGenModule.cpp.
References ErrorUnsupported(), clang::QualType::getAddressSpace(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), getMangledName(), getModule(), getNaturalTypeAlignment(), clang::ValueDecl::getType(), clang::TemplateParamObjectDecl::getValue(), clang::Init, clang::CodeGen::ConstantAddress::invalid(), clang::isExternallyVisible(), setGVProperties(), and supportsCOMDAT().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue().
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.
ConstantAddress CodeGenModule::GetAddrOfUnnamedGlobalConstantDecl | ( | const UnnamedGlobalConstantDecl * | GCD | ) |
Get the address of a UnnamedGlobalConstant.
Definition at line 3920 of file CodeGenModule.cpp.
References clang::QualType::getAddressSpace(), clang::CharUnits::getAsAlign(), getContext(), getModule(), clang::ValueDecl::getType(), clang::ASTContext::getTypeAlignInChars(), clang::UnnamedGlobalConstantDecl::getValue(), clang::Init, and V.
|
inline |
Definition at line 798 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction().
|
inline |
Get the current Atomic options.
Definition at line 703 of file CodeGenModule.h.
|
inline |
Definition at line 790 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction().
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().
StringRef CodeGenModule::getBlockMangledName | ( | GlobalDecl | GD, |
const BlockDecl * | BD | ||
) |
Definition at line 2212 of file CodeGenModule.cpp.
References D, clang::GlobalDecl::getCtorType(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::MangleContext::mangleBlock(), clang::MangleContext::mangleCtorBlock(), clang::MangleContext::mangleDtorBlock(), clang::MangleContext::mangleGlobalBlock(), and clang::Result.
Referenced by clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), and getStaticDeclName().
llvm::FunctionCallee CodeGenModule::getBlockObjectAssign | ( | ) |
Definition at line 2938 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), CreateRuntimeFunction(), clang::ASTContext::IntTy, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction().
llvm::FunctionCallee CodeGenModule::getBlockObjectDispose | ( | ) |
Definition at line 2926 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), CreateRuntimeFunction(), clang::ASTContext::IntTy, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by clang::CodeGen::CodeGenFunction::BuildBlockRelease().
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::ASTContext::BuiltinInfo, D, getMangledName(), clang::Builtin::Context::getName(), getTarget(), getTriple(), clang::ValueDecl::getType(), getTypes(), clang::Decl::hasAttr(), and clang::Builtin::Context::isLibFunction().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
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 clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), getNaturalTypeAlignment(), InitCatchParam(), clang::CodeGen::CodeGenFunction::LoadCXXThisAddress(), and PerformReturnAdjustment().
|
inline |
Definition at line 830 of file CodeGenModule.h.
Referenced by clang::CodeGen::CoverageMappingModuleGen::addFunctionMappingRecord(), clang::CodeGen::CGDebugInfo::addHeapAllocSiteMetadata(), clang::CodeGen::CGDebugInfo::addInstToSpecificSourceAtom(), clang::CodeGen::TargetCodeGenInfo::addStackProbeTargetAttributes(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayCustomEvents(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayTypedEvents(), AlwaysHasLTOVisibilityPublic(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), BuildAppleKextVirtualCall(), buildBlockDescriptor(), buildGlobalBlock(), clang::CodeGen::CodeGenFunction::checkIfFunctionMustProgress(), clang::CodeGen::CodeGenFunction::checkIfLoopMustProgress(), configureBlocksRuntimeObject(), clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), ConstructAttributeList(), clang::CodeGen::CGCXXABI::constructorsAndDestructorsReturnThis(), CreateKCFITypeId(), clang::CodeGen::createPPC32TargetCodeGenInfo(), createReferenceTemporary(), createTargetCodeGenInfo(), clang::CodeGen::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CGDebugInfo::EmitAndRetainType(), clang::CodeGen::CodeGenFunction::EmitARCDestroyStrong(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitBlockWithFallThrough(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitBranchToCounterBlock(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::emitBuiltinOSLogFormat(), clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCaseStmt(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), emitCheckHandlerCall(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), emitCombinerOrInitializer(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CodeGen::CGDebugInfo::EmitDeclareOfArgVariable(), clang::CodeGen::CGDebugInfo::EmitDeclareOfAutoVariable(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDeclRefExprDbgValue(), clang::CodeGen::CodeGenFunction::EmitDestructorBody(), clang::CodeGen::CodeGenFunction::EmitDoStmt(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), clang::CodeGen::CGDebugInfo::EmitExplicitCastType(), EmitExternalDeclaration(), clang::CodeGen::CGDebugInfo::EmitExternalVariable(), clang::CodeGen::CodeGenFunction::EmitForStmt(), clang::CodeGen::CGDebugInfo::EmitFunctionDecl(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CGDebugInfo::emitFunctionStart(), clang::CodeGen::CGDebugInfo::EmitGlobalAlias(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CodeGenFunction::EmitIfStmt(), clang::CodeGen::CGDebugInfo::EmitImportDecl(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CodeGen::CGDebugInfo::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfReference(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CGDebugInfo::EmitNamespaceAlias(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), EmitObjectDelete(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), emitOptimizedARCReturnCall(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CGDebugInfo::EmitPseudoVariable(), clang::CodeGen::CodeGenFunction::EmitSanitizerStatReport(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::CodeGenFunction::EmitSwitchStmt(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), emitTaskPrivateMappingFunction(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CGDebugInfo::EmitUsingDecl(), clang::CodeGen::CGDebugInfo::EmitUsingDirective(), clang::CodeGen::CGDebugInfo::EmitUsingEnumDecl(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CGDebugInfo::emitVTableSymbol(), EmitVTableTypeMetadata(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), clang::CodeGen::CodeGenFunction::EmitWhileStmt(), emitWritebackArg(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), clang::CodeGen::CGDebugInfo::finalize(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::generateBuiltinOSLogHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), GenKernelArgMetadata(), genMapInfo(), clang::CodeGen::EHPersonality::get(), GetAddrOfConstantCFString(), GetAddrOfConstantStringFromLiteral(), clang::CodeGen::CodeGenFunction::getARCCleanupKind(), getBlockDescriptorName(), clang::CodeGen::CodeGenTypes::getCodeGenOpts(), getCodegenToUse(), getCopyDestroyHelperFuncName(), getFunctionPointerAuthInfo(), getMangledNameImpl(), getMemberFunctionPointerAuthInfo(), clang::CodeGen::CGDebugInfo::getOrCreateRecordType(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::CodeGen::CodeGenFunction::GetVTablePtr(), clang::CodeGen::CodeGenFunction::incrementProfileCounter(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), isFunctionBlockedByProfileList(), isFunctionBlockedFromProfileInstr(), clang::CodeGen::CodeGenFunction::isMCDCCoverageEnabled(), clang::CodeGen::CodeGenFunction::maybeAttachRangeForLoad(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), needsTypeIdentifier(), Release(), clang::CodeGen::CGDebugInfo::remapDIPath(), requiresMemberFunctionPointerTypeMetadata(), clang::CodeGen::CodeGenFunction::SanitizerAnnotateDebugInfo(), clang::CodeGen::CodeGenFunction::setBlockContextParameter(), clang::CodeGen::CodeGenFunction::SetDivFPAccuracy(), clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes(), clang::CodeGen::CodeGenPGO::setProfileVersion(), clang::CodeGen::CodeGenFunction::SetSqrtFPAccuracy(), clang::CodeGen::CodeGenPGO::setValueProfilingFlag(), setWindowsItaniumDLLImport(), shouldAssumeDSOLocal(), shouldEmitAvailableExternallyVTable(), shouldEmitVTableThunk(), clang::CodeGen::CodeGenFunction::ShouldEmitVTableTypeCheckedLoad(), clang::CodeGen::CodeGenFunction::ShouldInstrumentFunction(), shouldSplitConstantStore(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), clang::CodeGen::CodeGenFunction::ShouldXRayInstrumentFunction(), clang::CodeGen::CodeGenFunction::StartFunction(), TryEmitBaseDestructorAsAlias(), TypeRequiresBuiltinLaunder(), and clang::CodeGen::CodeGenPGO::valueProfile().
llvm::Constant * CodeGenModule::GetConstantArrayFromStringLiteral | ( | const StringLiteral * | E | ) |
Return a constant array for the given string.
Definition at line 6800 of file CodeGenModule.cpp.
References E, clang::ASTContext::getAsConstantArrayType(), clang::Expr::getType(), getTypes(), clang::ConstantArrayType::getZExtSize(), and clang::Type::isPointerType().
Referenced by GetAddrOfConstantStringFromLiteral().
llvm::Constant * CodeGenModule::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.
Definition at line 457 of file CGPointerAuth.cpp.
References getConstantSignedPointer(), clang::PointerAuthSchema::getKey(), getPointerAuthOtherDiscriminator(), Pointer, and shouldSignPointer().
Referenced by clang::CodeGen::ConstantAggregateBuilderBase::addSignedPointer(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), clang::CodeGen::getConstantSignedPointer(), getConstantSignedPointer(), getFunctionPointer(), getMemberFunctionPointer(), pointerAuthResignConstant(), and clang::CodeGen::ConstantEmitter::tryEmitConstantSignedPointer().
llvm::Constant * CodeGenModule::getConstantSignedPointer | ( | llvm::Constant * | Pointer, |
unsigned | Key, | ||
llvm::Constant * | StorageAddress, | ||
llvm::ConstantInt * | OtherDiscriminator | ||
) |
Definition at line 424 of file CGPointerAuth.cpp.
References clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int64Ty, Pointer, and clang::CodeGen::CodeGenTypeCache::UnqualPtrTy.
|
inline |
Definition at line 821 of file CodeGenModule.h.
Referenced by AddDeferredUnusedCoverageMapping(), AddGlobalDtor(), clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::CGDebugInfo::AddStringLiteralDebugInfo(), clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), AddVTableTypeMetadata(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), buildBlockDescriptor(), buildByrefHelpers(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), buildGlobalBlock(), clang::CodeGen::CGCXXABI::buildThisParam(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), classifyType(), clang::CodeGen::CGDebugInfo::completeClass(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CodeGen::CGDebugInfo::completeType(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), clang::CodeGen::CGObjCRuntime::ComputeBitfieldBitOffset(), computeBlockInfo(), clang::CodeGen::CGObjCRuntime::ComputeIvarBaseOffset(), computeNonVirtualBaseClassOffset(), configureBlocksRuntimeObject(), ConstructAttributeList(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenFunction::createAtExitStub(), createCXXABI(), clang::CodeGen::CreateItaniumCXXABI(), CreateKCFITypeId(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), CreateMetadataIdentifierGeneralized(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), createPrivatesRecordDecl(), CreateRuntimeVariable(), clang::CodeGen::CodeGenFunction::createTLSAtExitStub(), createUnnamedGlobalFrom(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), EmitAnnotationLineNo(), EmitAnnotationUnit(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitArraySectionExpr(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCoroutineBody(), clang::CodeGen::CodeGenFunction::EmitCountedByBoundsChecking(), clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), EmitDeclDestroy(), clang::CodeGen::CGOpenMPRuntime::emitDependClause(), emitDependData(), clang::CodeGen::CGOpenMPRuntime::emitDepobjDependClause(), clang::CodeGen::CGOpenMPRuntime::emitDestroyClause(), emitDestructorsFunction(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), EmitDoacrossOrdered(), clang::CodeGen::CodeGenFunction::EmitDoStmt(), clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping(), clang::CodeGen::CGDebugInfo::EmitExternalVariable(), clang::CodeGen::ConstantEmitter::emitForMemory(), clang::CodeGen::CodeGenFunction::EmitForStmt(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGlobal(), emitGlobalDtorWithCXAAtExit(), EmitGlobalNamedRegister(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CodeGenFunction::EmitHLSLBuiltinExpr(), clang::CodeGen::CGOpenMPRuntime::emitKmpRoutineEntryT(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalInit(), clang::CodeGen::CGCXXABI::EmitMemberFunctionPointer(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), EmitOMPAllocateDecl(), clang::CodeGen::CodeGenFunction::EmitOMPInnerLoop(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReduction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitReduction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), emitRestoreIP(), clang::CodeGen::CodeGenFunction::EmitScalarRangeCheck(), clang::CodeGen::CGOpenMPRuntime::emitSingleRegion(), clang::CodeGen::CGOpenMPRuntime::emitTargetNumIterationsCall(), emitTaskDupFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFixups(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateClause(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CGDebugInfo::emitVTableSymbol(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), EmitVTableTypeMetadata(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), clang::CodeGen::CodeGenFunction::EmitWhileStmt(), clang::CodeGen::CodeGenFunction::EnterCXXTryStmt(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), GenerateStringLiteral(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(), GetAddrOfConstantCFString(), GetAddrOfConstantCString(), GetAddrOfConstantStringFromLiteral(), GetAddrOfConstantStringFromObjCEncode(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfGlobalTemporary(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), GetAddrOfUnnamedGlobalConstantDecl(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), getAsmSrcLocInfo(), getBlockCaptureStr(), getBlockDescriptorName(), getBlockDescriptorType(), getClangCallTerminateFn(), getClassPointerAlignment(), clang::CodeGen::CGCXXABI::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::GetCountedByFieldExprGEP(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), clang::CodeGen::CGOpenMPRuntime::getDepobjElements(), getDynamicOffsetAlignment(), getEntryInfoFromPresumedLoc(), getEnumInfo(), getFunctionLinkage(), clang::CodeGen::CGDebugInfo::getFunctionType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAcquireFn(), getInstrProfSection(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), 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(), clang::CodeGen::CGOpenMPRuntime::getOrCreateThreadPrivateCache(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), getPointerAuthInfoForType(), getPointerAuthOtherDiscriminator(), clang::CodeGen::getPointerAuthTypeDiscriminator(), clang::CodeGen::CGOpenCLRuntime::getPointerType(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), clang::CodeGen::CodeGenVTables::getSecondaryVirtualPointerIndex(), clang::CodeGen::CodeGenVTables::getSubVTTIndex(), getTypeInfoLinkage(), getVBaseAlignment(), GetWeakRefReference(), handleAMDGPUFlatWorkGroupSizeAttr(), handleAMDGPUWavesPerEUAttr(), handleCUDALaunchBoundsAttr(), imbueXRayAttrs(), InitCatchParam(), InitDeviceMC(), clang::CodeGen::initializationPatternFor(), isFunctionBlockedByProfileList(), isInNoSanitizeList(), clang::CodeGen::swiftcall::isLegalIntegerType(), clang::CodeGen::CodeGenVTables::isVTableExternal(), printPostfixForExternalizedDecl(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), Release(), clang::CodeGen::SanitizerMetadata::reportGlobal(), SetLLVMFunctionAttributesForDefinition(), clang::CodeGen::CGDebugInfo::setLocation(), setUsedBits(), setWindowsItaniumDLLImport(), shouldBeInCOMDAT(), ShouldUseExternalRTTIDescriptor(), clang::CodeGen::CodeGenFunction::StartThunk(), stopAutoInit(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), clang::CodeGen::ConstantEmitter::tryEmitConstantExpr(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(), TypeRequiresBuiltinLaunder(), and clang::CodeGen::CodeGenTypes::UpdateCompletedType().
|
inline |
Definition at line 760 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping().
|
inline |
Return a reference to the configured CUDA runtime.
Definition at line 735 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCUDAKernelCallExpr(), EmitDirectCallee(), clang::CodeGen::CodeGenFunction::GenerateCode(), GetAddrOfFunction(), getMangledName(), and GetOrCreateLLVMGlobal().
|
inline |
Definition at line 842 of file CodeGenModule.h.
Referenced by BuildAppleKextVirtualCall(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), CalculateCookiePadding(), clang::CodeGen::CodeGenFunction::CodeGenFunction(), CodeGenModule(), commonEmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateKCFITypeId(), clang::CodeGen::CodeGenFunction::createTLSAtExitStub(), EmitArrayDelete(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), EmitCompare(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitCXXMemberDataPointerAddress(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), EmitDestroyingObjectDelete(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), EmitDynamicCastToNull(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitInlinedInheritingCXXConstructorCall(), EmitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNonNullRValueCheck(), EmitNullBaseClassInitialization(), EmitNullConstant(), EmitObjectDelete(), clang::CodeGen::CodeGenFunction::EmitPredefinedLValue(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), EmitTypeidFromVTable(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CodeGenFunction::EmitVTableAssumptionLoad(), clang::CodeGen::CodeGenFunction::EmitVTableAssumptionLoads(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), EmitVTableTypeMetadata(), clang::CodeGen::CodeGenFunction::EnterCXXTryStmt(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CodeGen::CodeGenFunction::ExitCXXTryStmt(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalCleanUpFunc(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), getAddrAndTypeOfCXXStructor(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), GetAddrOfConstantStringFromLiteral(), GetAddrOfFunction(), GetAddrOfGlobalTemporary(), GetAddrOfRTTIDescriptor(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), GetAddrOfVTTVTable(), getBlockCaptureStr(), getBlockMangledName(), clang::CodeGen::CodeGenTypes::getCXXABI(), clang::CodeGen::getCXXDestructorImplicitParam(), getFunctionLinkage(), clang::CodeGen::getImplicitCXXConstructorArgs(), getMangledName(), getMangledNameImpl(), getMemberPointerConstant(), clang::CodeGen::CGObjCRuntime::getSymbolNameForMethod(), getTerminateFn(), clang::CodeGen::CodeGenFunction::getTerminateFunclet(), clang::CodeGen::CodeGenFunction::getTerminateHandler(), clang::CodeGen::CodeGenFunction::getTerminateLandingPad(), getTypeIdentifier(), clang::CodeGen::CodeGenFunction::getUBSanFunctionTypeHash(), getVTableLinkage(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), hasInAllocaArgs(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), clang::CodeGen::CodeGenFunction::InitializeVTablePointers(), PerformReturnAdjustment(), clang::CodeGen::CGCallee::prepareConcreteCallee(), pushTemporaryCleanup(), setDLLImportDLLExport(), SetLLVMFunctionAttributesForDefinition(), setThunkProperties(), shouldEmitAvailableExternallyVTable(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), clang::CodeGen::CodeGenFunction::StartThunk(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 833 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::ConstantAggregateBuilderBase::addPlaceholderWithSize(), CheckAtomicAlignment(), classifyType(), CoerceIntOrPtrToIntOrPtr(), complexTempStructure(), ConstructAttributeList(), constStructWithPadding(), CreateCoercedLoad(), clang::CodeGen::CodeGenFunction::CreateCoercedStore(), clang::CodeGen::CodeGenFunction::CreateDefaultAlignTempAlloca(), clang::CodeGen::CodeGenFunction::CreateTempAlloca(), CreateTempAllocaForCoercion(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::emitAlignmentAssumption(), EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), EmitAsmStores(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::emitBuiltinOSLogFormat(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), clang::CodeGen::ConstantEmitter::emitForMemory(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGEPOffsetInBytes(), clang::CodeGen::CodeGenFunction::EmitLifetimeEnd(), clang::CodeGen::CodeGenFunction::EmitLifetimeStart(), emitOMPAtomicRMW(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitPointerArithmetic(), clang::CodeGen::CodeGenFunction::emitPointerAuthResign(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::emitVoidPtrDirectVAArg(), clang::CodeGen::emitVoidPtrVAArg(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), EnterStructPointerForCoercedAccess(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalInitFunc(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), GetAddrOfConstantCFString(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), clang::CodeGen::CodeGenFunction::getBlockByrefInfo(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), clang::CodeGen::swiftcall::getNaturalAlignment(), GetTargetTypeStoreSize(), getTypeAllocSize(), getTypeStoreSize(), clang::CodeGen::initializationPatternFor(), initializeForBlockHeader(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), isFullSizeType(), isProvablyNonNull(), clang::CodeGen::DominatingLLVMValue::save(), SetLLVMFunctionAttributesForDefinition(), and setUsedBits().
llvm::GlobalVariable::ThreadLocalMode CodeGenModule::GetDefaultLLVMTLSModel | ( | ) | const |
Get LLVM TLS mode from CodeGenOptions.
Definition at line 1953 of file CodeGenModule.cpp.
References clang::CodeGenOptions::GeneralDynamicTLSModel, clang::CodeGenOptions::InitialExecTLSModel, clang::CodeGenOptions::LocalDynamicTLSModel, and clang::CodeGenOptions::LocalExecTLSModel.
Referenced by setTLSMode().
|
inline |
Definition at line 832 of file CodeGenModule.h.
Referenced by BuildTrapReason(), CheckAtomicAlignment(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), emitAArch64DeclareSimdFunction(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), EmitAsmStores(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), emitCommonOMPTargetDirective(), clang::CodeGen::CodeGenFunction::EmitRISCVMultiVersionResolver(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenFunction::EmitWhileStmt(), Error(), ErrorUnsupported(), clang::CodeGen::CGCXXABI::ErrorUnsupportedABI(), GetOrCreateLLVMGlobal(), Release(), setGlobalVisibility(), clang::CodeGen::CodeGenFunction::StartFunction(), and stopAutoInit().
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 clang::CodeGen::CodeGenFunction::EmitCXXMemberDataPointerAddress(), and getVBaseAlignment().
bool CodeGenModule::getExpressionLocationsEnabled | ( | ) | const |
Return true if we should emit location information for expressions.
Definition at line 6764 of file CodeGenModule.cpp.
|
inline |
Definition at line 823 of file CodeGenModule.h.
llvm::GlobalValue::LinkageTypes CodeGenModule::getFunctionLinkage | ( | GlobalDecl | GD | ) |
Definition at line 2325 of file CodeGenModule.cpp.
References D, getContext(), getCXXABI(), clang::CodeGen::CGCXXABI::getCXXDestructorLinkage(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::ASTContext::GetGVALinkageForFunction(), and getLLVMLinkageForDeclarator().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), emitConstructorDestructorAlias(), EmitDeferredUnusedCoverageMappings(), getCodegenToUse(), isUniqueInternalLinkageDecl(), setFunctionLinkage(), and TryEmitBaseDestructorAsAlias().
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::Type::getAs(), clang::GlobalDecl::getDecl(), clang::ASTContext::getFunctionNoProtoType(), getFunctionPointer(), and getRawFunctionPointer().
Referenced by clang::CodeGen::CodeGenFunction::createAtExitStub(), EmitFunctionDeclLValue(), emitGlobalDtorWithCXAAtExit(), and getFunctionPointer().
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.
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(), clang::Type::getPointeeType(), getPointerAuthOtherDiscriminator(), clang::Type::isFunctionPointerType(), clang::Type::isFunctionReferenceType(), clang::Type::isFunctionType(), clang::CodeGenOptions::PointerAuth, and clang::T.
Referenced by clang::CodeGen::CodeGenFunction::authPointerToPointerCast(), clang::CodeGen::CodeGenFunction::EmitCallee(), getFunctionPointer(), and getPointerAuthInfoForPointeeType().
llvm::Constant * CodeGenModule::GetFunctionStart | ( | const ValueDecl * | Decl | ) |
Definition at line 5099 of file CodeGenModule.cpp.
References GetAddrOfFunction().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
llvm::Type * CodeGenModule::getGenericBlockLiteralType | ( | ) |
The type of a generic block literal.
Definition at line 1135 of file CGBlocks.cpp.
References getBlockDescriptorType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getLangOpts(), getOpenCLRuntime(), getTargetCodeGenInfo(), clang::CodeGen::TargetCodeGenInfo::getTargetOpenCLBlockHelper(), clang::CodeGen::CodeGenTypeCache::IntTy, clang::OpenCL, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by clang::CodeGen::CodeGenFunction::EmitBlockCallExpr().
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().
|
inline |
Definition at line 865 of file CodeGenModule.h.
|
inline |
Definition at line 866 of file CodeGenModule.h.
llvm::GlobalValue * CodeGenModule::GetGlobalValue | ( | StringRef | Ref | ) |
Definition at line 2243 of file CodeGenModule.cpp.
References getModule().
Referenced by emitConstructorDestructorAlias(), EmitGlobal(), EmitGlobalAnnotations(), EmitOMPAllocateDecl(), EmitTentativeDefinition(), GetOrCreateLLVMGlobal(), GetWeakRefReference(), clang::CodeGen::CGOpenMPRuntime::markAsGlobalTarget(), Release(), and TryEmitBaseDestructorAsAlias().
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, D, clang::Default, clang::FirstTargetAddressSpace, clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), getTargetCodeGenInfo(), clang::Decl::hasAttr(), clang::opencl_constant, clang::opencl_global, clang::opencl_global_device, clang::opencl_global_host, clang::opencl_local, and clang::sycl_global.
Referenced by emitCatchDispatchBlock(), clang::CodeGen::CodeGenFunction::EmitCXXTypeidExpr(), EmitOMPAllocateDecl(), GetAddrOfGlobalTemporary(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), and getVtableGlobalVarAlignment().
|
inline |
Definition at line 826 of file CodeGenModule.h.
|
inline |
Return a reference to the configured HLSL runtime.
Definition at line 741 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::HLSLBufferLayoutBuilder::createLayoutType(), clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitHLSLBuiltinExpr(), EmitTopLevelDecl(), handleHlslClip(), Release(), and clang::CodeGen::CodeGenFunction::StartFunction().
Definition at line 6536 of file CodeGenModule.cpp.
References getModule().
Referenced by ARMMVEVectorReinterpret(), buildFMulAdd(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAArch64SMEBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAArch64SVEBuiltinExpr(), EmitAArch64TblBuiltinExpr(), EmitAMDGCNBallotForExec(), clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCNoopIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMMVEBuiltinExpr(), EmitAsmStores(), emitBinaryExpMaybeConstrainedFPBuiltin(), emitBinaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), emitBuiltinWithOneOverloadedType(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCallMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitCapturedLocals(), emitCatchDispatchBlock(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCoroutineBody(), clang::CodeGen::CodeGenFunction::EmitCoroutineIntrinsic(), clang::CodeGen::CodeGenPGO::emitCounterSetOrIncrement(), EmitCXXNewAllocSize(), EmitFAbs(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), clang::CodeGen::CodeGenFunction::EmitFP8NeonCall(), emitFPIntBuiltin(), emitFrexpBuiltin(), EmitGEPOffsetInBytes(), clang::CodeGen::CodeGenFunction::EmitHexagonBuiltinExpr(), clang::CodeGen::CGHLSLRuntime::emitInputSemantic(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), EmitllvmFAbs(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), emitMaybeConstrainedFPToIntRoundBuiltin(), clang::CodeGen::CodeGenPGO::emitMCDCParameters(), clang::CodeGen::CodeGenPGO::emitMCDCTestVectorBitmapUpdate(), clang::CodeGen::CodeGenFunction::EmitMSVCBuiltinExpr(), EmitMSVCRTSetJmp(), clang::CodeGen::CodeGenFunction::EmitNVPTXBuiltinExpr(), EmitOverflowIntrinsic(), clang::CodeGen::CodeGenFunction::EmitPointerAuthBlendDiscriminator(), EmitPointerAuthCommon(), clang::CodeGen::CodeGenFunction::emitPointerAuthResignCall(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitRISCVBuiltinExpr(), clang::CodeGen::CodeGenFunction::emitRotate(), emitRVVVsetvliBuiltin(), EmitScalarFMAExpr(), emitSincosBuiltin(), clang::CodeGen::CodeGenFunction::EmitSMELd1St1(), clang::CodeGen::CodeGenFunction::EmitSMELdrStr(), clang::CodeGen::CodeGenFunction::EmitSMEReadWrite(), clang::CodeGen::CodeGenFunction::EmitSMEZero(), EmitSpecialRegisterBuiltin(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), EmitStrip(), emitSuspendExpression(), clang::CodeGen::CodeGenFunction::EmitSVEAllTruePred(), clang::CodeGen::CodeGenFunction::EmitSVEGatherLoad(), clang::CodeGen::CodeGenFunction::EmitSVEGatherPrefetch(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedLoad(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedStore(), clang::CodeGen::CodeGenFunction::EmitSVEMovl(), clang::CodeGen::CodeGenFunction::EmitSVEPMull(), clang::CodeGen::CodeGenFunction::EmitSVEPredicateCast(), clang::CodeGen::CodeGenFunction::EmitSVEPrefetchLoad(), clang::CodeGen::CodeGenFunction::EmitSVEScatterStore(), clang::CodeGen::CodeGenFunction::EmitSVEStructLoad(), clang::CodeGen::CodeGenFunction::EmitSVEStructStore(), clang::CodeGen::CodeGenFunction::EmitSystemZBuiltinExpr(), EmitSystemZIntrinsicWithCC(), emitTernaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), emitUnaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), clang::CodeGen::CodeGenFunction::EmitVAStartEnd(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), emitWasmCatchPadBlock(), clang::CodeGen::CodeGenFunction::EmitWebAssemblyBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), EmitX86CompressExpand(), EmitX86CompressStore(), EmitX86ConvertIntToFp(), EmitX86CvtF16ToFloatExpr(), EmitX86ExpandLoad(), EmitX86FMAExpr(), EmitX86FunnelShift(), EmitX86Ternlog(), clang::CodeGen::CodeGenFunction::ExitCXXTryStmt(), clang::CodeGen::CodeGenFunction::ExitSEHTryStmt(), getARCIntrinsic(), clang::CodeGen::CodeGenFunction::LookupNeonLLVMIntrinsic(), packTBLDVectorList(), readX18AsPtr(), clang::CodeGen::CodeGenPGO::valueProfile(), and wrapWithBPFPreserveStaticOffset().
|
inline |
Definition at line 853 of file CodeGenModule.h.
References clang::CodeGen::CodeGenVTables::getItaniumVTableContext().
Referenced by ApplyNonVirtualAndVirtualOffset(), BuildAppleKextVirtualCall(), getVtableGlobalVarAlignment(), performTypeAdjustment(), and UseRelativeLayout().
|
inline |
Definition at line 857 of file CodeGenModule.h.
References clang::CodeGen::CodeGenVTables::getItaniumVTableContext().
|
inline |
Definition at line 822 of file CodeGenModule.h.
Referenced by addBlockLayout(), addMonoNonMonoModifier(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), buildBlockDescriptor(), buildGlobalBlock(), CallBeginCatch(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CGOpenMPRuntime::CGOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), CodeGenModule(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CodeGen::CGDebugInfo::completeType(), computeBlockInfo(), configureBlocksRuntimeObject(), ConstructAttributeList(), CreateGlobalInitOrCleanUpFunction(), clang::CodeGen::CreateGNUObjCRuntime(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitARCReclaimReturnedObject(), EmitAtomicOp(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CGOpenMPRuntime::emitBarrierCall(), EmitBaseInitializer(), clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallOrInvoke(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCommonOMPTargetDirective(), clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), clang::CodeGen::CodeGenFunction::EmitCXXTryStmt(), clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetFunction(), clang::CodeGen::CodeGenFunction::EmitDelegatingCXXConstructorCall(), EmitDirectCallee(), clang::CodeGen::CGOpenMPRuntime::emitDistributeStaticInit(), clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), clang::CodeGen::CGOpenMPRuntime::emitFlush(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), EmitGlobal(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CodeGenFunction::EmitLandingPad(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalUpdate(), emitLibraryCall(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolCleanup(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), EmitObjectDelete(), emitOMPAtomicCaptureExpr(), clang::CodeGen::CodeGenFunction::EmitOMPCancelDirective(), clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(), emitOMPForDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMaskedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMasterDirective(), clang::CodeGen::CodeGenFunction::EmitOMPOrderedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(), clang::CodeGen::CodeGenFunction::EmitOMPSectionDirective(), clang::CodeGen::CodeGenFunction::EmitOMPSectionsDirective(), emitOMPSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetEnterDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetExitDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetUpdateDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskgroupDirective(), clang::CodeGen::CodeGenFunction::EmitOMPUnrollDirective(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CGOpenMPRuntime::emitTargetCall(), clang::CodeGen::CGOpenMPRuntime::emitTargetFunctions(), clang::CodeGen::CGOpenMPRuntime::emitTargetGlobalVariable(), emitTargetTeamsLoopCodegenStatus(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskyieldCall(), EmitThreadPrivateVarDeclLValue(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), GenerateStringLiteral(), GenKernelArgMetadata(), clang::CodeGen::EHPersonality::get(), clang::CodeGen::CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(), GetAddrOfConstantCFString(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getAsmSrcLocInfo(), getBlockDescriptorName(), getBlockDescriptorType(), getCopyDestroyHelperFuncName(), getGenericBlockLiteralType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), clang::CodeGen::CodeGenFunction::getInvokeDestImpl(), clang::CodeGen::CodeGenFunction::getLangOpts(), getLLVMLinkageForDeclarator(), getMangledName(), getMangledNameImpl(), getNaturalTypeAlignment(), GetOrCreateLLVMGlobal(), clang::CodeGen::CGOpenMPRuntime::getOrCreateThreadPrivateCache(), getStaticDeclName(), getTBAAAccessInfo(), getTerminateFn(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), getTypeInfoLinkage(), hasMRCWeakIvars(), initializeForBlockHeader(), clang::CodeGen::CGOpenMPRuntime::isNontemporalDecl(), clang::CodeGen::CodeGenFunction::LValueIsSuitableForInlineAtomic(), clang::CodeGen::CGOpenMPRuntime::markAsGlobalTarget(), MaybeHandleStaticInExternC(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::NontemporalDeclsRAII(), printPostfixForExternalizedDecl(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), Release(), clang::CodeGen::CodeGenVTables::RemoveHwasanMetadata(), clang::CodeGen::SanitizerMetadata::reportGlobal(), setARCRuntimeFunctionLinkage(), setGlobalVisibility(), SetLLVMFunctionAttributesForDefinition(), shouldAssumeDSOLocal(), shouldEmitBuiltinAsIR(), shouldEmitRTTI(), shouldMapVisibilityToDLLExport(), shouldZeroInitPadding(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), tryCaptureAsConstant(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), tryGenerateSpecializedMessageSend(), UseOptimizedSetter(), clang::CodeGen::CodeGenFunction::~CodeGenFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII(), and clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII().
|
inline |
Definition at line 843 of file CodeGenModule.h.
Referenced by AddDependentLib(), AddDetectMismatch(), clang::CodeGen::CGDebugInfo::addHeapAllocSiteMetadata(), addLinkOptionsPostorder(), AddVTableTypeMetadata(), AdjustMemoryAttribute(), AppendLinkerOptions(), BuildAppleKextVirtualCall(), buildBlockDescriptor(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), computeBlockInfo(), ConstructAttributeList(), constStructWithPadding(), clang::CodeGen::HLSLBufferLayoutBuilder::createLayoutType(), clang::CodeGen::CGDebugInfo::CreateSyntheticInlineAt(), DecorateInstructionWithInvariantGroup(), clang::CodeGen::CoverageMappingModuleGen::emit(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), EmitAnnotationString(), EmitAtomicOp(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCoroutineBody(), clang::CodeGen::CodeGenPGO::emitCounterSetOrIncrement(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInitBranch(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(), clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), EmitGlobalDeclMetadata(), EmitGlobalNamedRegister(), EmitHipStdParUnsupportedAsm(), clang::CodeGen::CGDebugInfo::EmitLabel(), clang::CodeGen::CGDebugInfo::EmitLexicalBlockStart(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), clang::CodeGen::CGDebugInfo::EmitLocation(), clang::CodeGen::CodeGenPGO::emitMCDCParameters(), clang::CodeGen::CodeGenPGO::emitMCDCTestVectorBitmapUpdate(), EmitOMPAllocateDecl(), EmitSignBit(), EmitSpecialRegisterBuiltin(), clang::CodeGen::CodeGenFunction::EmitSwitchStmt(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), clang::CodeGen::ConstantAggregateBuilderBase::finishStruct(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), GetAddrOfConstantCString(), GetAddrOfGlobalTemporary(), getBlockDescriptorType(), getClangCallTerminateFn(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), getDynTlsOnDemandInitFn(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAbortFn(), getGuardAcquireFn(), getGuardReleaseFn(), getInitThreadAbortFn(), getInitThreadFooterFn(), getInitThreadHeaderFn(), getInlineSpirvConstant(), getInlineSpirvType(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), getNoObjCARCExceptionsMetadata(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), clang::CodeGen::CGOpenCLRuntime::getPointerType(), clang::CodeGen::CodeGenFunction::getTerminateFunclet(), getTlsGuardVar(), clang::CodeGen::CodeGenVTables::getVTableType(), clang::CodeGen::initializationPatternFor(), initializeAlloca(), initializeBuffer(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), clang::CodeGen::CodeGenFunction::maybeAttachRangeForLoad(), readX18AsPtr(), Release(), clang::CodeGen::SanitizerMetadata::reportGlobal(), clang::CodeGen::CGDebugInfo::SourceLocToDebugLoc(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
llvm::Function * CodeGenModule::getLLVMFakeUseFn | ( | ) |
Lazily declare the @llvm.fake.use intrinsic.
Definition at line 2625 of file CGDecl.cpp.
References getModule().
Referenced by clang::CodeGen::CodeGenFunction::EmitFakeUse().
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().
Referenced by clang::CodeGen::CodeGenFunction::EmitLifetimeEnd().
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().
Referenced by clang::CodeGen::CodeGenFunction::EmitLifetimeStart().
llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageForDeclarator | ( | const DeclaratorDecl * | D, |
GVALinkage | Linkage | ||
) |
Returns LLVM linkage for a declarator.
Definition at line 6111 of file CodeGenModule.cpp.
References clang::CUDA, D, clang::Decl::getAsFunction(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::GVA_AvailableExternally, clang::GVA_DiscardableODR, clang::GVA_Internal, clang::GVA_StrongExternal, clang::GVA_StrongODR, clang::Decl::hasAttr(), clang::FunctionDecl::isMultiVersion(), and isVarDeclStrongDefinition().
Referenced by clang::CodeGen::CGCXXABI::getCXXDestructorLinkage(), getFunctionLinkage(), and getLLVMLinkageVarDefinition().
llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageVarDefinition | ( | const VarDecl * | VD | ) |
Returns LLVM linkage for a declarator.
Definition at line 6183 of file CodeGenModule.cpp.
References getContext(), clang::ASTContext::GetGVALinkageForVariable(), and getLLVMLinkageForDeclarator().
Referenced by canEmitSpuriousReferenceToVariable(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfGlobalTemporary(), getThreadLocalWrapperLinkage(), and clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable().
|
inlinestatic |
Definition at line 955 of file CodeGenModule.h.
References clang::DefaultVisibility, clang::HiddenVisibility, clang::ProtectedVisibility, and V.
Referenced by setGlobalVisibility().
StringRef CodeGenModule::getMangledName | ( | GlobalDecl | GD | ) |
Definition at line 2150 of file CodeGenModule.cpp.
References clang::Ctor_Base, clang::Ctor_Complete, clang::GlobalDecl::getCanonicalDecl(), getContext(), clang::GlobalDecl::getCtorType(), getCUDARuntime(), getCXXABI(), clang::GlobalDecl::getDecl(), getLangOpts(), getMangledNameImpl(), getTarget(), clang::GlobalDecl::getWithKernelReferenceKind(), clang::Kernel, and clang::Result.
Referenced by createUnnamedGlobalFrom(), emitCommonOMPTargetDirective(), emitConstructorDestructorAlias(), EmitDeferredUnusedCoverageMappings(), EmitDirectCallee(), EmitGlobal(), EmitOMPAllocateDecl(), clang::CodeGen::CGOpenMPRuntime::emitTargetFunctions(), clang::CodeGen::CGOpenMPRuntime::emitTargetGlobalVariable(), EmitTentativeDefinition(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), generateUniqueName(), getAddrAndTypeOfCXXStructor(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfFunction(), GetAddrOfGlobalVar(), GetAddrOfMSGuidDecl(), GetAddrOfTemplateParamObject(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getBuiltinLibFunction(), getOrCreateStaticVarDecl(), clang::CodeGen::CGOpenMPRuntime::getOrCreateThreadPrivateCache(), getPointerAuthDeclDiscriminator(), getStaticDeclName(), clang::CodeGen::CGOpenMPRuntime::markAsGlobalTarget(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), Release(), and TryEmitBaseDestructorAsAlias().
const GlobalDecl CodeGenModule::getMangledNameDecl | ( | StringRef | Name | ) |
Definition at line 2233 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CGDebugInfo::EmitGlobalAlias().
llvm::Constant * CodeGenModule::getMemberFunctionPointer | ( | const FunctionDecl * | FD, |
llvm::Type * | Ty = nullptr |
||
) |
Definition at line 539 of file CGPointerAuth.cpp.
References getContext(), getMemberFunctionPointer(), clang::ASTContext::getMemberPointerType(), getRawFunctionPointer(), and clang::ValueDecl::getType().
Referenced by getMemberFunctionPointer().
llvm::Constant * CodeGenModule::getMemberFunctionPointer | ( | llvm::Constant * | Pointer, |
QualType | FT | ||
) |
Definition at line 524 of file CGPointerAuth.cpp.
References getConstantSignedPointer(), getMemberFunctionPointerAuthInfo(), clang::QualType::getTypePtr(), and Pointer.
CGPointerAuthInfo CodeGenModule::getMemberFunctionPointerAuthInfo | ( | QualType | FT | ) |
Definition at line 508 of file CGPointerAuth.cpp.
References clang::PointerAuthOptions::CXXMemberFunctionPointers, clang::Type::getAs(), getCodeGenOpts(), getPointerAuthOtherDiscriminator(), and clang::CodeGenOptions::PointerAuth.
Referenced by getMemberFunctionPointer(), and pointerAuthResignMemberFunctionPointer().
llvm::Constant * CodeGenModule::getMemberPointerConstant | ( | const UnaryOperator * | e | ) |
Definition at line 2603 of file CGExprConstant.cpp.
References clang::ast_matchers::decl, clang::CodeGen::CGCXXABI::EmitMemberDataPointer(), clang::CodeGen::CGCXXABI::EmitMemberFunctionPointer(), getContext(), getCXXABI(), clang::ASTContext::getFieldOffset(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::ASTContext::toCharUnitsFromBits(), and clang::ast_matchers::type.
|
inline |
Definition at line 861 of file CodeGenModule.h.
References clang::CodeGen::CodeGenVTables::getMicrosoftVTableContext().
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().
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(), and clang::CodeGen::CodeGenFunction::EmitTypeCheck().
|
inline |
Definition at line 831 of file CodeGenModule.h.
Referenced by clang::CodeGen::CGHLSLRuntime::addBuffer(), buildBlockDescriptor(), buildGlobalBlock(), CodeGenModule(), clang::CodeGen::TargetCodeGenInfo::createEnqueuedBlockKernel(), CreateGlobalInitOrCleanUpFunction(), CreateOrReplaceCXXRuntimeVariable(), createReferenceTemporary(), createUnnamedGlobalFrom(), clang::CodeGen::CoverageMappingModuleGen::emit(), EmitAnnotationArgs(), EmitAnnotationString(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CGOpenMPRuntime::emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), clang::CodeGen::CodeGenFunction::EmitBPFBuiltinExpr(), clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), clang::CodeGen::CGOpenMPRuntime::emitCancellationPointCall(), clang::CodeGen::CodeGenFunction::EmitCapturedLocals(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), clang::CodeGen::CGOpenMPRuntime::emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetFunction(), clang::CodeGen::CGOpenMPRuntime::emitDepobjDependClause(), clang::CodeGen::CGOpenMPRuntime::emitDestroyClause(), emitDestructorsFunction(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), EmitDoacrossOrdered(), clang::CodeGen::CGHLSLRuntime::emitEntryFunction(), clang::CodeGen::CGOpenMPRuntime::emitErrorCall(), clang::CodeGen::CGOpenMPRuntime::emitFlush(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), EmitGlobalAnnotations(), EmitGlobalDeclMetadata(), EmitGlobalNamedRegister(), EmitHipStdParUnsupportedAsm(), EmitHipStdParUnsupportedBuiltin(), clang::CodeGen::CodeGenFunction::EmitHLSLBuiltinExpr(), emitInitWithReductionInitializer(), clang::CodeGen::CGHLSLRuntime::emitInputSemantic(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalFinalUpdate(), EmitMainVoidAlias(), clang::CodeGen::CGOpenMPRuntime::emitMaskedRegion(), clang::CodeGen::CGOpenMPRuntime::emitMasterRegion(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CGOpenMPRuntime::emitNumTeamsClause(), clang::CodeGen::CGOpenMPRuntime::emitNumThreadsClause(), clang::CodeGen::CodeGenFunction::EmitNVPTXDevicePrintfCallExpr(), EmitOMPAllocateDecl(), clang::CodeGen::CGOpenMPRuntime::emitOrderedRegion(), emitOutlinedFunctionPrologue(), clang::CodeGen::CGOpenMPRuntime::emitParallelCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitParallelCall(), clang::CodeGen::CGOpenMPRuntime::emitPrivateReduction(), clang::CodeGen::CGOpenMPRuntime::emitProcBindClause(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReduction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), clang::CodeGen::CodeGenFunction::EmitReturnStmt(), clang::CodeGen::CodeGenFunction::EmitRISCVBuiltinExpr(), clang::CodeGen::CGOpenMPRuntime::emitSingleRegion(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataStandAloneCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskCall(), emitTaskDupFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskgroupRegion(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskLoopCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskOutlinedFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFini(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskyieldCall(), clang::CodeGen::CGOpenMPRuntime::emitTeamsCall(), clang::CodeGen::CGOpenMPRuntime::emitThreadLimitClause(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarInit(), EmitTopLevelDecl(), emitUsed(), clang::CodeGen::CGOpenMPRuntime::emitUsesAllocatorsFini(), clang::CodeGen::CGOpenMPRuntime::emitUsesAllocatorsInit(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), finalizeKCFITypes(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::generateAwaitSuspendWrapper(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::generateBuiltinOSLogHelperFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CGHLSLRuntime::generateGlobalCtorDtorCalls(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenVTables::GenerateRelativeVTableAlias(), GenerateStringLiteral(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(), GetAddrOfConstantCFString(), clang::CodeGen::ConstantAggregateBuilderBase::getAddrOfCurrentPosition(), GetAddrOfGlobalTemporary(), GetAddrOfMSGuidDecl(), clang::CodeGen::ConstantAggregateBuilderBase::getAddrOfPosition(), GetAddrOfTemplateParamObject(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), GetAddrOfUnnamedGlobalConstantDecl(), getClangCallTerminateFn(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), GetGlobalValue(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUNumThreads(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUThreadID(), getInitThreadEpochPtr(), getIntrinsic(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcFreeShared(), getLLVMFakeUseFn(), getLLVMLifetimeEndFn(), getLLVMLifetimeStartFn(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), getSanStats(), clang::CodeGen::CGOpenMPRuntime::getTaskReductionItem(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), getTypeInfoVTable(), initializeBuffer(), clang::CodeGen::CodeGenFunction::recoverAddrOfEscapedLocal(), Release(), clang::CodeGen::SanitizerMetadata::reportGlobal(), setThunkProperties(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), TryEmitBaseDestructorAsAlias(), and clang::CodeGen::CodeGenPGO::valueProfile().
|
inline |
Definition at line 813 of file CodeGenModule.h.
Referenced by EmitExplicitCastExprType(), EmitExternalDeclaration(), EmitTopLevelDecl(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), GetAddrOfConstantStringFromLiteral(), Release(), and clang::CodeGen::CodeGenTypes::UpdateCompletedType().
|
inline |
Definition at line 720 of file CodeGenModule.h.
Referenced by getMangledNameImpl(), and isUniqueInternalLinkageDecl().
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().
CharUnits CodeGenModule::getNaturalPointeeTypeAlignment | ( | QualType | T, |
LValueBaseInfo * | BaseInfo = nullptr , |
||
TBAAAccessInfo * | TBAAInfo = nullptr |
||
) |
Definition at line 7997 of file CodeGenModule.cpp.
References getNaturalTypeAlignment(), clang::Type::getPointeeType(), and clang::T.
Referenced by ConstructAttributeList(), and EmitPointerWithAlignment().
CharUnits CodeGenModule::getNaturalTypeAlignment | ( | QualType | T, |
LValueBaseInfo * | BaseInfo = nullptr , |
||
TBAAAccessInfo * | TBAAInfo = nullptr , |
||
bool | forPointeeType = false |
||
) |
Definition at line 8003 of file CodeGenModule.cpp.
References clang::CodeGen::AttributedType, clang::CharUnits::fromQuantity(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), getClassPointerAlignment(), getContext(), getLangOpts(), clang::CharUnits::getQuantity(), getTBAAAccessInfo(), clang::ASTContext::getTypeAlignInChars(), clang::Type::isArrayType(), clang::Type::isIncompleteType(), clang::CharUnits::One(), clang::T, clang::ASTContext::toCharUnitsFromBits(), and clang::CodeGen::Type.
Referenced by ConstructAttributeList(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberDataPointerAddress(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitDeleteCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitLoadOfReference(), emitOMPArraySectionBase(), clang::CodeGen::CodeGenFunction::EmitOMPLastprivateClauseFinal(), emitTaskDupFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), GetAddrOfTemplateParamObject(), getNaturalPointeeTypeAlignment(), getOMPAllocateAlignment(), clang::CodeGen::CodeGenFunction::makeNaturalAddressForPointer(), makeNaturalAlignAddrLValue(), and clang::CodeGen::CodeGenFunction::StartFunction().
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.
Referenced by clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), and clang::CodeGen::CGCXXABI::getMemberPointerAdjustment().
|
inline |
Definition at line 815 of file CodeGenModule.h.
References getLLVMContext().
llvm::Constant * CodeGenModule::getNSConcreteGlobalBlock | ( | ) |
Definition at line 2950 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), clang::Default, GetOrCreateLLVMGlobal(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.
Referenced by buildGlobalBlock().
llvm::Constant * CodeGenModule::getNSConcreteStackBlock | ( | ) |
Definition at line 2960 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), clang::Default, GetOrCreateLLVMGlobal(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.
llvm::Constant * CodeGenModule::getNullPointer | ( | llvm::PointerType * | T, |
QualType | QT | ||
) |
Get target specific null pointer.
T | is the LLVM type of the null pointer. |
QT | is the clang QualType of the null pointer. |
Definition at line 2041 of file CGExprConstant.cpp.
References clang::CodeGen::TargetCodeGenInfo::getNullPointer(), getTargetCodeGenInfo(), and clang::T.
Referenced by EmitNullConstant(), clang::CodeGen::CodeGenFunction::emitPointerAuthResign(), and clang::CodeGen::CodeGenFunction::EmitScalarInit().
|
inline |
Definition at line 746 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitARCAutorelease(), clang::CodeGen::CodeGenFunction::EmitARCAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::EmitARCCopyWeak(), clang::CodeGen::CodeGenFunction::EmitARCDestroyWeak(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCLoadWeak(), clang::CodeGen::CodeGenFunction::EmitARCLoadWeakRetained(), clang::CodeGen::CodeGenFunction::EmitARCMoveWeak(), clang::CodeGen::CodeGenFunction::EmitARCNoopIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCRelease(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseNonBlock(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::EmitARCRetainBlock(), clang::CodeGen::CodeGenFunction::EmitARCRetainNonBlock(), clang::CodeGen::CodeGenFunction::EmitARCStoreStrongCall(), clang::CodeGen::CodeGenFunction::EmitARCStoreWeak(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitObjCAlloc(), clang::CodeGen::CodeGenFunction::EmitObjCAllocInit(), clang::CodeGen::CodeGenFunction::EmitObjCAllocWithZone(), clang::CodeGen::CodeGenFunction::EmitObjCAutorelease(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPush(), clang::CodeGen::CodeGenFunction::EmitObjCRelease(), clang::CodeGen::CodeGenFunction::EmitObjCRetainNonBlock(), emitOptimizedARCReturnCall(), tryEmitFusedAutoreleaseOfResult(), and tryRemoveRetainOfSelf().
QualType CodeGenModule::getObjCFastEnumerationStateType | ( | ) |
Retrieve the record type that describes the state of an Objective-C fast enumeration loop (for..in).
Definition at line 6768 of file CodeGenModule.cpp.
References clang::AS_public, clang::ASTContext::buildImplicitRecord(), clang::FieldDecl::Create(), D, clang::ASTContext::getCanonicalTagType(), clang::ASTContext::getConstantArrayType(), clang::ASTContext::getObjCIdType(), clang::ASTContext::getPointerType(), clang::ICIS_NoInit, clang::QualType::isNull(), clang::Normal, and clang::ASTContext::UnsignedLongTy.
Referenced by clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt().
|
inline |
Return a reference to the configured Objective-C runtime.
Definition at line 712 of file CodeGenModule.h.
Referenced by buildBlockDescriptor(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitBlockCopyAndAutorelease(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), emitConstantObjCStringLiteral(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), EmitDeclInit(), clang::CodeGen::CodeGenFunction::EmitIvarOffset(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForIvar(), clang::CodeGen::CodeGenFunction::EmitObjCAtSynchronizedStmt(), clang::CodeGen::CodeGenFunction::EmitObjCAtThrowStmt(), clang::CodeGen::CodeGenFunction::EmitObjCAtTryStmt(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), clang::CodeGen::CodeGenFunction::EmitObjCProtocolExpr(), clang::CodeGen::emitObjCProtocolObject(), clang::CodeGen::CodeGenFunction::EmitObjCSelectorExpr(), clang::CodeGen::CodeGenFunction::EmitObjCSelectorLValue(), clang::CodeGen::CodeGenFunction::EmitObjCStringLiteral(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), emitStructGetterCall(), emitStructSetterCall(), clang::CodeGen::CodeGenFunction::EnterCXXTryStmt(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), getBlockDescriptorName(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and tryEmitSpecializedAllocInit().
Return the alignment specified in an allocate directive, if present.
Definition at line 2945 of file CGDecl.cpp.
References clang::CharUnits::fromQuantity(), clang::Decl::getAttr(), getContext(), getNaturalTypeAlignment(), clang::QualType::getNonReferenceType(), clang::CharUnits::getQuantity(), and clang::ValueDecl::getType().
Referenced by getAlignmentValue().
|
inline |
Return a reference to the configured OpenCL runtime.
Definition at line 723 of file CodeGenModule.h.
Referenced by buildGlobalBlock(), clang::CodeGen::CodeGenTypes::ConvertType(), createOpenCLIntToSamplerConversion(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), getGenericBlockLiteralType(), and initializeForBlockHeader().
|
inline |
Return a reference to the configured OpenMP runtime.
Definition at line 729 of file CodeGenModule.h.
Referenced by checkForLastprivateConditionalUpdate(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), emitCombinerOrInitializer(), emitCommonOMPParallelDirective(), emitCommonOMPTargetDirective(), emitCommonOMPTeamsDirective(), emitCommonSimdLoop(), clang::CodeGen::CodeGenFunction::EmitComplexAssignmentLValue(), clang::CodeGen::CodeGenFunction::EmitComplexPrePostIncDec(), emitCopyprivateCopyFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), emitDeclTargetVarDeclLValue(), clang::CodeGen::CGOpenMPRuntime::emitDeferredTargetDecls(), emitDestructorsFunction(), EmitDoacrossOrdered(), clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(), EmitGlobal(), emitInitWithReductionInitializer(), emitMasked(), emitMaster(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), emitOffloadingArraysAndArgs(), emitOMPAtomicCaptureExpr(), emitOMPAtomicCompareExpr(), clang::CodeGen::CodeGenFunction::EmitOMPAtomicDirective(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), emitOMPAtomicWriteExpr(), clang::CodeGen::CodeGenFunction::EmitOMPBarrierDirective(), clang::CodeGen::CodeGenFunction::EmitOMPCancelDirective(), clang::CodeGen::CodeGenFunction::EmitOMPCancellationPointDirective(), clang::CodeGen::CodeGenFunction::EmitOMPCanonicalLoop(), emitOMPCopyinClause(), clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(), EmitOMPDeclareMapper(), EmitOMPDeclareReduction(), clang::CodeGen::CodeGenFunction::EmitOMPDepobjDirective(), emitOMPDistributeDirective(), clang::CodeGen::CodeGenFunction::EmitOMPDistributeLoop(), clang::CodeGen::CodeGenFunction::EmitOMPDistributeParallelForDirective(), clang::CodeGen::CodeGenFunction::EmitOMPDistributeParallelForSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPDistributeSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPErrorDirective(), clang::CodeGen::CodeGenFunction::EmitOMPFirstprivateClause(), clang::CodeGen::CodeGenFunction::EmitOMPFlushDirective(), emitOMPForDirective(), clang::CodeGen::CodeGenFunction::EmitOMPForSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPGenericLoopDirective(), clang::CodeGen::CodeGenFunction::EmitOMPInteropDirective(), clang::CodeGen::CodeGenFunction::EmitOMPLastprivateClauseFinal(), clang::CodeGen::CodeGenFunction::EmitOMPLastprivateClauseInit(), clang::CodeGen::CodeGenFunction::EmitOMPMaskedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMaskedTaskLoopDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMaskedTaskLoopSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMasterDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMasterTaskLoopDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMasterTaskLoopSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPOrderedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelMaskedTaskLoopDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelMaskedTaskLoopSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelMasterTaskLoopDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelMasterTaskLoopSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseFinal(), clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), EmitOMPRequiresDecl(), clang::CodeGen::CodeGenFunction::EmitOMPScanDirective(), clang::CodeGen::CodeGenFunction::EmitOMPScopeDirective(), clang::CodeGen::CodeGenFunction::EmitOMPSectionDirective(), clang::CodeGen::CodeGenFunction::EmitOMPSectionsDirective(), emitOMPSimdDirective(), emitOMPSimdRegion(), clang::CodeGen::CodeGenFunction::EmitOMPSingleDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetEnterDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetExitDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelForDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelForSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelGenericLoopDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeParallelForSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDistributeSimdDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsGenericLoopDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetUpdateDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskgroupDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskwaitDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskyieldDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeParallelForDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeParallelForSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsDistributeSimdDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTeamsGenericLoopDirective(), EmitOMPThreadPrivateDecl(), clang::CodeGen::CodeGenFunction::EmitOMPUnrollDirective(), clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(), emitOutlinedFunctionPrologue(), clang::CodeGen::CGOpenMPRuntime::emitParallelCall(), emitParallelOrTeamsOutlinedFunction(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CGOpenMPRuntime::emitPrivateReduction(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReduction(), emitReductionCombiner(), clang::CodeGen::CodeGenFunction::EmitReturnStmt(), clang::CodeGen::CodeGenFunction::EmitSimpleOMPExecutableDirective(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), emitTargetParallelRegion(), emitTargetRegion(), emitTargetTeamsDistributeParallelForRegion(), emitTargetTeamsDistributeParallelForSimdRegion(), emitTargetTeamsDistributeRegion(), emitTargetTeamsDistributeSimdRegion(), emitTargetTeamsGenericLoopRegionAsDistribute(), emitTargetTeamsGenericLoopRegionAsParallel(), emitTargetTeamsRegion(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), EmitThreadPrivateVarDeclLValue(), emitWorksharingDirective(), clang::CodeGen::CodeGenFunction::GenerateOpenMPCapturedStmtFunction(), generateUniqueName(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), clang::CodeGen::CGOpenMPRuntimeGPU::getDefaultDistScheduleAndChunk(), GetOrCreateLLVMGlobal(), clang::CodeGen::CGOpenMPRuntime::isNontemporalDecl(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::NontemporalDeclsRAII(), clang::CodeGen::CodeGenFunction::processInReduction(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::UntiedTaskLocalDeclsRAII(), clang::CodeGen::CodeGenFunction::~CodeGenFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::~NontemporalDeclsRAII(), and clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::~UntiedTaskLocalDeclsRAII().
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::CLanguageLinkage, clang::CUDA, D, clang::VarDecl::DeclarationOnly, clang::Default, clang::CodeGen::ConstantEmitter::finalize(), GetAddrOfGlobalVar(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getAttr(), clang::ASTContext::getBaseElementType(), clang::Decl::getCanonicalDecl(), clang::GlobalDecl::getCanonicalDecl(), getContext(), getCUDARuntime(), clang::GlobalDecl::getDecl(), getDiags(), GetGlobalValue(), GetGlobalVarAddressSpace(), clang::ASTContext::getLangOpts(), getLangOpts(), getLLVMContext(), clang::Decl::getLocation(), getModule(), getOpenMPRuntime(), clang::ASTContext::getTargetAddressSpace(), getTargetCodeGenInfo(), getTriple(), clang::CodeGen::CGCUDARuntime::handleVarRegistration(), clang::Decl::hasAttr(), clang::VarDecl::hasInit(), clang::CXXRecordDecl::hasMutableFields(), clang::Init, clang::isExternallyVisible(), 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().
llvm::Constant * CodeGenModule::getOrCreateStaticVarDecl | ( | const VarDecl & | D, |
llvm::GlobalValue::LinkageTypes | Linkage | ||
) |
Definition at line 255 of file CGDecl.cpp.
References clang::Addr, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::Ctor_Base, D, clang::Dtor_Base, EmitNullConstant(), clang::QualType::getAddressSpace(), GetAddrOfGlobal(), getContext(), clang::GlobalDecl::getDecl(), clang::Decl::getDeclContext(), GetGlobalVarAddressSpace(), getLLVMContext(), getMangledName(), getModule(), clang::Decl::getNonClosureContext(), getStaticDeclName(), clang::ASTContext::getTargetAddressSpace(), getTargetCodeGenInfo(), getTypes(), clang::Decl::hasAttr(), clang::Init, clang::QualType::isConstant(), clang::Type::isConstantSizeType(), clang::opencl_local, clang::CodeGen::TargetCodeGenInfo::performAddrSpaceCast(), setGVProperties(), setStaticLocalDeclAddress(), clang::CodeGen::TargetCodeGenInfo::setTargetAttributes(), setTLSMode(), and supportsCOMDAT().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
|
inline |
Definition at line 758 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters(), and clang::CodeGen::CodeGenPGO::valueProfile().
|
inline |
Definition at line 757 of file CodeGenModule.h.
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().
CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForPointeeType | ( | QualType | type | ) |
Definition at line 170 of file CGPointerAuth.cpp.
References clang::T.
Referenced by emitPointerArithmetic(), clang::CodeGen::CodeGenFunction::getAsNaturalAddressOf(), and clang::CodeGen::CodeGenFunction::makeNaturalAddressForPointer().
CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType | ( | QualType | type | ) |
Definition at line 192 of file CGPointerAuth.cpp.
References clang::T.
Referenced by clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), and clang::CodeGen::CodeGenFunction::generateObjCSetterBody().
llvm::ConstantInt * CodeGenModule::getPointerAuthOtherDiscriminator | ( | const PointerAuthSchema & | Schema, |
GlobalDecl | SchemaDecl, | ||
QualType | SchemaType | ||
) |
Given a pointer-authentication schema, return a concrete "other" discriminator for it.
Definition at line 26 of file CGPointerAuth.cpp.
References clang::PointerAuthSchema::Constant, clang::PointerAuthSchema::Decl, clang::PointerAuthSchema::getConstantDiscrimination(), getContext(), clang::PointerAuthSchema::getOtherDiscrimination(), getPointerAuthDeclDiscriminator(), clang::CodeGen::getPointerAuthTypeDiscriminator(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::PointerAuthSchema::None, and clang::PointerAuthSchema::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitPointerAuthInfo(), getConstantSignedPointer(), getFunctionPointerAuthInfo(), and getMemberFunctionPointerAuthInfo().
|
inline |
Definition at line 828 of file CodeGenModule.h.
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 GetAddrOfFunction(), clang::GlobalDecl::getDecl(), clang::CodeGen::ConstantAddress::getPointer(), GetWeakRefReference(), clang::Decl::hasAttr(), and V.
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), EmitDirectCallee(), clang::CodeGen::CodeGenFunction::GenerateCode(), getFunctionPointer(), and getMemberFunctionPointer().
|
inline |
Definition at line 1538 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), clang::CodeGen::CodeGenFunction::EmitReturnStmt(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), and Release().
llvm::SanitizerStatReport & CodeGenModule::getSanStats | ( | ) |
Definition at line 7979 of file CodeGenModule.cpp.
References getModule().
Referenced by clang::CodeGen::CodeGenFunction::EmitSanitizerStatReport().
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 clang::CodeGen::ConstantAggregateBuilderBase::addSize(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CGOpenMPRuntime::emitDepobjDependClause(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitPointerArithmetic(), emitStructGetterCall(), emitStructSetterCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), and clang::CodeGen::CodeGenFunction::getTypeSize().
|
inline |
Definition at line 764 of file CodeGenModule.h.
References D.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPCopyinClause().
|
inline |
Definition at line 776 of file CodeGenModule.h.
References D.
|
inline |
Definition at line 836 of file CodeGenModule.h.
Referenced by AddDependentLib(), addLinkOptionsPostorder(), AppendCPUSpecificCPUDispatchMangling(), ApplyNonVirtualAndVirtualOffset(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), BuildAppleKextVirtualCall(), buildGlobalBlock(), clang::CodeGen::computeSPIRKernelABIInfo(), configureBlocksRuntimeObject(), CreateGlobalInitOrCleanUpFunction(), createTargetCodeGenInfo(), clang::CodeGen::CodeGenFunction::EmitAMDGPUDevicePrintfCallExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::CodeGenFunction::EmitCapturedLocals(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CGCXXABI::EmitCtorCompleteObjectHandler(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::CodeGen::CGDebugInfo::EmitFunctionDecl(), EmitGlobal(), clang::CodeGen::CodeGenFunction::EmitHLSLBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitInheritedCXXConstructorCall(), emitIsPlatformVersionAtLeast(), clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitSEHExceptionCodeSave(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CGDebugInfo::emitVTableSymbol(), clang::CodeGen::CodeGenFunction::EnterSEHTryStmt(), clang::CodeGen::CodeGenFunction::ExitSEHTryStmt(), clang::CodeGen::CGHLSLRuntime::finishCodeGen(), clang::CodeGen::EHPersonality::get(), getAddrAndTypeOfCXXStructor(), clang::CodeGen::CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(), GetAddrOfFunction(), getBuiltinLibFunction(), getCodegenToUse(), getCPUSpecificMangling(), GetGlobalConstantAddressSpace(), getMangledName(), getOffloadArch(), getTerminateFn(), getVtableGlobalVarAlignment(), getVTableLinkage(), handleAsDoubleBuiltin(), handleHlslClip(), handleHlslSplitdouble(), hasInAllocaArgs(), initializeForBlockHeader(), isThreadWrapperReplaceable(), isTrivialForMSVC(), clang::CodeGen::CodeGenVTables::isVTableExternal(), Release(), ReturnTypeUsesFP2Ret(), ReturnTypeUsesFPRet(), SetLLVMFunctionAttributes(), SetLLVMFunctionAttributesForDefinition(), shouldEmitVTableThunk(), ShouldUseExternalRTTIDescriptor(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), TryEmitBaseDestructorAsAlias(), and UseRelativeLayout().
const TargetCodeGenInfo & CodeGenModule::getTargetCodeGenInfo | ( | ) |
Definition at line 327 of file CodeGenModule.cpp.
References createTargetCodeGenInfo().
Referenced by AddDependentLib(), AddDetectMismatch(), addLinkOptionsPostorder(), arrangeFreeFunctionLikeCall(), clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CodeGenTypes::ClangCallConvToLLVMCallConv(), CodeGenModule(), computeBlockInfo(), clang::CodeGen::CGHLSLRuntime::convertHLSLSpecificType(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), clang::CodeGen::CodeGenTypes::ConvertType(), CreateGlobalInitOrCleanUpFunction(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitCall(), EmitDeclDestroy(), emitOptimizedARCReturnCall(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::CodeGenFunction::GenerateCode(), getABIInfo(), GetAddrOfGlobalTemporary(), getGenericBlockLiteralType(), GetGlobalVarAddressSpace(), getMangledNameImpl(), getNullPointer(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), clang::CodeGen::CGOpenCLRuntime::getPipeType(), getPrologueSignature(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), getSwiftABIInfo(), clang::CodeGen::CodeGenFunction::getTargetHooks(), getTBAAAccessInfo(), InitCatchParam(), initializeForBlockHeader(), Release(), ReturnSlotInterferesWithArgs(), setCUDAKernelCallingConvention(), and shouldEmitBuiltinAsIR().
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(), and clang::ASTContext::toCharUnitsFromBits().
Referenced by clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), clang::CodeGen::CGOpenMPRuntime::emitDeclareTargetFunction(), EmitVTableTypeMetadata(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), and clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate().
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 clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitArrayToPointerDecay(), emitLibraryCall(), clang::CodeGen::CodeGenFunction::EmitLoadOfReferenceLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), EmitPointerWithAlignment(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedLoad(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedStore(), getNaturalTypeAlignment(), getTBAAInfoForSubobject(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), and clang::CodeGen::CodeGenFunction::MakeRawAddrLValue().
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().
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.
Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField().
|
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 clang::CodeGen::CodeGenFunction::EmitArraySectionExpr(), clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForFieldInitialization(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), and loadToBegin().
llvm::MDNode * CodeGenModule::getTBAAStructInfo | ( | QualType | QTy | ) |
Definition at line 1658 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitAggregateCopy().
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.
Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField(), and clang::CodeGen::SanitizerMetadata::reportGlobal().
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.
Referenced by clang::CodeGen::CodeGenFunction::GetVTablePtr(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointer().
llvm::FunctionCallee CodeGenModule::getTerminateFn | ( | ) |
Get the declaration of std::terminate for the platform.
Definition at line 63 of file CGException.cpp.
References clang::CPlusPlus, CreateRuntimeFunction(), getCXXABI(), getLangOpts(), getTarget(), clang::ObjCRuntime::hasTerminate(), clang::LangOptionsBase::MSVC2015, clang::ObjC, and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by clang::CodeGen::CGCXXABI::emitTerminateForUnexpectedException(), and getClangCallTerminateFn().
|
inline |
Definition at line 837 of file CodeGenModule.h.
Referenced by AddDependentLib(), AddGlobalDtor(), addUsedOrCompilerUsedGlobal(), CodeGenModule(), clang::CodeGen::createPPC32TargetCodeGenInfo(), clang::CodeGen::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::CodeGen::CGOpenMPRuntime::emitDistributeStaticInit(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), EmitGlobal(), emitOptimizedARCReturnCall(), finishAndCreateGlobal(), GetAddrOfConstantCFString(), getBuiltinLibFunction(), GetGlobalConstantAddressSpace(), getLinkageTypeForObjCMetadata(), GetOrCreateLLVMGlobal(), getTypeInfoLinkage(), HasHiddenLTOVisibility(), Release(), setARCRuntimeFunctionLinkage(), SetLLVMFunctionAttributes(), SetLLVMFunctionAttributesForDefinition(), setWindowsItaniumDLLImport(), shouldAssumeDSOLocal(), shouldEmitConvergenceTokens(), shouldEmitRTTI(), ShouldUseExternalRTTIDescriptor(), supportsCOMDAT(), and TryEmitBaseDestructorAsAlias().
|
inline |
Definition at line 806 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor().
|
inline |
Definition at line 849 of file CodeGenModule.h.
Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), addX86InterruptAttrs(), clang::CodeGen::arrangeCXXMethodCall(), clang::CodeGen::arrangeCXXMethodType(), clang::CodeGen::arrangeFreeFunctionCall(), clang::CodeGen::arrangeFreeFunctionType(), clang::CodeGen::arrangeObjCMessageSendSignature(), clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), buildBlockDescriptor(), buildGlobalBlock(), canEmitDelegateCallArgs(), codegenCXXStructor(), CodeGenModule(), computeBlockInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), ConstructAttributeList(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::convertTypeForLoadStore(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::convertTypeForMemory(), clang::CodeGen::createAArch64TargetCodeGenInfo(), clang::CodeGen::createAIXTargetCodeGenInfo(), clang::CodeGen::createAMDGPUTargetCodeGenInfo(), clang::CodeGen::createARCTargetCodeGenInfo(), clang::CodeGen::createARMTargetCodeGenInfo(), clang::CodeGen::CodeGenFunction::createAtExitStub(), 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::CodeGenFunction::createTLSAtExitStub(), 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(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), emitAddrOfFieldStorage(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::emitBuiltinOSLogFormat(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), emitCombinerOrInitializer(), emitConstantObjCStringLiteral(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementLValue(), clang::CodeGen::ConstantEmitter::emitForMemory(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGlobal(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), EmitHipStdParUnsupportedBuiltin(), clang::CodeGen::CodeGenFunction::EmitHLSLBuiltinExpr(), clang::CodeGen::CGOpenMPRuntime::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfReference(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNewDeleteCall(), EmitNullConstant(), EmitNullConstant(), EmitNullConstantForBase(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitOMPCopyinClause(), clang::CodeGen::CodeGenFunction::EmitOMPLastprivateClauseFinal(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitPreserveStructAccess(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedLoad(), clang::CodeGen::CodeGenFunction::EmitSVEMaskedStore(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenFunction::generateAwaitSuspendWrapper(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::generateBuiltinOSLogHelperFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), getAddrAndTypeOfCXXStructor(), GetAddrOfConstantCFString(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfFunction(), GetAddrOfGlobal(), GetAddrOfGlobalTemporary(), GetAddrOfGlobalVar(), GetAddrOfMSGuidDecl(), getAllocatorVal(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), getBuiltinLibFunction(), getClangCallTerminateFn(), GetConstantArrayFromStringLiteral(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getGEPIndicesToField(), getGuardAcquireFn(), getInlineSpirvType(), clang::CodeGen::getLLVMFieldNumber(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), GetNonVirtualBaseClassOffset(), getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenFunction::getTypes(), GetWeakRefReference(), RefreshTypeCacheForClass(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), setUsedBits(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), TryEmitBaseDestructorAsAlias(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), and UpdateCompletedType().
|
inline |
Fetches the global unique block count.
Definition at line 1148 of file CodeGenModule.h.
Referenced by clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable().
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().
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(), clang::CXXRecordDecl::vbases(), and Visited.
Referenced by EmitVTableTypeMetadata(), and GetVCallVisibilityLevel().
llvm::Type * CodeGenModule::getVTableComponentType | ( | ) | const |
Definition at line 716 of file CGVTables.cpp.
References clang::CodeGen::CodeGenTypeCache::GlobalsInt8PtrTy, clang::CodeGen::CodeGenTypeCache::Int32Ty, and UseRelativeLayout().
Referenced by EmitVTableTypeMetadata(), and clang::CodeGen::CodeGenVTables::getVTableComponentType().
|
inline |
Definition at line 1820 of file CodeGenModule.h.
References D, GetGlobalVarAddressSpace(), getItaniumVTableContext(), clang::TargetInfo::getPointerAlign(), getTarget(), and clang::ItaniumVTableContext::isRelativeLayout().
Referenced by clang::CodeGen::CGDebugInfo::emitVTableSymbol().
llvm::GlobalVariable::LinkageTypes CodeGenModule::getVTableLinkage | ( | const CXXRecordDecl * | RD | ) |
Return the appropriate linkage for the vtable, VTT, and type information of the given class.
Compute the required linkage of the vtable for the given class.
Note that we only call this at the end of the translation unit.
Definition at line 1086 of file CGVTables.cpp.
References clang::ASTContext::getCurrentKeyFunction(), clang::TargetInfo::getCXXABI(), getCXXABI(), clang::ASTContext::getLangOpts(), getTarget(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::NamedDecl::isExternallyVisible(), clang::FunctionDecl::isInlined(), clang::Decl::isInNamedModule(), clang::TargetCXXABI::isMicrosoft(), shouldEmitAvailableExternallyVTable(), clang::Decl::shouldEmitInExternalSource(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by clang::CodeGen::CGDebugInfo::completeClassData(), getTypeIdentifier(), and getTypeInfoLinkage().
std::optional< PointerAuthQualifier > CodeGenModule::getVTablePointerAuthentication | ( | const CXXRecordDecl * | thisClass | ) |
Definition at line 614 of file CGPointerAuth.cpp.
Referenced by getVTablePointerAuthInfo().
std::optional< CGPointerAuthInfo > CodeGenModule::getVTablePointerAuthInfo | ( | CodeGenFunction * | Context, |
const CXXRecordDecl * | Record, | ||
llvm::Value * | StorageAddress | ||
) |
Definition at line 630 of file CGPointerAuth.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitPointerAuthBlendDiscriminator(), getVTablePointerAuthentication(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, and clang::SignAndAuth.
Referenced by clang::CodeGen::CodeGenFunction::GetVTablePtr(), and clang::CodeGen::CodeGenFunction::InitializeVTablePointer().
|
inline |
ConstantAddress CodeGenModule::GetWeakRefReference | ( | const ValueDecl * | VD | ) |
Get a reference to the target of VD.
Definition at line 3982 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::Default, clang::Decl::getAttr(), getContext(), clang::ASTContext::getDeclAlign(), GetGlobalValue(), GetOrCreateLLVMGlobal(), clang::ValueDecl::getType(), and getTypes().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and getRawFunctionPointer().
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 E, clang::Expr::EvaluateKnownConstInt(), getContext(), clang::Max, and clang::Min.
Referenced by clang::CodeGen::CGOpenMPRuntime::computeMinAndMaxThreadsAndTeams().
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.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper().
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().
Referenced by clang::CodeGen::CGOpenMPRuntime::computeMinAndMaxThreadsAndTeams().
void CodeGenModule::HandleCXXStaticMemberVarInstantiation | ( | VarDecl * | VD | ) |
Tell the consumer that this variable has been instantiated.
Definition at line 6311 of file CodeGenModule.cpp.
References clang::VarDecl::Definition, EmitTopLevelDecl(), GetAddrOfGlobalVar(), clang::VarDecl::getDefinition(), clang::VarDecl::getTemplateSpecializationKind(), clang::Decl::hasAttr(), clang::VarDecl::isThisDeclarationADefinition(), and clang::TSK_ExplicitInstantiationDefinition.
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 clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), GetVCallVisibilityLevel(), requiresMemberFunctionPointerTypeMetadata(), and clang::CodeGen::CodeGenFunction::ShouldEmitVTableTypeCheckedLoad().
|
inline |
Return true iff an Objective-C runtime has been configured.
Definition at line 718 of file CodeGenModule.h.
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 Category, getContext(), clang::ASTContext::getXRayFilter(), clang::SourceLocation::isValid(), and Loc.
Referenced by clang::CodeGen::CodeGenFunction::StartFunction().
ProfileList::ExclusionType CodeGenModule::isFunctionBlockedByProfileList | ( | llvm::Function * | Fn, |
SourceLocation | Loc | ||
) | const |
Fn
at Loc
should be excluded from profile instrumentation by the SCL passed by -fprofile-list
. Definition at line 3761 of file CodeGenModule.cpp.
References clang::ProfileList::Allow, getCodeGenOpts(), getContext(), clang::ProfileList::getDefault(), clang::ASTContext::getProfileList(), clang::ASTContext::getSourceManager(), clang::ProfileList::isEmpty(), clang::ProfileList::isFileExcluded(), clang::ProfileList::isFunctionExcluded(), clang::ProfileList::isLocationExcluded(), clang::SourceLocation::isValid(), Loc, SM, and V.
Referenced by isFunctionBlockedFromProfileInstr().
ProfileList::ExclusionType CodeGenModule::isFunctionBlockedFromProfileInstr | ( | llvm::Function * | Fn, |
SourceLocation | Loc | ||
) | const |
Fn
at Loc
should be excluded from profile instrumentation. Definition at line 3785 of file CodeGenModule.cpp.
References clang::ProfileList::Allow, getCodeGenOpts(), isFunctionBlockedByProfileList(), Loc, clang::ProfileList::Skip, and V.
Referenced by clang::CodeGen::CodeGenFunction::StartFunction().
bool CodeGenModule::isInNoSanitizeList | ( | SanitizerMask | Kind, |
llvm::Function * | Fn, | ||
SourceLocation | Loc | ||
) | const |
Definition at line 3682 of file CodeGenModule.cpp.
References getContext(), clang::FileEntryRef::getName(), clang::ASTContext::getNoSanitizeList(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isValid(), Loc, and SM.
Referenced by CreateGlobalInitOrCleanUpFunction(), and clang::CodeGen::SanitizerMetadata::reportGlobal().
bool CodeGenModule::isInNoSanitizeList | ( | SanitizerMask | Kind, |
llvm::GlobalVariable * | GV, | ||
SourceLocation | Loc, | ||
QualType | Ty, | ||
StringRef | Category = StringRef() |
||
) | const |
Definition at line 3702 of file CodeGenModule.cpp.
References Category, clang::QualType::getAsString(), clang::QualType::getCanonicalType(), getContext(), clang::ASTContext::getNoSanitizeList(), clang::ASTContext::getSourceManager(), clang::QualType::getTypePtr(), clang::QualType::getUnqualifiedType(), clang::QualType::isNull(), clang::Type::isRecordType(), Loc, and SM.
bool CodeGenModule::isPaddedAtomicType | ( | const AtomicType * | type | ) |
Definition at line 787 of file CodeGenTypes.cpp.
References clang::ASTContext::getTypeSize(), and clang::ast_matchers::type.
Definition at line 783 of file CodeGenTypes.cpp.
References isPaddedAtomicType(), and clang::ast_matchers::type.
Referenced by isPaddedAtomicType().
bool CodeGenModule::lookupRepresentativeDecl | ( | StringRef | MangledName, |
GlobalDecl & | Result | ||
) | const |
Definition at line 7773 of file CodeGenModule.cpp.
References clang::Result.
Referenced by GetOrCreateLLVMGlobal().
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, D, clang::First, getLangOpts(), and clang::Internal.
void CodeGenModule::maybeSetTrivialComdat | ( | const Decl & | D, |
llvm::GlobalObject & | GO | ||
) |
Definition at line 5729 of file CodeGenModule.cpp.
References D, and shouldBeInCOMDAT().
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 1894 of file CGCall.cpp.
References clang::Type::getAsCanonical(), clang::QualType::getCanonicalType(), and clang::QualType::isTriviallyCopyableType().
Referenced by clang::CodeGen::CodeGenFunction::GenerateCode().
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().
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.
Referenced by clang::CodeGen::CodeGenFunction::EmitConditionalOperatorLValue().
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.
Referenced by clang::CodeGen::CodeGenFunction::EmitAggregateCopy().
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 8132 of file CodeGenModule.cpp.
bool CodeGenModule::NeedAllVtablesTypeId | ( | ) | const |
Returns whether this module needs the "all-vtables" type identifier.
Definition at line 7948 of file CodeGenModule.cpp.
References clang::SanitizerSet::has(), clang::LangOptions::Sanitize, and clang::CodeGenOptions::SanitizeTrap.
Referenced by AddVTableTypeMetadata().
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 8094 of file CodeGenModule.cpp.
References clang::LangOptions::CUID, D, getContext(), clang::ASTContext::getCUIDHash(), clang::PresumedLoc::getFilename(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getSourceManager(), clang::PresumedLoc::isValid(), clang::PreprocessorOptions::Macros, clang::Result, and SM.
Referenced by getMangledNameImpl().
void CodeGenModule::RefreshTypeCacheForClass | ( | const CXXRecordDecl * | Class | ) |
Definition at line 1621 of file CodeGenModule.cpp.
References getTypes(), and clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass().
void CodeGenModule::Release | ( | ) |
Finalize LLVM code generation.
Definition at line 957 of file CodeGenModule.cpp.
References addCompilerUsedGlobal(), AddGlobalCtor(), clang::CodeGenOptions::All, clang::ASTContext::CUDAExternalDeviceDeclODRUsedByHost, D, 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(), clang::CodeGenOptions::FP32DenormalMode, GetAddrOfGlobal(), clang::getCFBranchLabelSchemeFlagVal(), clang::getClangVendor(), getCodeGenOpts(), getContext(), clang::ASTContext::getCurrentNamedModule(), getDiags(), clang::Decl::getEndLoc(), GetGlobalValue(), getHLSLRuntime(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::LangStandard::getLangStandardForKind(), getLLVMContext(), getMangledName(), getModule(), getModuleDebugInfo(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::CharUnits::getQuantity(), getSanitizerMetadata(), getTarget(), getTargetCodeGenInfo(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTargetOpts(), clang::TargetInfo::getTriple(), getTriple(), clang::ASTContext::getTypeSizeInChars(), clang::ASTContext::getWideCharType(), clang::SanitizerSet::has(), clang::CodeGen::InstrProfStats::hasDiagnostics(), clang::TargetInfo::hasFeature(), clang::LangOptions::hasSignReturnAddress(), clang::TargetOptions::Hostcall, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::CodeGenTypeCache::Int8Ty, INT_MAX, clang::Module::isHeaderLikeModule(), clang::Module::isInterfaceOrPartition(), clang::LangOptions::isSignReturnAddressScopeAll(), clang::LangOptions::isSignReturnAddressWithAKey(), clang::Kernel, clang::LangOptions::LangStd, clang::LangStandard::Language, clang::languageToString(), clang::CodeGen::CodeGenModule::Structor::LexOrder, clang::CodeGenOptions::MemoryProfileOutput, clang::CodeGenOptions::None, clang::LangOptionsBase::None, clang::CodeGenOptions::NonLeaf, clang::DiagnosticsEngine::Report(), clang::CodeGen::InstrProfStats::reportDiagnostics(), clang::CodeGenOptions::Reserved, clang::LangOptions::Sanitize, clang::CodeGen::CodeGenPGO::setProfileVersion(), clang::CodeGen::CodeGenPGO::setValueProfilingFlag(), setVisibilityFromDLLStorageClass(), clang::PreprocessorOptions::SourceDateEpoch, clang::T, and clang::CodeGenOptions::UniqueSourceFileIdentifier.
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 1664 of file CGCall.cpp.
References clang::CodeGen::TargetCodeGenInfo::doesReturnSlotInterfereWithArgs(), getTargetCodeGenInfo(), and ReturnTypeUsesSRet().
Referenced by clang::CodeGen::CodeGenFunction::GenerateBlockFunction().
bool CodeGenModule::ReturnTypeHasInReg | ( | const CGFunctionInfo & | FI | ) |
Return true iff the given type has inreg
set.
Definition at line 1659 of file CGCall.cpp.
References clang::CodeGen::ABIArgInfo::getInReg(), and clang::CodeGen::CGFunctionInfo::getReturnInfo().
Return true iff the given type uses 'fp2ret' when used as a return type.
Definition at line 1686 of file CGCall.cpp.
References clang::Type::getAs(), getTarget(), and clang::TargetInfo::useObjCFP2RetForComplexLongDouble().
Return true iff the given type uses 'fpret' when used as a return type.
Definition at line 1669 of file CGCall.cpp.
References clang::Double, clang::Float, clang::Type::getAs(), getTarget(), clang::LongDouble, and clang::TargetInfo::useObjCFPRetForRealType().
bool CodeGenModule::ReturnTypeUsesSRet | ( | const CGFunctionInfo & | FI | ) |
Return true iff the given type uses 'sret' when used as a return type.
Definition at line 1654 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::getReturnInfo(), and clang::CodeGen::ABIArgInfo::isIndirect().
Referenced by clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), and ReturnSlotInterferesWithArgs().
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.
References Loc, and clang::StackExhaustionHandler::runWithSufficientStackSpace().
Referenced by clang::CodeGen::CodeGenFunction::EmitLValue().
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.
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().
|
inline |
Definition at line 801 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction().
|
inline |
Set the current Atomic options.
Definition at line 706 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::CGAtomicOptionsRAII::CGAtomicOptionsRAII(), and clang::CodeGen::CodeGenFunction::CGAtomicOptionsRAII::~CGAtomicOptionsRAII().
|
inline |
Definition at line 793 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction().
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(), D, clang::GlobalDecl::getDecl(), clang::Decl::hasAttr(), clang::SD_Static, clang::SD_Thread, and setGVProperties().
Referenced by emitConstructorDestructorAlias(), and TryEmitBaseDestructorAsAlias().
void CodeGenModule::setDLLImportDLLExport | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 1913 of file CodeGenModule.cpp.
References D, clang::Decl::hasAttr(), and shouldMapVisibilityToDLLExport().
void CodeGenModule::setDLLImportDLLExport | ( | llvm::GlobalValue * | GV, |
GlobalDecl | D | ||
) | const |
Definition at line 1902 of file CodeGenModule.cpp.
References D, getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CGCXXABI::setCXXDestructorDLLStorage(), and setDLLImportDLLExport().
Referenced by clang::CodeGen::CGCXXABI::setCXXDestructorDLLStorage(), setDLLImportDLLExport(), and setGVProperties().
void CodeGenModule::setDSOLocal | ( | llvm::GlobalValue * | GV | ) | const |
Definition at line 1898 of file CodeGenModule.cpp.
References shouldAssumeDSOLocal().
Referenced by configureBlocksRuntimeObject(), CreateRuntimeFunction(), CreateRuntimeVariable(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), GenerateStringLiteral(), GetAddrOfConstantCFString(), GetAddrOfMSGuidDecl(), and setGVPropertiesAux().
|
inline |
Definition at line 1465 of file CodeGenModule.h.
References getFunctionLinkage().
Referenced by codegenCXXStructor(), and setThunkProperties().
void CodeGenModule::setGlobalVisibility | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Set the visibility for the given LLVM GlobalValue.
Definition at line 1744 of file CodeGenModule.cpp.
References D, clang::DefaultVisibility, clang::Decl::getAttr(), getDiags(), clang::ASTContext::getLangOpts(), getLangOpts(), GetLLVMVisibility(), clang::Decl::getLocation(), clang::LinkageInfo::getVisibility(), clang::Decl::hasAttr(), clang::HiddenVisibility, clang::Decl::isInExportDeclContext(), clang::LinkageInfo::isVisibilityExplicit(), and clang::DiagnosticsEngine::Report().
Referenced by setGVPropertiesAux().
void CodeGenModule::setGVProperties | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 1931 of file CodeGenModule.cpp.
References D, setDLLImportDLLExport(), and setGVPropertiesAux().
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 clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), GetAddrOfGlobalTemporary(), GetAddrOfTemplateParamObject(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), GetOrCreateLLVMGlobal(), getOrCreateStaticVarDecl(), SetCommonAttributes(), and setThunkProperties().
void CodeGenModule::setGVPropertiesAux | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 1937 of file CodeGenModule.cpp.
References D, setDSOLocal(), setGlobalVisibility(), and clang::CodeGenOptions::SymbolPartition.
Referenced by setGVProperties().
void CodeGenModule::SetInternalFunctionAttributes | ( | GlobalDecl | GD, |
llvm::Function * | F, | ||
const CGFunctionInfo & | FI | ||
) |
Set the attributes on the LLVM function for the given decl and function info.
This applies attributes necessary for handling the ABI as well as user specified attributes like section.
Definition at line 3011 of file CodeGenModule.cpp.
References D, clang::GlobalDecl::getDecl(), SetLLVMFunctionAttributes(), and SetLLVMFunctionAttributesForDefinition().
Referenced by CreateGlobalInitOrCleanUpFunction(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), setBlockHelperAttributesVisibility(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper().
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().
void CodeGenModule::SetLLVMFunctionAttributes | ( | GlobalDecl | GD, |
const CGFunctionInfo & | Info, | ||
llvm::Function * | F, | ||
bool | IsThunk | ||
) |
Set the LLVM function attributes (sext, zext, etc).
Definition at line 2399 of file CodeGenModule.cpp.
References ConstructAttributeList(), D, clang::GlobalDecl::getDecl(), clang::Decl::getLocation(), getTarget(), getTriple(), and Loc.
Referenced by CreateGlobalInitOrCleanUpFunction(), CreateRuntimeFunction(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::generateBuiltinOSLogHelperFunction(), getClangCallTerminateFn(), setBlockHelperAttributesVisibility(), SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().
void CodeGenModule::SetLLVMFunctionAttributesForDefinition | ( | const Decl * | D, |
llvm::Function * | F | ||
) |
Set the LLVM function attributes which only apply to a function definition.
Definition at line 2656 of file CodeGenModule.cpp.
References createFunctionTypeMetadataForIcall(), CreateMetadataIdentifierForType(), D, clang::Decl::getAttr(), clang::ASTContext::getCharWidth(), getContext(), getCXXABI(), getDataLayout(), getLangOpts(), clang::Decl::getMaxAlignment(), clang::ASTContext::getMemberPointerType(), getMostBaseClasses(), getTarget(), clang::FunctionDecl::getTemplateInstantiationPattern(), getTriple(), clang::GVA_AvailableExternally, clang::Decl::hasAttr(), hasUnwindExceptions(), clang::HLSL, Id, clang::FunctionDecl::isInlined(), isStackProtectorOn(), clang::CodeGenOptions::OnlyAlwaysInlining, clang::CodeGenOptions::OnlyHintInlining, clang::Redeclarable< decl_type >::redecls(), requiresMemberFunctionPointerTypeMetadata(), clang::LangOptionsBase::SSPOn, clang::LangOptionsBase::SSPReq, and clang::LangOptionsBase::SSPStrong.
Referenced by codegenCXXStructor(), CreateGlobalInitOrCleanUpFunction(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), clang::CodeGen::CodeGenFunction::generateBuiltinOSLogHelperFunction(), getClangCallTerminateFn(), setBlockHelperAttributesVisibility(), SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().
void clang::CodeGen::CodeGenModule::setLLVMFunctionFEnvAttributes | ( | const FunctionDecl * | D, |
llvm::Function * | F | ||
) |
Set the LLVM function attributes that represent floating point environment.
|
inline |
Definition at line 767 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), and getOrCreateStaticVarDecl().
|
inline |
Definition at line 779 of file CodeGenModule.h.
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 D, clang::Decl::getAttr(), GetDefaultLLVMTLSModel(), and GetLLVMTLSModel().
Referenced by GetAddrOfGlobalTemporary(), GetOrCreateLLVMGlobal(), and getOrCreateStaticVarDecl().
|
inline |
Definition at line 809 of file CodeGenModule.h.
References clang::C.
Referenced by clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor().
|
inline |
Definition at line 1757 of file CodeGenModule.h.
References getTriple().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCXXAggrConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(), clang::CodeGen::CodeGenFunction::EmitDoStmt(), clang::CodeGen::CGHLSLRuntime::emitEntryFunction(), clang::CodeGen::CodeGenFunction::EmitForStmt(), clang::CodeGen::CodeGenFunction::EmitWhileStmt(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalCleanUpFunc(), clang::CodeGen::CGHLSLRuntime::getConvergenceToken(), and clang::CodeGen::CodeGenFunction::StartFunction().
Definition at line 1081 of file CodeGenModule.h.
References getLangOpts(), getTriple(), and clang::LangOptions::isTargetDevice().
Referenced by GetAddrOfRTTIDescriptor().
|
inline |
Definition at line 931 of file CodeGenModule.h.
References D, clang::DefaultVisibility, getLangOpts(), clang::LangOptions::hasDefaultVisibilityExportMapping(), clang::LangOptions::isAllDefaultVisibilityExportMapping(), and clang::LangOptions::isExplicitDefaultVisibilityExportMapping().
Referenced by setDLLImportDLLExport().
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 clang::CodeGen::ConstantAggregateBuilderBase::addSignedPointer(), and getConstantSignedPointer().
|
inline |
Definition at line 845 of file CodeGenModule.h.
|
inline |
Definition at line 1768 of file CodeGenModule.h.
References getLangOpts().
bool CodeGenModule::stopAutoInit | ( | ) |
Definition at line 8069 of file CodeGenModule.cpp.
References getContext(), clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getLangOpts(), clang::DiagnosticsEngine::Report(), clang::DiagnosticsEngine::Warning, and clang::LangOptionsBase::Zero.
Referenced by initializeAlloca().
bool CodeGenModule::supportsCOMDAT | ( | ) | const |
Definition at line 5725 of file CodeGenModule.cpp.
References getTriple().
Referenced by buildBlockDescriptor(), CreateOrReplaceCXXRuntimeVariable(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), GenerateStringLiteral(), GetAddrOfGlobalTemporary(), GetAddrOfMSGuidDecl(), GetAddrOfTemplateParamObject(), getClangCallTerminateFn(), getOrCreateStaticVarDecl(), setThunkProperties(), and shouldBeInCOMDAT().
bool CodeGenModule::TryEmitBaseDestructorAsAlias | ( | const CXXDestructorDecl * | D | ) |
Try to emit a base destructor as an alias to its primary base-class destructor.
Definition at line 32 of file CGCXX.cpp.
References addReplacement(), clang::AliasDecl, clang::Type::castAs(), clang::Class, D, clang::Dtor_Base, GetAddrOfGlobal(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::FunctionType::getCallConv(), getCodeGenOpts(), clang::GlobalDecl::getDecl(), clang::CXXRecordDecl::getDestructor(), getFunctionLinkage(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), getMangledName(), getModule(), getTarget(), getTriple(), clang::ValueDecl::getType(), getTypes(), clang::Decl::hasAttr(), clang::CharUnits::isZero(), and SetCommonAttributes().
void CodeGenModule::UpdateCompletedType | ( | const TagDecl * | TD | ) |
Definition at line 1616 of file CodeGenModule.cpp.
References getTypes(), and clang::CodeGen::CodeGenTypes::UpdateCompletedType().
llvm::FoldingSet<BlockByrefHelpers> clang::CodeGen::CodeGenModule::ByrefHelpersCache |
Definition at line 1145 of file CodeGenModule.h.
Referenced by buildByrefHelpers().
int clang::CodeGen::CodeGenModule::GlobalUniqueCount |
Definition at line 638 of file CodeGenModule.h.
llvm::FunctionCallee clang::CodeGen::CodeGenModule::IsOSVersionAtLeastFn = nullptr |
Definition at line 753 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable().
llvm::FunctionCallee clang::CodeGen::CodeGenModule::IsPlatformVersionAtLeastFn = nullptr |
Definition at line 755 of file CodeGenModule.h.
Referenced by emitIsPlatformVersionAtLeast().