clang
19.0.0git
|
This class organizes the cross-function state that is used while generating LLVM code. More...
#include "/home/runner/work/llvm/llvm/repo/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. More... | |
bool | getExpressionLocationsEnabled () const |
Return true if we should emit location information for expressions. More... | |
CGObjCRuntime & | getObjCRuntime () |
Return a reference to the configured Objective-C runtime. More... | |
bool | hasObjCRuntime () |
Return true iff an Objective-C runtime has been configured. More... | |
const std::string & | getModuleNameHash () const |
CGOpenCLRuntime & | getOpenCLRuntime () |
Return a reference to the configured OpenCL runtime. More... | |
CGOpenMPRuntime & | getOpenMPRuntime () |
Return a reference to the configured OpenMP runtime. More... | |
CGCUDARuntime & | getCUDARuntime () |
Return a reference to the configured CUDA runtime. More... | |
CGSYCLRuntime & | getSYCLRuntime () |
Return a reference to the configured SYCL runtime. More... | |
CGHLSLRuntime & | getHLSLRuntime () |
Return a reference to the configured HLSL runtime. More... | |
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) |
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. More... | |
TBAAAccessInfo | getTBAAAccessInfo (QualType AccessType) |
getTBAAAccessInfo - Get TBAA information that describes an access to an object of the given type. More... | |
TBAAAccessInfo | getTBAAVTablePtrAccessInfo (llvm::Type *VTablePtrType) |
getTBAAVTablePtrAccessInfo - Get the TBAA information that describes an access to a virtual table pointer. More... | |
llvm::MDNode * | getTBAAStructInfo (QualType QTy) |
llvm::MDNode * | getTBAABaseTypeInfo (QualType QTy) |
getTBAABaseTypeInfo - Get metadata that describes the given base access type. More... | |
llvm::MDNode * | getTBAAAccessTagInfo (TBAAAccessInfo Info) |
getTBAAAccessTagInfo - Get TBAA tag for a given memory access. More... | |
TBAAAccessInfo | mergeTBAAInfoForCast (TBAAAccessInfo SourceInfo, TBAAAccessInfo TargetInfo) |
mergeTBAAInfoForCast - Get merged TBAA information for the purposes of type casts. More... | |
TBAAAccessInfo | mergeTBAAInfoForConditionalOperator (TBAAAccessInfo InfoA, TBAAAccessInfo InfoB) |
mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the purposes of conditional operator. More... | |
TBAAAccessInfo | mergeTBAAInfoForMemoryTransfer (TBAAAccessInfo DestInfo, TBAAAccessInfo SrcInfo) |
mergeTBAAInfoForMemoryTransfer - Get merged TBAA information for the purposes of memory transfer calls. More... | |
TBAAAccessInfo | getTBAAInfoForSubobject (LValue Base, QualType AccessType) |
getTBAAInfoForSubobject - Get TBAA information for an access with a given base lvalue. More... | |
bool | isPaddedAtomicType (QualType type) |
bool | isPaddedAtomicType (const AtomicType *type) |
void | DecorateInstructionWithTBAA (llvm::Instruction *Inst, TBAAAccessInfo TBAAInfo) |
DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag. More... | |
void | DecorateInstructionWithInvariantGroup (llvm::Instruction *I, const CXXRecordDecl *RD) |
Adds !invariant.barrier !tag to instruction. More... | |
llvm::ConstantInt * | getSize (CharUnits numChars) |
Emit the given number of characters as a value of type size_t. More... | |
void | setGlobalVisibility (llvm::GlobalValue *GV, const NamedDecl *D) const |
Set the visibility for the given LLVM GlobalValue. More... | |
void | setDSOLocal (llvm::GlobalValue *GV) const |
bool | shouldMapVisibilityToDLLExport (const NamedDecl *D) const |
void | setDLLImportDLLExport (llvm::GlobalValue *GV, GlobalDecl D) const |
void | setDLLImportDLLExport (llvm::GlobalValue *GV, const NamedDecl *D) const |
void | setGVProperties (llvm::GlobalValue *GV, GlobalDecl GD) const |
Set visibility, dllimport/dllexport and dso_local. More... | |
void | setGVProperties (llvm::GlobalValue *GV, const NamedDecl *D) const |
void | setGVPropertiesAux (llvm::GlobalValue *GV, const NamedDecl *D) const |
void | setTLSMode (llvm::GlobalValue *GV, const VarDecl &D) const |
Set the TLS mode for the given LLVM GlobalValue for the thread-local variable declaration D. More... | |
llvm::GlobalVariable::ThreadLocalMode | GetDefaultLLVMTLSModel () const |
Get LLVM TLS mode from CodeGenOptions. More... | |
llvm::Constant * | GetAddrOfGlobal (GlobalDecl GD, ForDefinition_t IsForDefinition=NotForDefinition) |
llvm::GlobalVariable * | CreateOrReplaceCXXRuntimeVariable (StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage, llvm::Align Alignment) |
Will return a global variable of the given type. More... | |
llvm::Function * | CreateGlobalInitOrCleanUpFunction (llvm::FunctionType *ty, const Twine &name, const CGFunctionInfo &FI, SourceLocation Loc=SourceLocation(), bool TLS=false, llvm::GlobalVariable::LinkageTypes Linkage=llvm::GlobalVariable::InternalLinkage) |
LangAS | GetGlobalVarAddressSpace (const VarDecl *D) |
Return the AST address space of the underlying global variable for D, as determined by its declaration. More... | |
LangAS | GetGlobalConstantAddressSpace () const |
Return the AST address space of constant literal, which is used to emit the constant literal as global variable in LLVM IR. More... | |
llvm::Constant * | GetAddrOfGlobalVar (const VarDecl *D, llvm::Type *Ty=nullptr, ForDefinition_t IsForDefinition=NotForDefinition) |
Return the llvm::Constant for the address of the given global variable. More... | |
llvm::Constant * | GetAddrOfFunction (GlobalDecl GD, llvm::Type *Ty=nullptr, bool ForVTable=false, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition) |
Return the address of the given function. More... | |
llvm::Constant * | GetFunctionStart (const ValueDecl *Decl) |
bool | shouldEmitRTTI (bool ForEH=false) |
llvm::Constant * | GetAddrOfRTTIDescriptor (QualType Ty, bool ForEH=false) |
Get the address of the RTTI descriptor for the given type. More... | |
ConstantAddress | GetAddrOfMSGuidDecl (const MSGuidDecl *GD) |
Get the address of a GUID. More... | |
ConstantAddress | GetAddrOfUnnamedGlobalConstantDecl (const UnnamedGlobalConstantDecl *GCD) |
Get the address of a UnnamedGlobalConstant. More... | |
ConstantAddress | GetAddrOfTemplateParamObject (const TemplateParamObjectDecl *TPO) |
Get the address of a template parameter object. More... | |
llvm::Constant * | GetAddrOfThunk (StringRef Name, llvm::Type *FnTy, GlobalDecl GD) |
Get the address of the thunk for the given global decl. More... | |
ConstantAddress | GetWeakRefReference (const ValueDecl *VD) |
Get a reference to the target of VD. More... | |
CharUnits | getClassPointerAlignment (const CXXRecordDecl *CD) |
Returns the assumed alignment of an opaque pointer to the given class. More... | |
CharUnits | getMinimumClassObjectSize (const CXXRecordDecl *CD) |
Returns the minimum object size for an object of the given class type (or a class derived from it). More... | |
CharUnits | getMinimumObjectSize (QualType Ty) |
Returns the minimum object size for an object of the given type. More... | |
CharUnits | getVBaseAlignment (CharUnits DerivedAlign, const CXXRecordDecl *Derived, const CXXRecordDecl *VBase) |
Returns the assumed alignment of a virtual base of a class. More... | |
CharUnits | getDynamicOffsetAlignment (CharUnits ActualAlign, const CXXRecordDecl *Class, CharUnits ExpectedTargetAlign) |
Given a class pointer with an actual known alignment, and the expected alignment of an object at a dynamic offset w.r.t that pointer, return the alignment to assume at the offset. More... | |
CharUnits | computeNonVirtualBaseClassOffset (const CXXRecordDecl *DerivedClass, CastExpr::path_const_iterator Start, CastExpr::path_const_iterator End) |
llvm::Constant * | GetNonVirtualBaseClassOffset (const CXXRecordDecl *ClassDecl, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd) |
Returns the offset from a derived class to a class. More... | |
int | getUniqueBlockCount () |
Fetches the global unique block count. More... | |
llvm::Type * | getBlockDescriptorType () |
Fetches the type of a generic block descriptor. More... | |
llvm::Type * | getGenericBlockLiteralType () |
The type of a generic block literal. More... | |
llvm::Constant * | GetAddrOfGlobalBlock (const BlockExpr *BE, StringRef Name) |
Gets the address of a block which requires no captures. More... | |
llvm::Constant * | getAddrOfGlobalBlockIfEmitted (const BlockExpr *BE) |
Returns the address of a block which requires no caputres, or null if we've yet to emit the block for BE. More... | |
void | setAddrOfGlobalBlock (const BlockExpr *BE, llvm::Constant *Addr) |
Notes that BE's global block is available via Addr. More... | |
ConstantAddress | GetAddrOfConstantCFString (const StringLiteral *Literal) |
Return a pointer to a constant CFString object for the given string. More... | |
llvm::Constant * | GetConstantArrayFromStringLiteral (const StringLiteral *E) |
Return a constant array for the given string. More... | |
ConstantAddress | GetAddrOfConstantStringFromLiteral (const StringLiteral *S, StringRef Name=".str") |
Return a pointer to a constant array for the given string literal. More... | |
ConstantAddress | GetAddrOfConstantStringFromObjCEncode (const ObjCEncodeExpr *) |
Return a pointer to a constant array for the given ObjCEncodeExpr node. More... | |
ConstantAddress | GetAddrOfConstantCString (const std::string &Str, const char *GlobalName=nullptr) |
Returns a pointer to a character array containing the literal and a terminating '\0' character. More... | |
ConstantAddress | GetAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *E) |
Returns a pointer to a constant global variable for the given file-scope compound literal expression. More... | |
llvm::GlobalVariable * | getAddrOfConstantCompoundLiteralIfEmitted (const CompoundLiteralExpr *E) |
If it's been emitted already, returns the GlobalVariable corresponding to a compound literal. More... | |
void | setAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *CLE, llvm::GlobalVariable *GV) |
Notes that CLE's GlobalVariable is GV. More... | |
ConstantAddress | GetAddrOfGlobalTemporary (const MaterializeTemporaryExpr *E, const Expr *Inner) |
Returns a pointer to a global variable representing a temporary with static or thread storage duration. More... | |
QualType | getObjCFastEnumerationStateType () |
Retrieve the record type that describes the state of an Objective-C fast enumeration loop (for..in). More... | |
llvm::Function * | codegenCXXStructor (GlobalDecl GD) |
llvm::Constant * | getAddrOfCXXStructor (GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition) |
Return the address of the constructor/destructor of the given type. More... | |
llvm::FunctionCallee | getAddrAndTypeOfCXXStructor (GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition) |
void | addTypeWithAspects (StringRef TypeName, const RecordDecl *RD) |
void | setAspectsEnumDecl (const EnumDecl *ED) |
void | generateIntelFPGAAnnotation (const Decl *D, llvm::SmallString< 256 > &AnnotStr) |
void | addGlobalIntelFPGAAnnotation (const VarDecl *VD, llvm::GlobalValue *GV) |
llvm::Constant * | getBuiltinLibFunction (const FunctionDecl *FD, unsigned BuiltinID) |
Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf". More... | |
llvm::Function * | getIntrinsic (unsigned IID, ArrayRef< llvm::Type * > Tys=std::nullopt) |
void | EmitTopLevelDecl (Decl *D) |
Emit code for a single top level declaration. More... | |
void | AddDeferredUnusedCoverageMapping (Decl *D) |
Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration. More... | |
void | ClearUnusedCoverageMapping (const Decl *D) |
Remove the deferred empty coverage mapping as this declaration is actually instrumented. More... | |
void | EmitDeferredUnusedCoverageMappings () |
Emit all the deferred coverage mappings for the uninstrumented functions. More... | |
void | EmitMainVoidAlias () |
Emit an alias for "main" if it has no arguments (needed for wasm). More... | |
void | HandleCXXStaticMemberVarInstantiation (VarDecl *VD) |
Tell the consumer that this variable has been instantiated. More... | |
template<typename SomeDecl > | |
void | MaybeHandleStaticInExternC (const SomeDecl *D, llvm::GlobalValue *GV) |
If the declaration has internal linkage but is inside an extern "C" linkage specification, prepare to emit an alias for it to the expected name. More... | |
void | addUsedGlobal (llvm::GlobalValue *GV) |
Add a global to a list to be added to the llvm.used metadata. More... | |
void | addCompilerUsedGlobal (llvm::GlobalValue *GV) |
Add a global to a list to be added to the llvm.compiler.used metadata. More... | |
void | addUsedOrCompilerUsedGlobal (llvm::GlobalValue *GV) |
Add a global to a list to be added to the llvm.compiler.used metadata. More... | |
void | AddCXXDtorEntry (llvm::FunctionCallee DtorFn, llvm::Constant *Object) |
Add a destructor and object to add to the C++ global destructor function. More... | |
void | AddCXXStermFinalizerEntry (llvm::FunctionCallee DtorFn) |
Add an sterm finalizer to the C++ global cleanup function. More... | |
void | AddCXXStermFinalizerToGlobalDtor (llvm::Function *StermFinalizer, int Priority) |
Add an sterm finalizer to its own llvm.global_dtors entry. More... | |
void | AddCXXPrioritizedStermFinalizerEntry (llvm::Function *StermFinalizer, int Priority) |
llvm::FunctionCallee | CreateRuntimeFunction (llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs=llvm::AttributeList(), bool Local=false, bool AssumeConvergent=false) |
Create or return a runtime function declaration with the specified type and name. More... | |
llvm::Constant * | CreateRuntimeVariable (llvm::Type *Ty, StringRef Name) |
Create a new runtime global variable with the specified type and name. More... | |
llvm::Function * | getLLVMLifetimeStartFn () |
Lazily declare the @llvm.lifetime.start intrinsic. More... | |
llvm::Function * | getLLVMLifetimeEndFn () |
Lazily declare the @llvm.lifetime.end intrinsic. More... | |
void | UpdateCompletedType (const TagDecl *TD) |
llvm::Constant * | getMemberPointerConstant (const UnaryOperator *e) |
void | EmitExplicitCastExprType (const ExplicitCastExpr *E, CodeGenFunction *CGF=nullptr) |
Emit type info if type of an expression is a variably modified type. More... | |
llvm::Constant * | EmitNullConstant (QualType T) |
Return the result of value-initializing the given type, i.e. More... | |
llvm::Constant * | EmitNullConstantForBase (const CXXRecordDecl *Record) |
Return a null constant appropriate for zero-initializing a base class with the given type. More... | |
void | Error (SourceLocation loc, StringRef error) |
Emit a general error that something can't be done. More... | |
void | ErrorUnsupported (const Stmt *S, const char *Type) |
Print out an error that codegen doesn't support the specified stmt yet. More... | |
void | ErrorUnsupported (const Decl *D, const char *Type) |
Print out an error that codegen doesn't support the specified decl yet. More... | |
void | SetInternalFunctionAttributes (GlobalDecl GD, llvm::Function *F, const CGFunctionInfo &FI) |
Set the attributes on the LLVM function for the given decl and function info. More... | |
void | SetLLVMFunctionAttributes (GlobalDecl GD, const CGFunctionInfo &Info, llvm::Function *F, bool IsThunk) |
Set the LLVM function attributes (sext, zext, etc). More... | |
void | SetLLVMFunctionAttributesForDefinition (const Decl *D, llvm::Function *F) |
Set the LLVM function attributes which only apply to a function definition. More... | |
void | setLLVMFunctionFEnvAttributes (const FunctionDecl *D, llvm::Function *F) |
Set the LLVM function attributes that represent floating point environment. More... | |
bool | ReturnTypeUsesSRet (const CGFunctionInfo &FI) |
Return true iff the given type uses 'sret' when used as a return type. More... | |
bool | ReturnTypeHasInReg (const CGFunctionInfo &FI) |
Return true iff the given type has inreg set. More... | |
bool | ReturnSlotInterferesWithArgs (const CGFunctionInfo &FI) |
Return true iff the given type uses an argument slot when 'sret' is used as a return type. More... | |
bool | ReturnTypeUsesFPRet (QualType ResultType) |
Return true iff the given type uses 'fpret' when used as a return type. More... | |
bool | ReturnTypeUsesFP2Ret (QualType ResultType) |
Return true iff the given type uses 'fp2ret' when used as a return type. More... | |
void | ConstructAttributeList (StringRef Name, const CGFunctionInfo &Info, CGCalleeInfo CalleeInfo, llvm::AttributeList &Attrs, unsigned &CallingConv, bool AttrOnCallSite, bool IsThunk) |
Get the LLVM attributes and calling convention to use for a particular function type. More... | |
void | AdjustMemoryAttribute (StringRef Name, CGCalleeInfo CalleeInfo, llvm::AttributeList &Attrs) |
Adjust Memory attribute to ensure that the BE gets the right attribute. More... | |
void | addDefaultFunctionDefinitionAttributes (llvm::AttrBuilder &attrs) |
Like the overload taking a Function & , but intended specifically for frontends that want to build on Clang's target-configuration logic. More... | |
StringRef | getMangledName (GlobalDecl GD) |
StringRef | getBlockMangledName (GlobalDecl GD, const BlockDecl *BD) |
const GlobalDecl | getMangledNameDecl (StringRef) |
void | EmitTentativeDefinition (const VarDecl *D) |
void | EmitExternalDeclaration (const VarDecl *D) |
void | EmitVTable (CXXRecordDecl *Class) |
This is a callback from Sema to tell us that a particular vtable is required to be emitted in this translation unit. More... | |
void | RefreshTypeCacheForClass (const CXXRecordDecl *Class) |
void | AppendLinkerOptions (StringRef Opts) |
Appends Opts to the "llvm.linker.options" metadata value. More... | |
void | AddDetectMismatch (StringRef Name, StringRef Value) |
Appends a detect mismatch command to the linker options. More... | |
void | AddDependentLib (StringRef Lib) |
Appends a dependent lib to the appropriate metadata value. More... | |
llvm::GlobalVariable::LinkageTypes | getFunctionLinkage (GlobalDecl GD) |
void | setFunctionLinkage (GlobalDecl GD, llvm::Function *F) |
llvm::GlobalVariable::LinkageTypes | getVTableLinkage (const CXXRecordDecl *RD) |
Return the appropriate linkage for the vtable, VTT, and type information of the given class. More... | |
CharUnits | GetTargetTypeStoreSize (llvm::Type *Ty) const |
Return the store size, in character units, of the given LLVM type. More... | |
llvm::GlobalValue::LinkageTypes | getLLVMLinkageForDeclarator (const DeclaratorDecl *D, GVALinkage Linkage) |
Returns LLVM linkage for a declarator. More... | |
llvm::GlobalValue::LinkageTypes | getLLVMLinkageVarDefinition (const VarDecl *VD) |
Returns LLVM linkage for a declarator. More... | |
void | EmitGlobalAnnotations () |
Emit all the global annotations. More... | |
llvm::Constant * | EmitAnnotationString (StringRef Str) |
Emit an annotation string. More... | |
llvm::Constant * | EmitAnnotationUnit (SourceLocation Loc) |
Emit the annotation's translation unit. More... | |
llvm::Constant * | EmitAnnotationLineNo (SourceLocation L) |
Emit the annotation line number. More... | |
llvm::Constant * | EmitAnnotationArgs (const AnnotateAttr *Attr) |
Emit additional args of the annotation. More... | |
llvm::Constant * | EmitAnnotateAttr (llvm::GlobalValue *GV, const AnnotateAttr *AA, SourceLocation L) |
Generate the llvm::ConstantStruct which contains the annotation information for a given GlobalValue. More... | |
void | AddGlobalAnnotations (const ValueDecl *D, llvm::GlobalValue *GV) |
Add global annotations that are set on D, for the global GV. More... | |
llvm::Constant * | EmitSYCLAnnotationArgs (SmallVectorImpl< std::pair< std::string, std::string >> &Pairs) |
Emit additional args of the annotation. More... | |
void | AddGlobalSYCLIRAttributes (llvm::GlobalVariable *GV, const RecordDecl *RD) |
Add attributes from add_ir_attributes_global_variable on TND to GV. More... | |
bool | isInNoSanitizeList (SanitizerMask Kind, llvm::Function *Fn, SourceLocation Loc) const |
bool | isInNoSanitizeList (SanitizerMask Kind, llvm::GlobalVariable *GV, SourceLocation Loc, QualType Ty, StringRef Category=StringRef()) const |
bool | imbueXRayAttrs (llvm::Function *Fn, SourceLocation Loc, StringRef Category=StringRef()) const |
Imbue XRay attributes to a function, applying the always/never attribute lists in the process. More... | |
ProfileList::ExclusionType | isFunctionBlockedByProfileList (llvm::Function *Fn, SourceLocation Loc) const |
ProfileList::ExclusionType | isFunctionBlockedFromProfileInstr (llvm::Function *Fn, SourceLocation Loc) const |
SanitizerMetadata * | getSanitizerMetadata () |
void | addDeferredVTable (const CXXRecordDecl *RD) |
void | EmitGlobal (GlobalDecl D) |
Emit code for a single global function or var decl. More... | |
bool | TryEmitBaseDestructorAsAlias (const CXXDestructorDecl *D) |
Try to emit a base destructor as an alias to its primary base-class destructor. More... | |
llvm::GlobalValue * | GetGlobalValue (StringRef Ref) |
void | SetCommonAttributes (GlobalDecl GD, llvm::GlobalValue *GV) |
Set attributes which are common to any form of a global definition (alias, Objective-C method, function, global variable). More... | |
void | addReplacement (StringRef Name, llvm::Constant *C) |
void | addGlobalValReplacement (llvm::GlobalValue *GV, llvm::Constant *C) |
void | EmitOMPThreadPrivateDecl (const OMPThreadPrivateDecl *D) |
Emit a code for threadprivate directive. More... | |
void | EmitOMPDeclareReduction (const OMPDeclareReductionDecl *D, CodeGenFunction *CGF=nullptr) |
Emit a code for declare reduction construct. More... | |
void | EmitOMPDeclareMapper (const OMPDeclareMapperDecl *D, CodeGenFunction *CGF=nullptr) |
Emit a code for declare mapper construct. More... | |
void | EmitOMPRequiresDecl (const OMPRequiresDecl *D) |
Emit a code for requires directive. More... | |
void | EmitOMPAllocateDecl (const OMPAllocateDecl *D) |
Emit a code for the allocate directive. More... | |
std::optional< CharUnits > | getOMPAllocateAlignment (const VarDecl *VD) |
Return the alignment specified in an allocate directive, if present. More... | |
bool | HasHiddenLTOVisibility (const CXXRecordDecl *RD) |
Returns whether the given record has hidden LTO visibility and therefore may participate in (single-module) CFI and whole-program vtable optimization. More... | |
bool | AlwaysHasLTOVisibilityPublic (const CXXRecordDecl *RD) |
Returns whether the given record has public LTO visibility (regardless of -lto-whole-program-visibility) and therefore may not participate in (single-module) CFI and whole-program vtable optimization. More... | |
llvm::GlobalObject::VCallVisibility | GetVCallVisibilityLevel (const CXXRecordDecl *RD, llvm::DenseSet< const CXXRecordDecl * > &Visited) |
Returns the vcall visibility of the given type. More... | |
void | EmitVTableTypeMetadata (const CXXRecordDecl *RD, llvm::GlobalVariable *VTable, const VTableLayout &VTLayout) |
Emit type metadata for the given vtable using the given layout. More... | |
llvm::Type * | getVTableComponentType () const |
llvm::ConstantInt * | CreateCrossDsoCfiTypeId (llvm::Metadata *MD) |
Generate a cross-DSO type identifier for MD. More... | |
llvm::ConstantInt * | CreateKCFITypeId (QualType T) |
Generate a KCFI type identifier for T. More... | |
llvm::Metadata * | CreateMetadataIdentifierForType (QualType T) |
Create a metadata identifier for the given type. More... | |
llvm::Metadata * | CreateMetadataIdentifierForVirtualMemPtrType (QualType T) |
Create a metadata identifier that is intended to be used to check virtual calls via a member function pointer. More... | |
llvm::Metadata * | CreateMetadataIdentifierGeneralized (QualType T) |
Create a metadata identifier for the generalization of the given type. More... | |
void | CreateFunctionTypeMetadataForIcall (const FunctionDecl *FD, llvm::Function *F) |
Create and attach type metadata to the given function. More... | |
void | setKCFIType (const FunctionDecl *FD, llvm::Function *F) |
Set type metadata to the given function. More... | |
void | finalizeKCFITypes () |
Emit KCFI type identifier constants and remove unused identifiers. More... | |
bool | MayDropFunctionReturn (const ASTContext &Context, QualType ReturnType) const |
Whether this function's return type has no side effects, and thus may be trivially discarded if it is unused. More... | |
bool | NeedAllVtablesTypeId () const |
Returns whether this module needs the "all-vtables" type identifier. More... | |
void | AddVTableTypeMetadata (llvm::GlobalVariable *VTable, CharUnits Offset, const CXXRecordDecl *RD) |
Create and attach type metadata for the given vtable. More... | |
SmallVector< const CXXRecordDecl *, 0 > | getMostBaseClasses (const CXXRecordDecl *RD) |
Return a vector of most-base classes for RD. More... | |
llvm::FunctionCallee | getTerminateFn () |
Get the declaration of std::terminate for the platform. More... | |
llvm::SanitizerStatReport & | getSanStats () |
llvm::Value * | createOpenCLIntToSamplerConversion (const Expr *E, CodeGenFunction &CGF) |
void | GenKernelArgMetadata (llvm::Function *FN, const FunctionDecl *FD=nullptr, CodeGenFunction *CGF=nullptr) |
OpenCL v1.2 s5.6.4.6 allows the compiler to store kernel argument information in the program executable. More... | |
llvm::Constant * | getNullPointer (llvm::PointerType *T, QualType QT) |
Get target specific null pointer. More... | |
CharUnits | getNaturalTypeAlignment (QualType T, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr, bool forPointeeType=false) |
CharUnits | getNaturalPointeeTypeAlignment (QualType T, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr) |
bool | stopAutoInit () |
void | printPostfixForExternalizedDecl (llvm::raw_ostream &OS, const Decl *D) const |
Print the postfix for externalized static variable or kernels for single source offloading languages CUDA and HIP. More... | |
void | moveLazyEmissionStates (CodeGenModule *NewBuilder) |
Move some lazily-emitted states to the NewBuilder. More... | |
void | getFPAccuracyFuncAttributes (StringRef Name, llvm::AttributeList &AttrList, llvm::Metadata *&MDs, unsigned ID, const llvm::Type *FuncType) |
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 . More... | |
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 . More... | |
void | handleAMDGPUWavesPerEUAttr (llvm::Function *F, const AMDGPUWavesPerEUAttr *A) |
Emit the IR encoding to attach the AMD GPU waves-per-eu attribute to F . More... | |
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. More... | |
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. More... | |
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. More... | |
bool | shouldEmitConvergenceTokens () const |
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 More... | |
llvm::IntegerType * | Int8Ty |
i8, i16, i32, and i64 More... | |
llvm::IntegerType * | Int16Ty |
llvm::IntegerType * | Int32Ty |
llvm::IntegerType * | Int64Ty |
llvm::Type * | HalfTy |
half, bfloat, float, double More... | |
llvm::Type * | BFloatTy |
llvm::Type * | FloatTy |
llvm::Type * | DoubleTy |
llvm::IntegerType * | IntTy |
int More... | |
llvm::IntegerType * | CharTy |
char More... | |
union { | |
llvm::IntegerType * IntPtrTy | |
llvm::IntegerType * SizeTy | |
llvm::IntegerType * PtrDiffTy | |
}; | |
intptr_t, size_t, and ptrdiff_t, which we assume are the same size. More... | |
union { | |
llvm::PointerType * UnqualPtrTy | |
llvm::PointerType * VoidPtrTy | |
llvm::PointerType * Int8PtrTy | |
llvm::PointerType * VoidPtrPtrTy | |
llvm::PointerType * Int8PtrPtrTy | |
}; | |
void*, void** in the target's default address space (often 0) More... | |
union { | |
llvm::PointerType * AllocaVoidPtrTy | |
llvm::PointerType * AllocaInt8PtrTy | |
}; | |
void* in alloca address space More... | |
llvm::PointerType * | DefaultInt8PtrTy |
void* in target address space More... | |
llvm::PointerType * | RuntimeGlobalsInt8PtrTy |
void* used for virtual table globals. More... | |
union { | |
llvm::PointerType * GlobalsVoidPtrTy | |
llvm::PointerType * GlobalsInt8PtrTy | |
}; | |
void* in default globals address space More... | |
llvm::PointerType * | ConstGlobalsPtrTy |
void* in the address space for constant globals More... | |
union { | |
unsigned char IntSizeInBytes | |
unsigned char IntAlignInBytes | |
}; | |
The size and alignment of the builtin C type 'int'. More... | |
unsigned char | PointerWidthInBits |
The width of a pointer into the generic address space. More... | |
union { | |
unsigned char PointerAlignInBytes | |
unsigned char PointerSizeInBytes | |
}; | |
The size and alignment of a pointer into the generic address space. More... | |
union { | |
unsigned char SizeSizeInBytes | |
unsigned char SizeAlignInBytes | |
}; | |
The size and alignment of size_t. More... | |
LangAS | ASTAllocaAddressSpace |
llvm::CallingConv::ID | RuntimeCC |
This class organizes the cross-function state that is used while generating LLVM code.
Definition at line 281 of file CodeGenModule.h.
typedef std::vector<Structor> clang::CodeGen::CodeGenModule::CtorList |
Definition at line 300 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 346 of file CodeGenModule.cpp.
CodeGenModule::~CodeGenModule | ( | ) |
Definition at line 482 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 3145 of file CodeGenModule.cpp.
Referenced by emitInterWarpCopyFunction(), and Release().
|
inline |
Add a destructor and object to add to the C++ global destructor function.
Definition at line 1176 of file CodeGenModule.h.
|
inline |
Definition at line 1193 of file CodeGenModule.h.
References Priority.
|
inline |
Add an sterm finalizer to the C++ global cleanup function.
Definition at line 1182 of file CodeGenModule.h.
|
inline |
Add an sterm finalizer to its own llvm.global_dtors entry.
Definition at line 1188 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 2217 of file CGCall.cpp.
Referenced by clang::CodeGen::addDefaultFunctionDefinitionAttributes().
void CodeGenModule::AddDeferredUnusedCoverageMapping | ( | Decl * | D | ) |
Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration.
Definition at line 7744 of file CodeGenModule.cpp.
References clang::Decl::getBeginLoc(), getContext(), clang::Decl::getKind(), clang::ASTContext::getSourceManager(), LimitedCoverage(), and SM.
Referenced by EmitTopLevelDecl().
|
inline |
Definition at line 1422 of file CodeGenModule.h.
void CodeGenModule::AddDependentLib | ( | StringRef | Lib | ) |
Appends a dependent lib to the appropriate metadata value.
Definition at line 3212 of file CodeGenModule.cpp.
References 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 3203 of file CodeGenModule.cpp.
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 3639 of file CodeGenModule.cpp.
References 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 2135 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 2144 of file CodeGenModule.cpp.
References getContext(), getTriple(), and Priority.
Referenced by AddCXXStermFinalizerToGlobalDtor(), and clang::CodeGen::CodeGenFunction::registerGlobalDtorWithLLVM().
void CodeGenModule::addGlobalIntelFPGAAnnotation | ( | const VarDecl * | VD, |
llvm::GlobalValue * | GV | ||
) |
Definition at line 5889 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypeCache::ConstGlobalsPtrTy, EmitAnnotationLineNo(), EmitAnnotationString(), EmitAnnotationUnit(), generateIntelFPGAAnnotation(), getDataLayout(), and clang::Decl::getLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
void CodeGenModule::AddGlobalSYCLIRAttributes | ( | llvm::GlobalVariable * | GV, |
const RecordDecl * | RD | ||
) |
Add attributes from add_ir_attributes_global_variable on TND to GV.
Definition at line 3696 of file CodeGenModule.cpp.
References clang::Decl::getAttr().
void CodeGenModule::addGlobalValReplacement | ( | llvm::GlobalValue * | GV, |
llvm::Constant * | C | ||
) |
Definition at line 575 of file CodeGenModule.cpp.
void CodeGenModule::addReplacement | ( | StringRef | Name, |
llvm::Constant * | C | ||
) |
Definition at line 540 of file CodeGenModule.cpp.
Referenced by TryEmitBaseDestructorAsAlias().
|
inline |
Definition at line 1121 of file CodeGenModule.h.
References clang::TypeName.
Referenced by clang::CodeGen::CodeGenTypes::ConvertRecordDeclType().
void CodeGenModule::addUsedGlobal | ( | llvm::GlobalValue * | GV | ) |
Add a global to a list to be added to the llvm.used metadata.
Definition at line 3139 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 3151 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 8169 of file CodeGenModule.cpp.
References CreateCrossDsoCfiTypeId(), CreateMetadataIdentifierForType(), getLLVMContext(), clang::TypeDecl::getTypeForDecl(), NeedAllVtablesTypeId(), and Offset.
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 2364 of file CGCall.cpp.
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 1253 of file CGVTables.cpp.
References 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 3198 of file CodeGenModule.cpp.
References getLLVMContext().
Referenced by EmitTopLevelDecl().
void CodeGenModule::clear | ( | ) |
Definition at line 769 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 7768 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters().
llvm::Function * CodeGenModule::codegenCXXStructor | ( | GlobalDecl | GD | ) |
Definition at line 212 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 172 of file CGClass.cpp.
References End, clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), getContext(), clang::RecordType::getDecl(), Offset, 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 2392 of file CGCall.cpp.
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 2214 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 2939 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 440 of file CGDeclCXX.cpp.
Referenced by clang::CodeGen::CodeGenFunction::createAtExitStub(), createGlobalInitOrCleanupFn(), clang::CodeGen::CodeGenFunction::createTLSAtExitStub(), and clang::CodeGen::CodeGenFunction::generateDestroyHelper().
llvm::ConstantInt * CodeGenModule::CreateKCFITypeId | ( | QualType | T | ) |
Generate a KCFI type identifier for T.
Definition at line 2221 of file CodeGenModule.cpp.
References clang::EST_None, 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 8109 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 8114 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 8150 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 8195 of file CodeGenModule.cpp.
References CreateRuntimeFunction(), 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 5535 of file CodeGenModule.cpp.
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.
Definition at line 5232 of file CodeGenModule.cpp.
Referenced by createOpenCLIntToSamplerConversion(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCheckHandlerCall(), emitGlobalDtorWithTLRegDtor(), emitIsPlatformVersionAtLeast(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCRelease(), emitObjCValueOperation(), emitRTtypeidCall(), getAllocateExceptionFn(), getBadCastFn(), getBadTypeidFn(), getBeginCatchFn(), getBlockObjectAssign(), getBlockObjectDispose(), 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::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 5600 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitTypeCheck(), GetAddrOfConstantCFString(), and getTlsGuardVar().
Address CodeGenModule::createUnnamedGlobalFrom | ( | const VarDecl & | D, |
llvm::Constant * | Constant, | ||
CharUnits | Align | ||
) |
Definition at line 1163 of file CGDecl.cpp.
References getContext(), GetGlobalConstantAddressSpace(), getMangledName(), and clang::ASTContext::getTargetAddressSpace().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue().
void CodeGenModule::DecorateInstructionWithInvariantGroup | ( | llvm::Instruction * | I, |
const CXXRecordDecl * | RD | ||
) |
Adds !invariant.barrier !tag to instruction.
Definition at line 1622 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 1616 of file CodeGenModule.cpp.
References getTBAAAccessTagInfo().
Referenced by clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitAtomicStore(), clang::CodeGen::CodeGenFunction::EmitLoadOfReference(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), 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 3614 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 3582 of file CodeGenModule.cpp.
References AnnotationSection, clang::CodeGen::CodeGenTypeCache::ConstGlobalsPtrTy, clang::CodeGen::ConstantEmitter::emitAbstract(), getModule(), and ID.
Referenced by EmitAnnotateAttr(), and clang::CodeGen::CodeGenFunction::EmitAnnotationCall().
llvm::Constant * CodeGenModule::EmitAnnotationLineNo | ( | SourceLocation | L | ) |
Emit the annotation line number.
Definition at line 3574 of file CodeGenModule.cpp.
References getContext(), clang::PresumedLoc::getLine(), clang::ASTContext::getSourceManager(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::PresumedLoc::isValid(), and SM.
Referenced by addGlobalIntelFPGAAnnotation(), EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitAnnotationCall(), and clang::CodeGen::CodeGenFunction::EmitSYCLAnnotationCall().
llvm::Constant * CodeGenModule::EmitAnnotationString | ( | StringRef | Str | ) |
Emit an annotation string.
Definition at line 3549 of file CodeGenModule.cpp.
References AnnotationSection, clang::CodeGen::CodeGenTypeCache::ConstGlobalsPtrTy, getLLVMContext(), getModule(), and s.
Referenced by addGlobalIntelFPGAAnnotation(), EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitAnnotationCall(), EmitAnnotationUnit(), EmitSYCLAnnotationArgs(), and clang::CodeGen::CodeGenFunction::EmitSYCLAnnotationCall().
llvm::Constant * CodeGenModule::EmitAnnotationUnit | ( | SourceLocation | Loc | ) |
Emit the annotation's translation unit.
Definition at line 3566 of file CodeGenModule.cpp.
References EmitAnnotationString(), getContext(), clang::PresumedLoc::getFilename(), clang::ASTContext::getSourceManager(), clang::PresumedLoc::isValid(), Loc, and SM.
Referenced by addGlobalIntelFPGAAnnotation(), EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitAnnotationCall(), and clang::CodeGen::CodeGenFunction::EmitSYCLAnnotationCall().
void CodeGenModule::EmitDeferredUnusedCoverageMappings | ( | ) |
Emit all the deferred coverage mappings for the uninstrumented functions.
Definition at line 7779 of file CodeGenModule.cpp.
References clang::Ctor_Base, 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 1242 of file CGExpr.cpp.
References 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 VarDecl * | D | ) |
Definition at line 5632 of file CodeGenModule.cpp.
void CodeGenModule::EmitGlobal | ( | GlobalDecl | D | ) |
Emit code for a single global function or var decl.
Forward declarations are emitted lazily.
Definition at line 4048 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::getASTContext(), getContext(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), clang::ASTContext::getInlineVariableDefinitionKind(), getLangOpts(), getMangledName(), getOpenMPRuntime(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), getTypes(), clang::Global, clang::Decl::hasAttr(), clang::CodeGen::CGOpenMPRuntime::hasRequiresUnifiedSharedMemory(), clang::FunctionDecl::isConstexpr(), clang::isLambdaCallOperator(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), clang::FunctionDecl::isMultiVersion(), clang::LangOptions::isSYCL(), clang::ASTContext::Strong, SYCLCUDAIsHost(), and SYCLCUDAIsSYCLDevice().
Referenced by EmitTopLevelDecl().
void CodeGenModule::EmitGlobalAnnotations | ( | ) |
Emit all the global annotations.
Definition at line 3529 of file CodeGenModule.cpp.
References AddGlobalAnnotations(), AnnotationSection, Array, 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 7819 of file CodeGenModule.cpp.
References clang::serialized_diags::create(), clang::TargetInfo::getIntWidth(), getModule(), clang::ASTContext::getTargetInfo(), and clang::HiddenVisibility.
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 2374 of file CGExprConstant.cpp.
References clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ArrayType::getElementType(), getNullPointer(), getTypes(), 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(), 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 2405 of file CGExprConstant.cpp.
References EmitNullConstant().
Referenced by EmitNullBaseClassInitialization().
void CodeGenModule::EmitOMPAllocateDecl | ( | const OMPAllocateDecl * | D | ) |
Emit a code for the allocate directive.
D | The allocate declaration |
Definition at line 2821 of file CGDecl.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), getContext(), GetGlobalValue(), GetGlobalVarAddressSpace(), getMangledName(), getModule(), clang::ASTContext::getTargetAddressSpace(), getTypes(), and clang::OMPAllocateDecl::varlists().
void CodeGenModule::EmitOMPDeclareMapper | ( | const OMPDeclareMapperDecl * | D, |
CodeGenFunction * | CGF = nullptr |
||
) |
Emit a code for declare mapper construct.
Definition at line 2809 of file CGDecl.cpp.
References clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), getOpenMPRuntime(), and clang::Decl::isUsed().
Referenced by clang::CodeGen::CodeGenFunction::EmitDecl(), and EmitGlobal().
void CodeGenModule::EmitOMPDeclareReduction | ( | const OMPDeclareReductionDecl * | D, |
CodeGenFunction * | CGF = nullptr |
||
) |
Emit a code for declare reduction construct.
Definition at line 2802 of file CGDecl.cpp.
References clang::CodeGen::CGOpenMPRuntime::emitUserDefinedReduction(), getOpenMPRuntime(), and clang::Decl::isUsed().
Referenced by clang::CodeGen::CodeGenFunction::EmitDecl(), and EmitGlobal().
void CodeGenModule::EmitOMPRequiresDecl | ( | const OMPRequiresDecl * | D | ) |
Emit a code for requires directive.
D | Requires declaration |
Definition at line 2817 of file CGDecl.cpp.
References getOpenMPRuntime(), and clang::CodeGen::CGOpenMPRuntime::processRequiresDirective().
void CodeGenModule::EmitOMPThreadPrivateDecl | ( | const OMPThreadPrivateDecl * | D | ) |
Emit a code for threadprivate directive.
D | Threadprivate declaration. |
Definition at line 8057 of file CodeGenModule.cpp.
References GetAddrOfGlobalVar(), getContext(), getOpenMPRuntime(), clang::ValueDecl::getType(), getTypes(), and clang::OMPThreadPrivateDecl::varlists().
llvm::Constant * CodeGenModule::EmitSYCLAnnotationArgs | ( | SmallVectorImpl< std::pair< std::string, std::string >> & | Pairs | ) |
Emit additional args of the annotation.
Definition at line 3647 of file CodeGenModule.cpp.
References AnnotationSection, clang::CodeGen::CodeGenTypeCache::ConstGlobalsPtrTy, EmitAnnotationString(), getModule(), and ID.
Referenced by clang::CodeGen::CodeGenFunction::EmitSYCLAnnotationCall().
void CodeGenModule::EmitTentativeDefinition | ( | const VarDecl * | D | ) |
Definition at line 5609 of file CodeGenModule.cpp.
References GetGlobalValue(), clang::VarDecl::getInit(), 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 7442 of file CodeGenModule.cpp.
References AddDeferredUnusedCoverageMapping(), AddDependentLib(), AddDetectMismatch(), AppendLinkerOptions(), Block, clang::DeclContext::decls(), clang::ExternalASTSource::EK_Never, clang::CodeGen::CGCXXABI::EmitCXXConstructors(), clang::CodeGen::CGCXXABI::EmitCXXDestructors(), EmitGlobal(), clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), clang::Decl::getASTContext(), getCodeGenOpts(), getContext(), getCXXABI(), clang::ASTContext::getExternalSource(), clang::Decl::getKind(), getModule(), getModuleDebugInfo(), clang::CXXRecordDecl::hasDefinition(), clang::FunctionDecl::isImmediateFunction(), clang::Decl::isTemplated(), clang::PCK_Compiler, clang::PCK_ExeStr, clang::PCK_Lib, clang::PCK_Linker, clang::PCK_Unknown, clang::PCK_User, clang::TSK_ExplicitInstantiationDefinition, and Visited.
Referenced by 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 1156 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 1323 of file CGVTables.cpp.
References AddVTableTypeMetadata(), clang::VTableComponent::CK_FunctionPointer, CreateMetadataIdentifierForVirtualMemPtrType(), clang::VTableLayout::getAddressPoints(), getCodeGenOpts(), getCXXABI(), getKind(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::ASTContext::getMemberPointerType(), clang::ASTContext::getRecordType(), GetTargetTypeStoreSize(), clang::QualType::getTypePtr(), GetVCallVisibilityLevel(), getVTableComponentType(), clang::VTableLayout::getVTableOffset(), clang::MangleContext::mangleCanonicalTypeName(), Offset, clang::operator<(), clang::TypeName, Visited, and clang::VTableLayout::vtable_components().
void CodeGenModule::Error | ( | SourceLocation | loc, |
StringRef | error | ||
) |
Emit a general error that something can't be done.
Definition at line 1628 of file CodeGenModule.cpp.
References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getFullLoc(), and clang::DiagnosticsEngine::Report().
Referenced by createCoroData(), clang::CodeGen::ConstantEmitter::emitAbstract(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCoroutineIntrinsic(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CGOpenMPRuntimeGPU::processRequiresDirective(), setAspectsEnumDecl(), and SetLLVMFunctionAttributes().
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 1645 of file CodeGenModule.cpp.
References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getFullLoc(), clang::Decl::getLocation(), and clang::DiagnosticsEngine::Report().
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 1635 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), AddVariableConstraints(), clang::CodeGen::CodeGenFunction::EmitAMDGPUDevicePrintfCallExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaCallOpBody(), clang::CodeGen::CodeGenFunction::EmitLambdaStaticInvokeBody(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), and clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk().
void CodeGenModule::finalizeKCFITypes | ( | ) |
Emit KCFI type identifier constants and remove unused identifiers.
Definition at line 2977 of file CodeGenModule.cpp.
References getModule().
Referenced by Release().
void CodeGenModule::generateIntelFPGAAnnotation | ( | const Decl * | D, |
llvm::SmallString< 256 > & | AnnotStr | ||
) |
Definition at line 5807 of file CodeGenModule.cpp.
References clang::Decl::getAttr(), clang::ASTContext::getBaseElementType(), getContext(), clang::CharUnits::getQuantity(), clang::ASTContext::getTypeSizeInChars(), clang::Decl::hasAttr(), and clang::Type::isArrayType().
Referenced by addGlobalIntelFPGAAnnotation(), and clang::CodeGen::CodeGenFunction::EmitLValueForField().
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 2307 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::Decl::hasAttr(), 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().
llvm::FunctionCallee CodeGenModule::getAddrAndTypeOfCXXStructor | ( | GlobalDecl | GD, |
const CGFunctionInfo * | FnInfo = nullptr , |
||
llvm::FunctionType * | FnType = nullptr , |
||
bool | DontDefer = false , |
||
ForDefinition_t | IsForDefinition = NotForDefinition |
||
) |
Definition at line 226 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 6766 of file CodeGenModule.cpp.
References clang::TranslationUnitDecl::castToDeclContext(), clang::LangOptions::CFRuntime, clang::CodeGen::CodeGenTypes::ConvertType(), CreateRuntimeVariable(), clang::CharUnits::fromQuantity(), clang::IdentifierTable::get(), clang::ASTContext::getCFConstantStringType(), GetConstantCFStringEntry(), getContext(), getDataLayout(), getLangOpts(), clang::ASTContext::getTranslationUnitDecl(), getTriple(), getTypes(), clang::Decl::hasAttr(), clang::ASTContext::Idents, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::CodeGen::CodeGenTypeCache::IntTy, clang::DeclContext::lookup(), setDSOLocal(), clang::LangOptionsBase::Swift, clang::LangOptionsBase::Swift4_1, clang::LangOptionsBase::Swift4_2, and clang::LangOptionsBase::Swift5_0.
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 2245 of file CGExprConstant.cpp.
References clang::CompoundLiteralExpr::isFileScope().
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 2232 of file CGExprConstant.cpp.
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 7123 of file CodeGenModule.cpp.
References castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CodeGenTypeCache::CharTy, GenerateStringLiteral(), clang::ASTContext::getAlignOfGlobalVarInChars(), clang::CharUnits::getAsAlign(), getContext(), getLLVMContext(), and clang::CharUnits::getQuantity().
Referenced by buildBlockDescriptor(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), and GetAddrOfConstantStringFromObjCEncode().
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 7060 of file CodeGenModule.cpp.
Referenced by 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 7113 of file CodeGenModule.cpp.
References GetAddrOfConstantCString(), getContext(), clang::ObjCEncodeExpr::getEncodedType(), 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 1106 of file CodeGenModule.h.
References getAddrAndTypeOfCXXStructor().
Referenced by codegenCXXStructor(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), 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 5149 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertType(), clang::Dtor_Base, clang::Dtor_Complete, getCUDARuntime(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CGCUDARuntime::getKernelHandle(), getMangledName(), getTarget(), clang::ValueDecl::getType(), and getTypes().
Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), EmitFunctionDeclPointer(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), EmitNewDeleteCall(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfGlobal(), and GetFunctionStart().
llvm::Constant * CodeGenModule::GetAddrOfGlobal | ( | GlobalDecl | GD, |
ForDefinition_t | IsForDefinition = NotForDefinition |
||
) |
Definition at line 5510 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(), clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), getAddrOfCXXStructor(), GetAddrOfFunction(), GetAddrOfGlobalVar(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenTypes::GetFunctionType(), and getTypes().
Referenced by emitConstructorDestructorAlias(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), 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 1258 of file CGBlocks.cpp.
|
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 1044 of file CodeGenModule.h.
Referenced by buildGlobalBlock(), and clang::CodeGen::CodeGenFunction::EmitBlockLiteral().
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 7157 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), getContext(), clang::MaterializeTemporaryExpr::getExtendingDecl(), getModule(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), getTypes(), clang::SD_Static, and clang::SD_Thread.
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 5584 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::QualType::getAddressSpace(), getMangledName(), GetOrCreateLLVMGlobal(), clang::ValueDecl::getType(), getTypes(), and clang::VarDecl::hasGlobalStorage().
Referenced by EmitGlobal(), EmitGlobalVarDeclLValue(), EmitOMPThreadPrivateDecl(), GetAddrOfGlobal(), GetOrCreateLLVMGlobal(), and HandleCXXStaticMemberVarInstantiation().
ConstantAddress CodeGenModule::GetAddrOfMSGuidDecl | ( | const MSGuidDecl * | GD | ) |
Get the address of a GUID.
Definition at line 3899 of file CodeGenModule.cpp.
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 8042 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(), and clang::CodeGen::CodeGenFunction::EmitTypeCheck().
ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject | ( | const TemplateParamObjectDecl * | TPO | ) |
Get the address of a template parameter object.
Definition at line 3981 of file CodeGenModule.cpp.
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 3950 of file CodeGenModule.cpp.
References clang::QualType::getAddressSpace(), clang::CharUnits::getAsAlign(), getContext(), getModule(), clang::ValueDecl::getType(), clang::ASTContext::getTypeAlignInChars(), clang::UnnamedGlobalConstantDecl::getValue(), and V.
|
inline |
Definition at line 737 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction().
|
inline |
Definition at line 729 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 1088 of file CGBlocks.cpp.
References clang::CodeGen::CodeGenTypes::ConvertType(), clang::serialized_diags::create(), getContext(), getLangOpts(), clang::ASTContext::getTargetAddressSpace(), getTypes(), clang::OpenCL, and clang::opencl_constant.
Referenced by getGenericBlockLiteralType(), and initializeForBlockHeader().
StringRef CodeGenModule::getBlockMangledName | ( | GlobalDecl | GD, |
const BlockDecl * | BD | ||
) |
Definition at line 2098 of file CodeGenModule.cpp.
References clang::GlobalDecl::getCtorType(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::MangleContext::mangleBlock(), clang::MangleContext::mangleCtorBlock(), clang::MangleContext::mangleDtorBlock(), and clang::MangleContext::mangleGlobalBlock().
Referenced by clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), and getStaticDeclName().
llvm::FunctionCallee CodeGenModule::getBlockObjectAssign | ( | ) |
Definition at line 2839 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), CreateRuntimeFunction(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction().
llvm::FunctionCallee CodeGenModule::getBlockObjectDispose | ( | ) |
Definition at line 2826 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), CreateRuntimeFunction(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::CodeGen::CodeGenTypeCache::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 99 of file CGBuiltin.cpp.
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 770 of file CodeGenModule.h.
Referenced by clang::CodeGen::CoverageMappingModuleGen::addFunctionMappingRecord(), clang::CodeGen::CGDebugInfo::addHeapAllocSiteMetadata(), clang::CodeGen::TargetCodeGenInfo::addStackProbeTargetAttributes(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayCustomEvents(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayTypedEvents(), AlwaysHasLTOVisibilityPublic(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), clang::CodeGen::CodeGenFunction::checkIfFunctionMustProgress(), clang::CodeGen::CodeGenFunction::checkIfLoopMustProgress(), clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), clang::CodeGen::CGCXXABI::constructorsAndDestructorsReturnThis(), CreateKCFITypeId(), clang::CodeGen::createPPC32TargetCodeGenInfo(), createTargetCodeGenInfo(), clang::CodeGen::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitARCDestroyStrong(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitBranchToCounterBlock(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), emitCheckHandlerCall(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDeclRefExprDbgValue(), clang::CodeGen::CodeGenFunction::EmitDestructorBody(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitObjectDelete(), emitOffloadingArrays(), emitOptimizedARCReturnCall(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitSanitizerStatReport(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), emitTargetCallKernelLaunch(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataStandAloneCall(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), EmitVTableTypeMetadata(), emitWritebackArg(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), GenKernelArgMetadata(), clang::CodeGen::CodeGenFunction::getARCCleanupKind(), clang::CodeGen::CodeGenTypes::getCodeGenOpts(), getCodegenToUse(), getMangledNameImpl(), clang::CodeGen::CGDebugInfo::getOrCreateRecordType(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::CodeGen::CodeGenFunction::GetVTablePtr(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), isFunctionBlockedByProfileList(), isFunctionBlockedFromProfileInstr(), clang::CodeGen::CodeGenFunction::isMCDCCoverageEnabled(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), needsTypeIdentifier(), clang::CodeGen::noSystemDebugInfo(), Release(), clang::CodeGen::CGDebugInfo::remapDIPath(), requiresMemberFunctionPointerTypeMetadata(), clang::CodeGen::CodeGenFunction::setBlockContextParameter(), clang::CodeGen::CodeGenFunction::SetDivFPAccuracy(), SetLLVMFunctionAttributesForDefinition(), clang::CodeGen::CodeGenPGO::setProfileVersion(), clang::CodeGen::CodeGenFunction::SetSqrtFPAccuracy(), clang::CodeGen::CodeGenPGO::setValueProfilingFlag(), shouldAssumeDSOLocal(), shouldEmitAvailableExternallyVTable(), shouldEmitVTableThunk(), clang::CodeGen::CodeGenFunction::ShouldEmitVTableTypeCheckedLoad(), clang::CodeGen::CodeGenFunction::ShouldInstrumentFunction(), shouldSplitConstantStore(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), clang::CodeGen::CodeGenFunction::ShouldXRayInstrumentFunction(), clang::CodeGen::CodeGenFunction::StartFunction(), TryEmitBaseDestructorAsAlias(), and TypeRequiresBuiltinLaunder().
llvm::Constant * CodeGenModule::GetConstantArrayFromStringLiteral | ( | const StringLiteral * | E | ) |
Return a constant array for the given string.
Definition at line 6994 of file CodeGenModule.cpp.
References clang::ASTContext::getAsConstantArrayType(), clang::StringLiteral::getCharByteWidth(), clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), clang::StringLiteral::getString(), clang::Expr::getType(), getTypes(), clang::ConstantArrayType::getZExtSize(), and clang::Type::isPointerType().
|
inline |
Definition at line 761 of file CodeGenModule.h.
Referenced by AddDeferredUnusedCoverageMapping(), AddGlobalDtor(), clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), clang::CodeGen::CGHLSLRuntime::annotateHLSLResource(), 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(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::createAtExitStub(), createCXXABI(), clang::CodeGen::CreateItaniumCXXABI(), CreateKCFITypeId(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), CreateMetadataIdentifierGeneralized(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), createPrivatesRecordDecl(), clang::CodeGen::CodeGenFunction::createTLSAtExitStub(), createUnnamedGlobalFrom(), EmitAnnotationLineNo(), EmitAnnotationUnit(), clang::CodeGen::CodeGenFunction::EmitArraySectionExpr(), clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), 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::ConstantEmitter::emitForMemory(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGlobal(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::CGOpenMPRuntime::emitKmpRoutineEntryT(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalInit(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CGCXXABI::EmitMemberFunctionPointer(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), EmitOMPAllocateDecl(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), emitRestoreIP(), clang::CodeGen::CodeGenFunction::EmitScalarRangeCheck(), emitShuffleAndReduceFunction(), clang::CodeGen::CGOpenMPRuntime::emitSingleRegion(), 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::CGOpenMPRuntime::emitUpdateClause(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), extractFieldType(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), generateIntelFPGAAnnotation(), 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(), GetAddrOfConstantCFString(), GetAddrOfConstantCString(), GetAddrOfConstantStringFromObjCEncode(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfGlobalTemporary(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), GetAddrOfUnnamedGlobalConstantDecl(), getAsmSrcLocInfo(), getBlockCaptureStr(), getBlockDescriptorType(), getClangCallTerminateFn(), getClassPointerAlignment(), clang::CodeGen::CGCXXABI::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), clang::CodeGen::CGOpenMPRuntime::getDepobjElements(), getDynamicOffsetAlignment(), getEntryInfoFromPresumedLoc(), getFunctionLinkage(), clang::CodeGen::CGDebugInfo::getFunctionType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAcquireFn(), getInstrProfSection(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), getLLVMLinkageVarDefinition(), getMangledName(), clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize(), getMemberPointerConstant(), getMinimumClassObjectSize(), getMinimumObjectSize(), getNaturalTypeAlignment(), getNonMemoryType(), clang::CodeGen::getNonTrivialCStructCopyAssignmentOperator(), clang::CodeGen::getNonTrivialCStructCopyConstructor(), clang::CodeGen::getNonTrivialCStructDefaultConstructor(), clang::CodeGen::getNonTrivialCStructDestructor(), clang::CodeGen::getNonTrivialCStructMoveAssignmentOperator(), clang::CodeGen::getNonTrivialCStructMoveConstructor(), GetNonVirtualBaseClassOffset(), getOMPAllocateAlignment(), GetOrCreateLLVMGlobal(), clang::CodeGen::CGOpenMPRuntime::getOrCreateThreadPrivateCache(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), clang::CodeGen::CGOpenCLRuntime::getPointerType(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), getTypeInfoLinkage(), getVBaseAlignment(), GetWeakRefReference(), handleAMDGPUFlatWorkGroupSizeAttr(), handleAMDGPUWavesPerEUAttr(), handleCUDALaunchBoundsAttr(), imbueXRayAttrs(), InitCatchParam(), InitDeviceMC(), clang::CodeGen::initializationPatternFor(), isFunctionBlockedByProfileList(), isInNoSanitizeList(), clang::CodeGen::swiftcall::isLegalIntegerType(), clang::CodeGen::CodeGenVTables::isVTableExternal(), clang::CodeGen::noSystemDebugInfo(), printPostfixForExternalizedDecl(), Release(), SetLLVMFunctionAttributesForDefinition(), clang::CodeGen::CGDebugInfo::setLocation(), shouldBeInCOMDAT(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::StartThunk(), stopAutoInit(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), clang::CodeGen::ConstantEmitter::tryEmitConstantExpr(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(), and TypeRequiresBuiltinLaunder().
|
inline |
Definition at line 699 of file CodeGenModule.h.
|
inline |
Return a reference to the configured CUDA runtime.
Definition at line 668 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCUDAKernelCallExpr(), EmitDirectCallee(), clang::CodeGen::CodeGenFunction::GenerateCode(), GetAddrOfFunction(), getMangledName(), and GetOrCreateLLVMGlobal().
|
inline |
Definition at line 781 of file CodeGenModule.h.
Referenced by BuildAppleKextVirtualCall(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), CalculateCookiePadding(), commonEmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateKCFITypeId(), clang::CodeGen::CodeGenFunction::createTLSAtExitStub(), EmitArrayDelete(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitCXXMemberDataPointerAddress(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), EmitDestroyingObjectDelete(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), EmitDynamicCastToNull(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitInlinedInheritingCXXConstructorCall(), EmitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNonNullRValueCheck(), EmitNullBaseClassInitialization(), EmitObjectDelete(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), EmitTypeidFromVTable(), clang::CodeGen::CodeGenFunction::EmitVTableAssumptionLoad(), clang::CodeGen::CodeGenFunction::EmitVTableAssumptionLoads(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), EmitVTableTypeMetadata(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalCleanUpFunc(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), getAddrAndTypeOfCXXStructor(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), GetAddrOfFunction(), GetAddrOfRTTIDescriptor(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), GetAddrOfVTTVTable(), getBlockCaptureStr(), getBlockMangledName(), 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::StartThunk(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 773 of file CodeGenModule.h.
Referenced by addGlobalIntelFPGAAnnotation(), clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::ConstantAggregateBuilderBase::addPlaceholderWithSize(), CoerceIntOrPtrToIntOrPtr(), complexTempStructure(), constStructWithPadding(), CreateCoercedLoad(), CreateCoercedStore(), clang::CodeGen::CodeGenFunction::emitAlignmentAssumption(), EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), clang::CodeGen::ConstantEmitter::emitForMemory(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitLifetimeEnd(), clang::CodeGen::CodeGenFunction::EmitLifetimeStart(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), emitPointerArithmetic(), clang::CodeGen::emitVoidPtrDirectVAArg(), clang::CodeGen::emitVoidPtrVAArg(), EnterStructPointerForCoercedAccess(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalInitFunc(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), GetAddrOfConstantCFString(), clang::CodeGen::CodeGenFunction::getBlockByrefInfo(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), clang::CodeGen::swiftcall::getNaturalAlignment(), GetTargetTypeStoreSize(), getTypeAllocSize(), getTypeStoreSize(), clang::CodeGen::initializationPatternFor(), initializeForBlockHeader(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), isFullSizeType(), isProvablyNonNull(), clang::CodeGen::DominatingLLVMValue::save(), and SetLLVMFunctionAttributesForDefinition().
llvm::GlobalVariable::ThreadLocalMode CodeGenModule::GetDefaultLLVMTLSModel | ( | ) | const |
Get LLVM TLS mode from CodeGenOptions.
Definition at line 1860 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 772 of file CodeGenModule.h.
Referenced by CheckAtomicAlignment(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(), emitAArch64DeclareSimdFunction(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), Error(), ErrorUnsupported(), clang::CodeGen::CodeGenFunction::GenerateCode(), GetOrCreateLLVMGlobal(), Release(), setAspectsEnumDecl(), 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(), clang::TagDecl::isCompleteDefinition(), and min().
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 6958 of file CodeGenModule.cpp.
|
inline |
Definition at line 763 of file CodeGenModule.h.
void CodeGenModule::getFPAccuracyFuncAttributes | ( | StringRef | Name, |
llvm::AttributeList & | AttrList, | ||
llvm::Metadata *& | MDs, | ||
unsigned | ID, | ||
const llvm::Type * | FuncType | ||
) |
Definition at line 8366 of file CodeGenModule.cpp.
llvm::GlobalValue::LinkageTypes CodeGenModule::getFunctionLinkage | ( | GlobalDecl | GD | ) |
Definition at line 2203 of file CodeGenModule.cpp.
References getContext(), getCXXABI(), clang::CodeGen::CGCXXABI::getCXXDestructorLinkage(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::ASTContext::GetGVALinkageForFunction(), and getLLVMLinkageForDeclarator().
Referenced by emitConstructorDestructorAlias(), EmitDeferredUnusedCoverageMappings(), getCodegenToUse(), isUniqueInternalLinkageDecl(), setFunctionLinkage(), and TryEmitBaseDestructorAsAlias().
llvm::Constant * CodeGenModule::GetFunctionStart | ( | const ValueDecl * | Decl | ) |
Definition at line 5184 of file CodeGenModule.cpp.
References GetAddrOfFunction().
llvm::Type * CodeGenModule::getGenericBlockLiteralType | ( | ) |
The type of a generic block literal.
Definition at line 1120 of file CGBlocks.cpp.
References clang::serialized_diags::create(), 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 5685 of file CodeGenModule.cpp.
References clang::cuda_device, clang::Default, getTarget(), getTriple(), clang::opencl_constant, and clang::sycl_global.
Referenced by castStringLiteralToDefaultAddressSpace(), createUnnamedGlobalFrom(), and GenerateStringLiteral().
|
inline |
Definition at line 804 of file CodeGenModule.h.
|
inline |
Definition at line 805 of file CodeGenModule.h.
llvm::GlobalValue * CodeGenModule::GetGlobalValue | ( | StringRef | Ref | ) |
Definition at line 2129 of file CodeGenModule.cpp.
Referenced by emitConstructorDestructorAlias(), EmitGlobal(), EmitGlobalAnnotations(), EmitOMPAllocateDecl(), EmitTentativeDefinition(), GetOrCreateLLVMGlobal(), GetWeakRefReference(), clang::CodeGen::CGOpenMPRuntime::markAsGlobalTarget(), 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 5641 of file CodeGenModule.cpp.
References clang::cuda_constant, clang::cuda_device, clang::cuda_shared, clang::Default, clang::FirstTargetAddressSpace, clang::QualType::getAddressSpace(), clang::Decl::getAttr(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), getTargetCodeGenInfo(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::QualType::isConstQualified(), clang::opencl_constant, clang::opencl_global, clang::opencl_global_device, clang::opencl_global_host, clang::opencl_local, clang::sycl_global, and clang::sycl_local.
Referenced by emitCatchDispatchBlock(), clang::CodeGen::CodeGenFunction::EmitCXXTypeidExpr(), EmitOMPAllocateDecl(), and GetOrCreateLLVMGlobal().
|
inline |
Definition at line 766 of file CodeGenModule.h.
|
inline |
Return a reference to the configured HLSL runtime.
Definition at line 680 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(), and clang::CodeGen::CodeGenFunction::StartFunction().
llvm::Function * CodeGenModule::getIntrinsic | ( | unsigned | IID, |
ArrayRef< llvm::Type * > | Tys = std::nullopt |
||
) |
Definition at line 6725 of file CodeGenModule.cpp.
References getModule(), and ID.
Referenced by clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCNoopIntrinsicUse(), emitBinaryBuiltin(), emitBinaryExpMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCallMaybeConstrainedFPBuiltin(), emitCatchDispatchBlock(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCheck(), EmitCXXNewAllocSize(), EmitFAbs(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), clang::CodeGen::CodeGenFunction::EmitFieldSYCLAnnotations(), emitFPIntBuiltin(), emitFrexpBuiltin(), clang::CodeGen::CGHLSLRuntime::emitInputSemantic(), clang::CodeGen::CodeGenFunction::EmitIntelFPGAFieldAnnotations(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), EmitllvmFAbs(), emitMaybeConstrainedFPToIntRoundBuiltin(), EmitOverflowIntrinsic(), emitRangedBuiltin(), EmitScalarFMAExpr(), EmitSystemZIntrinsicWithCC(), emitTernaryBuiltin(), emitTernaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CodeGenFunction::EmitTypeMetadataCodeForVCall(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTableTypeCheckedLoad(), emitWasmCatchPadBlock(), EmitX86CompressExpand(), EmitX86CompressStore(), EmitX86ConvertIntToFp(), EmitX86CvtF16ToFloatExpr(), EmitX86ExpandLoad(), EmitX86FMAExpr(), EmitX86FunnelShift(), EmitX86Ternlog(), getARCIntrinsic(), getIntrinsic(), and wrapWithBPFPreserveStaticOffset().
|
inline |
Definition at line 792 of file CodeGenModule.h.
References clang::CodeGen::CodeGenVTables::getItaniumVTableContext().
Referenced by ApplyNonVirtualAndVirtualOffset(), BuildAppleKextVirtualCall(), performTypeAdjustment(), and UseRelativeLayout().
|
inline |
Definition at line 796 of file CodeGenModule.h.
References clang::CodeGen::CodeGenVTables::getItaniumVTableContext().
|
inline |
Definition at line 762 of file CodeGenModule.h.
Referenced by addMonoNonMonoModifier(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), buildBlockDescriptor(), buildGlobalBlock(), CallBeginCatch(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CGOpenMPRuntime::CGOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CodeGen::CGDebugInfo::completeType(), computeBlockInfo(), configureBlocksRuntimeObject(), 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::CodeGenFunction::EmitAutoVarDecl(), clang::CodeGen::CGOpenMPRuntime::emitBarrierCall(), EmitBaseInitializer(), clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), clang::CodeGen::CodeGenFunction::EmitDelegatingCXXConstructorCall(), EmitDirectCallee(), clang::CodeGen::CGOpenMPRuntime::emitDistributeStaticInit(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), clang::CodeGen::CGOpenMPRuntime::emitFlush(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), EmitGlobal(), clang::CodeGen::CodeGenFunction::EmitLandingPad(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalUpdate(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolCleanup(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), EmitObjectDelete(), emitOMPAtomicCaptureExpr(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), emitTargetTeamsLoopCodegenStatus(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskyieldCall(), EmitThreadPrivateVarDeclLValue(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), GenerateStringLiteral(), GenKernelArgMetadata(), clang::CodeGen::EHPersonality::get(), GetAddrOfConstantCFString(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getBlockDescriptorType(), 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(), printPostfixForExternalizedDecl(), Release(), clang::CodeGen::CodeGenVTables::RemoveHwasanMetadata(), clang::CodeGen::SanitizerMetadata::reportGlobal(), setARCRuntimeFunctionLinkage(), SetCommonAttributes(), setGlobalVisibility(), SetLLVMFunctionAttributesForDefinition(), shouldEmitRTTI(), shouldMapVisibilityToDLLExport(), 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 782 of file CodeGenModule.h.
Referenced by AddDependentLib(), clang::CodeGen::CGDebugInfo::addHeapAllocSiteMetadata(), addLinkOptionsPostorder(), AddVTableTypeMetadata(), AppendLinkerOptions(), buildBlockDescriptor(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), computeBlockInfo(), constStructWithPadding(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), DecorateInstructionWithInvariantGroup(), clang::CodeGen::CoverageMappingModuleGen::emit(), EmitAnnotationString(), EmitAtomicOp(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInitBranch(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), clang::CodeGen::CodeGenFunction::EmitFieldSYCLAnnotations(), EmitGlobalDeclMetadata(), clang::CodeGen::CodeGenFunction::EmitIntelFPGAFieldAnnotations(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), EmitSignBit(), 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(), getClangCallTerminateFn(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), getDynTlsOnDemandInitFn(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAbortFn(), getGuardAcquireFn(), getGuardReleaseFn(), getInitThreadAbortFn(), getInitThreadFooterFn(), getInitThreadHeaderFn(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), getNoObjCARCExceptionsMetadata(), GetOrCreateLLVMGlobal(), 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(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), Release(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
llvm::Function * CodeGenModule::getLLVMLifetimeEndFn | ( | ) |
Lazily declare the @llvm.lifetime.end intrinsic.
Definition at line 2572 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 2563 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 6301 of file CodeGenModule.cpp.
References clang::CUDA, clang::Decl::getAsFunction(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::ValueDecl::getType(), 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 6386 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(), and getThreadLocalWrapperLinkage().
|
inlinestatic |
Definition at line 894 of file CodeGenModule.h.
References clang::DefaultVisibility, clang::HiddenVisibility, clang::ProtectedVisibility, and V.
Referenced by setGlobalVisibility().
StringRef CodeGenModule::getMangledName | ( | GlobalDecl | GD | ) |
Definition at line 2046 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(), and clang::Kernel.
Referenced by createUnnamedGlobalFrom(), emitConstructorDestructorAlias(), EmitDeferredUnusedCoverageMappings(), EmitDirectCallee(), EmitGlobal(), EmitOMPAllocateDecl(), EmitTentativeDefinition(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), getAddrAndTypeOfCXXStructor(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfFunction(), GetAddrOfGlobalVar(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), clang::CodeGen::CGOpenMPRuntime::getOrCreateThreadPrivateCache(), getStaticDeclName(), clang::CodeGen::CGOpenMPRuntime::markAsGlobalTarget(), and TryEmitBaseDestructorAsAlias().
const GlobalDecl CodeGenModule::getMangledNameDecl | ( | StringRef | Name | ) |
Definition at line 2119 of file CodeGenModule.cpp.
llvm::Constant * CodeGenModule::getMemberPointerConstant | ( | const UnaryOperator * | e | ) |
Definition at line 2252 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 800 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(), max(), and clang::CharUnits::One().
Referenced by getMinimumObjectSize().
Returns the minimum object size for an object of the given type.
Definition at line 998 of file CodeGenModule.h.
References clang::Type::getAsCXXRecordDecl(), getContext(), getMinimumClassObjectSize(), and clang::ASTContext::getTypeSizeInChars().
Referenced by clang::CodeGen::CodeGenFunction::EmitTypeCheck().
|
inline |
Definition at line 771 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), buildBlockDescriptor(), buildGlobalBlock(), createRuntimeShuffleFunction(), clang::CodeGen::CoverageMappingModuleGen::emit(), EmitAnnotationArgs(), EmitAnnotationString(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CGOpenMPRuntime::emitBarrierCall(), clang::CodeGen::CGOpenMPRuntimeGPU::emitBarrierCall(), clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), clang::CodeGen::CGOpenMPRuntime::emitCancellationPointCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CGOpenMPRuntime::emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), EmitDoacrossOrdered(), clang::CodeGen::CGHLSLRuntime::emitEntryFunction(), clang::CodeGen::CGOpenMPRuntime::emitErrorCall(), clang::CodeGen::CGOpenMPRuntime::emitFlush(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), EmitGlobalAnnotations(), EmitGlobalDeclMetadata(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalFinalUpdate(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), 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::emitProcBindClause(), emitShuffleAndReduceFunction(), clang::CodeGen::CGOpenMPRuntime::emitSingleRegion(), EmitSYCLAnnotationArgs(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataStandAloneCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskgroupRegion(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskLoopCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskOutlinedFunction(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionFini(), clang::CodeGen::CGOpenMPRuntime::emitTaskReductionInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskwaitCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskyieldCall(), clang::CodeGen::CGOpenMPRuntime::emitTeamsCall(), clang::CodeGen::CGOpenMPRuntime::emitThreadLimitClause(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarInit(), EmitTopLevelDecl(), finalizeKCFITypes(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CGHLSLRuntime::generateGlobalCtorDtorCalls(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenVTables::GenerateRelativeVTableAlias(), GenerateStringLiteral(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::ConstantAggregateBuilderBase::getAddrOfCurrentPosition(), GetAddrOfGlobalTemporary(), clang::CodeGen::ConstantAggregateBuilderBase::getAddrOfPosition(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), GetAddrOfUnnamedGlobalConstantDecl(), getClangCallTerminateFn(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUNumThreads(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUThreadID(), clang::CodeGen::CGOpenMPRuntimeGPU::getGPUWarpSize(), getInitThreadEpochPtr(), getIntrinsic(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcAllocShared(), clang::CodeGen::CGOpenMPRuntimeGPU::getKmpcFreeShared(), getLLVMLifetimeEndFn(), getLLVMLifetimeStartFn(), GetOrCreateLLVMGlobal(), getSanStats(), clang::CodeGen::CGOpenMPRuntime::getTaskReductionItem(), clang::CodeGen::CGOpenMPRuntime::getThreadID(), getTypeInfoVTable(), clang::CodeGen::CodeGenFunction::recoverAddrOfEscapedLocal(), Release(), setThunkProperties(), and TryEmitBaseDestructorAsAlias().
|
inline |
Definition at line 752 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), EmitExplicitCastExprType(), EmitTopLevelDecl(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), Release(), and clang::CodeGen::CodeGenTypes::UpdateCompletedType().
|
inline |
Definition at line 653 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 2543 of file CodeGenModule.cpp.
References clang::CXXRecordDecl::bases(), and clang::CXXRecordDecl::getNumBases().
Referenced by SetLLVMFunctionAttributesForDefinition().
CharUnits CodeGenModule::getNaturalPointeeTypeAlignment | ( | QualType | T, |
LValueBaseInfo * | BaseInfo = nullptr , |
||
TBAAAccessInfo * | TBAAInfo = nullptr |
||
) |
Definition at line 8205 of file CodeGenModule.cpp.
References getNaturalTypeAlignment(), clang::Type::getPointeeType(), and clang::T.
Referenced by EmitPointerWithAlignment().
CharUnits CodeGenModule::getNaturalTypeAlignment | ( | QualType | T, |
LValueBaseInfo * | BaseInfo = nullptr , |
||
TBAAAccessInfo * | TBAAInfo = nullptr , |
||
bool | forPointeeType = false |
||
) |
Definition at line 8211 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 clang::CodeGen::CodeGenFunction::EmitCXXMemberDataPointerAddress(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitDeleteCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), emitOMPArraySectionBase(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), 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 200 of file CGClass.cpp.
References computeNonVirtualBaseClassOffset(), clang::CodeGen::CodeGenTypes::ConvertType(), getContext(), Offset, and clang::CodeGen::CodeGenTypeCache::PtrDiffTy.
Referenced by clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), and clang::CodeGen::CGCXXABI::getMemberPointerAdjustment().
|
inline |
Definition at line 754 of file CodeGenModule.h.
References getLLVMContext().
llvm::Constant * CodeGenModule::getNSConcreteGlobalBlock | ( | ) |
Definition at line 2852 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), clang::Default, GetOrCreateLLVMGlobal(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.
Referenced by buildGlobalBlock().
llvm::Constant * CodeGenModule::getNSConcreteStackBlock | ( | ) |
Definition at line 2862 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 1803 of file CGExprConstant.cpp.
References clang::CodeGen::TargetCodeGenInfo::getNullPointer(), getTargetCodeGenInfo(), and clang::T.
Referenced by EmitNullConstant(), and clang::CodeGen::CodeGenFunction::EmitScalarInit().
|
inline |
Definition at line 685 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 6962 of file CodeGenModule.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::ASTContext::buildImplicitRecord(), clang::RecordDecl::completeDefinition(), clang::FieldDecl::Create(), clang::ASTContext::getConstantArrayType(), clang::ASTContext::getObjCIdType(), clang::ASTContext::getPointerType(), clang::ASTContext::getTagDeclType(), clang::ICIS_NoInit, clang::QualType::isNull(), clang::Normal, clang::TagDecl::startDefinition(), and clang::ASTContext::UnsignedLongTy.
|
inline |
Return a reference to the configured Objective-C runtime.
Definition at line 645 of file CodeGenModule.h.
Referenced by buildBlockDescriptor(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitBlockCopyAndAutorelease(), clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), EmitDeclInit(), clang::CodeGen::CodeGenFunction::EmitIvarOffset(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForIvar(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), 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(), emitStructSetterCall(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and tryEmitSpecializedAllocInit().
Return the alignment specified in an allocate directive, if present.
Definition at line 2876 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 656 of file CodeGenModule.h.
Referenced by buildGlobalBlock(), clang::CodeGen::CodeGenTypes::ConvertType(), createOpenCLIntToSamplerConversion(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), getGenericBlockLiteralType(), and initializeForBlockHeader().
|
inline |
Return a reference to the configured OpenMP runtime.
Definition at line 662 of file CodeGenModule.h.
Referenced by createRuntimeShuffleFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CGOpenMPRuntime::emitCancelCall(), clang::CodeGen::CodeGenFunction::EmitComplexAssignmentLValue(), clang::CodeGen::CodeGenFunction::EmitComplexPrePostIncDec(), clang::CodeGen::CGOpenMPRuntimeGPU::emitCriticalRegion(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), emitDeclTargetVarDeclLValue(), EmitDoacrossOrdered(), clang::CodeGen::CGOpenMPRuntimeGPU::emitFunctionProlog(), EmitGlobal(), emitGlobalToListReduceFunction(), emitInitWithReductionInitializer(), emitInterWarpCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), emitOffloadingArrays(), emitOMPAtomicCaptureExpr(), emitOMPAtomicCompareExpr(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), emitOMPAtomicWriteExpr(), EmitOMPDeclareMapper(), EmitOMPDeclareReduction(), EmitOMPRequiresDecl(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), clang::CodeGen::CGOpenMPRuntime::emitParallelCall(), emitParallelOrTeamsOutlinedFunction(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), emitReductionCombiner(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitSimpleOMPExecutableDirective(), clang::CodeGen::CGOpenMPRuntime::emitTargetDataCalls(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), EmitThreadPrivateVarDeclLValue(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate(), getNVPTXLaneID(), getNVPTXWarpID(), GetOrCreateLLVMGlobal(), clang::CodeGen::CGOpenMPRuntime::isNontemporalDecl(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::UntiedTaskLocalDeclsRAII(), clang::CodeGen::CodeGenFunction::~CodeGenFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::~NontemporalDeclsRAII(), and clang::CodeGen::CGOpenMPRuntime::UntiedTaskLocalDeclsRAII::~UntiedTaskLocalDeclsRAII().
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 5308 of file CodeGenModule.cpp.
References clang::CLanguageLinkage, clang::CUDA, clang::VarDecl::DeclarationOnly, clang::Default, clang::CodeGen::ConstantEmitter::finalize(), clang::QualType::getAddressSpace(), GetAddrOfGlobalVar(), clang::VarDecl::getAnyInitializer(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getAttr(), clang::ASTContext::getBaseElementType(), clang::GlobalDecl::getCanonicalDecl(), clang::VarDecl::getCanonicalDecl(), getContext(), getCUDARuntime(), clang::GlobalDecl::getDecl(), getDiags(), GetGlobalValue(), GetGlobalVarAddressSpace(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::VarDecl::getLanguageLinkage(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), getLLVMContext(), clang::Decl::getLocation(), getModule(), getOpenMPRuntime(), clang::ASTContext::getTargetAddressSpace(), getTargetCodeGenInfo(), clang::VarDecl::getTLSKind(), getTriple(), clang::ValueDecl::getType(), clang::CodeGen::CGCUDARuntime::handleVarRegistration(), clang::Decl::hasAttr(), clang::VarDecl::hasDefinition(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasInit(), clang::CXXRecordDecl::hasMutableFields(), clang::QualType::isConstant(), clang::QualType::isConstantStorage(), clang::QualType::isConstQualified(), clang::isExternallyVisible(), clang::VarDecl::isThisDeclarationADefinition(), lookupRepresentativeDecl(), maybeEmitPipeStorageMetadata(), clang::opencl_global, clang::CodeGen::TargetCodeGenInfo::performAddrSpaceCast(), clang::CodeGen::CGOpenMPRuntime::registerTargetGlobalVariable(), clang::DiagnosticsEngine::Report(), setGVProperties(), setLinkageForGV(), clang::CodeGen::TargetCodeGenInfo::setTargetAttributes(), setTLSMode(), shouldMapVisibilityToDLLExport(), clang::VarDecl::TLS_Dynamic, and clang::CodeGen::ConstantEmitter::tryEmitForInitializer().
Referenced by GetAddrOfGlobalVar(), getNSConcreteGlobalBlock(), getNSConcreteStackBlock(), and GetWeakRefReference().
llvm::Constant * CodeGenModule::getOrCreateStaticVarDecl | ( | const VarDecl & | D, |
llvm::GlobalValue::LinkageTypes | Linkage | ||
) |
Definition at line 249 of file CGDecl.cpp.
References clang::ValueDecl::getType(), and clang::Type::isConstantSizeType().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
|
inline |
Definition at line 697 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters().
|
inline |
Definition at line 696 of file CodeGenModule.h.
|
inline |
Definition at line 768 of file CodeGenModule.h.
|
inline |
llvm::SanitizerStatReport & CodeGenModule::getSanStats | ( | ) |
Definition at line 8187 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 1652 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(), emitPointerArithmetic(), emitStructSetterCall(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CGOpenMPRuntime::getAddressOfLocalVariable(), clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddressOfLocalVariable(), clang::CodeGen::CGOpenMPRuntime::getAddrOfThreadPrivate(), and clang::CodeGen::CodeGenFunction::OMPBuilderCBHelpers::getAddrOfThreadPrivate().
|
inline |
Definition at line 703 of file CodeGenModule.h.
|
inline |
Definition at line 715 of file CodeGenModule.h.
|
inline |
Return a reference to the configured SYCL runtime.
Definition at line 674 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
inline |
Definition at line 776 of file CodeGenModule.h.
Referenced by AddDependentLib(), addLinkOptionsPostorder(), AppendCPUSpecificCPUDispatchMangling(), ApplyNonVirtualAndVirtualOffset(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), BuildAppleKextVirtualCall(), buildGlobalBlock(), clang::CodeGen::computeSPIRKernelABIInfo(), configureBlocksRuntimeObject(), createTargetCodeGenInfo(), clang::CodeGen::CodeGenFunction::EmitAMDGPUDevicePrintfCallExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CGCXXABI::EmitCtorCompleteObjectHandler(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::CodeGen::CodeGenFunction::EmitInheritedCXXConstructorCall(), emitIsPlatformVersionAtLeast(), clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitSEHExceptionCodeSave(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CGOpenMPRuntimeGPU::emitTeamsOutlinedFunction(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::EHPersonality::get(), getAddrAndTypeOfCXXStructor(), GetAddrOfFunction(), getCodegenToUse(), getCudaArch(), GetGlobalConstantAddressSpace(), getMangledName(), getTerminateFn(), getVTableLinkage(), hasInAllocaArgs(), initializeForBlockHeader(), isThreadWrapperReplaceable(), isTrivialForMSVC(), clang::CodeGen::CodeGenVTables::isVTableExternal(), Release(), ReturnTypeUsesFP2Ret(), ReturnTypeUsesFPRet(), SetLLVMFunctionAttributes(), SetLLVMFunctionAttributesForDefinition(), shouldEmitVTableThunk(), TryEmitBaseDestructorAsAlias(), and UseRelativeLayout().
const TargetCodeGenInfo & CodeGenModule::getTargetCodeGenInfo | ( | ) |
Definition at line 340 of file CodeGenModule.cpp.
References createTargetCodeGenInfo().
Referenced by AddDependentLib(), addLinkOptionsPostorder(), arrangeFreeFunctionLikeCall(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CodeGenTypes::ClangCallConvToLLVMCallConv(), computeBlockInfo(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), clang::CodeGen::CodeGenTypes::ConvertType(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitCall(), EmitDeclDestroy(), emitOptimizedARCReturnCall(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), clang::CodeGen::CodeGenFunction::GenerateCode(), getGenericBlockLiteralType(), GetGlobalVarAddressSpace(), getMangledNameImpl(), getNullPointer(), GetOrCreateLLVMGlobal(), clang::CodeGen::CGOpenCLRuntime::getPipeType(), getPrologueSignature(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), getSwiftABIInfo(), clang::CodeGen::CodeGenFunction::getTargetHooks(), getTBAAAccessInfo(), InitCatchParam(), initializeForBlockHeader(), ReturnSlotInterferesWithArgs(), and setCUDAKernelCallingConvention().
CharUnits CodeGenModule::GetTargetTypeStoreSize | ( | llvm::Type * | Ty | ) | const |
Return the store size, in character units, of the given LLVM type.
Definition at line 5636 of file CodeGenModule.cpp.
References getDataLayout(), and clang::ASTContext::toCharUnitsFromBits().
Referenced by clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), 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 1549 of file CodeGenModule.cpp.
References getLangOpts(), getTargetCodeGenInfo(), clang::Type::isCUDADeviceBuiltinSurfaceType(), and clang::Type::isCUDADeviceBuiltinTextureType().
Referenced by clang::CodeGen::CodeGenFunction::EmitArrayToPointerDecay(), clang::CodeGen::CodeGenFunction::EmitLoadOfReferenceLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), EmitPointerWithAlignment(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), 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 1587 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 1581 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 845 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 1575 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 1543 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField().
TBAAAccessInfo CodeGenModule::getTBAAVTablePtrAccessInfo | ( | llvm::Type * | VTablePtrType | ) |
getTBAAVTablePtrAccessInfo - Get the TBAA information that describes an access to a virtual table pointer.
Definition at line 1569 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::transformer::name(), and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by clang::CodeGen::CGCXXABI::emitTerminateForUnexpectedException(), and getClangCallTerminateFn().
|
inline |
Definition at line 777 of file CodeGenModule.h.
Referenced by AddDependentLib(), AddGlobalDtor(), addUsedOrCompilerUsedGlobal(), clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::createPPC32TargetCodeGenInfo(), clang::CodeGen::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CGOpenMPRuntime::emitDeclareSimdFunction(), clang::CodeGen::CGOpenMPRuntime::emitDistributeStaticInit(), clang::CodeGen::CGOpenMPRuntime::emitForStaticFinish(), emitOptimizedARCReturnCall(), GetAddrOfConstantCFString(), GetGlobalConstantAddressSpace(), getLinkageTypeForObjCMetadata(), GetOrCreateLLVMGlobal(), getTypeInfoLinkage(), HasHiddenLTOVisibility(), Release(), setARCRuntimeFunctionLinkage(), SetLLVMFunctionAttributes(), SetLLVMFunctionAttributesForDefinition(), shouldAssumeDSOLocal(), shouldEmitConvergenceTokens(), shouldEmitRTTI(), supportsCOMDAT(), and TryEmitBaseDestructorAsAlias().
|
inline |
Definition at line 745 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor().
|
inline |
Definition at line 788 of file CodeGenModule.h.
Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), addX86InterruptAttrs(), clang::CodeGen::arrangeCXXMethodType(), clang::CodeGen::arrangeFreeFunctionCall(), clang::CodeGen::arrangeFreeFunctionType(), clang::CodeGen::arrangeObjCMessageSendSignature(), clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), buildBlockDescriptor(), buildGlobalBlock(), canEmitDelegateCallArgs(), codegenCXXStructor(), computeBlockInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::convertTypeForMemory(), clang::CodeGen::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(), createGlobalInitOrCleanupFn(), clang::CodeGen::createHexagonTargetCodeGenInfo(), clang::CodeGen::createLanaiTargetCodeGenInfo(), clang::CodeGen::createLoongArchTargetCodeGenInfo(), clang::CodeGen::createM68kTargetCodeGenInfo(), clang::CodeGen::createMIPSTargetCodeGenInfo(), clang::CodeGen::createMSP430TargetCodeGenInfo(), clang::CodeGen::createNVPTXTargetCodeGenInfo(), clang::CodeGen::createPNaClTargetCodeGenInfo(), clang::CodeGen::createPPC32TargetCodeGenInfo(), clang::CodeGen::createPPC64_SVR4_TargetCodeGenInfo(), clang::CodeGen::createPPC64TargetCodeGenInfo(), clang::CodeGen::createRISCVTargetCodeGenInfo(), 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::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createWinX86_64TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_64TargetCodeGenInfo(), clang::CodeGen::createXCoreTargetCodeGenInfo(), emitAddrOfFieldStorage(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementLValue(), clang::CodeGen::ConstantEmitter::emitForMemory(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGlobal(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::CGOpenMPRuntime::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNewDeleteCall(), EmitNullConstant(), EmitNullConstant(), EmitNullConstantForBase(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), EmitOMPAllocateDecl(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), emitPreserveStructAccess(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), clang::CodeGen::CGOpenMPRuntime::emitReductionFunction(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CodeGenFunction::EmitVAArg(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), getAddrAndTypeOfCXXStructor(), GetAddrOfConstantCFString(), clang::CodeGen::CGOpenMPRuntime::getAddrOfDeclareTargetVar(), GetAddrOfFunction(), GetAddrOfGlobal(), GetAddrOfGlobalTemporary(), GetAddrOfGlobalVar(), getBlockDescriptorType(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), getClangCallTerminateFn(), GetConstantArrayFromStringLiteral(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getGEPIndicesToField(), getGuardAcquireFn(), clang::CodeGen::getLLVMFieldNumber(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), clang::CodeGen::CodeGenFunction::getTypes(), GetWeakRefReference(), isTrivialForMSVC(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), TryEmitBaseDestructorAsAlias(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Fetches the global unique block count.
Definition at line 1031 of file CodeGenModule.h.
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 1289 of file CGVTables.cpp.
References clang::CXXRecordDecl::bases(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), HasHiddenLTOVisibility(), clang::isExternallyVisible(), min(), clang::CXXRecordDecl::vbases(), and Visited.
Referenced by EmitVTableTypeMetadata().
llvm::Type * CodeGenModule::getVTableComponentType | ( | ) | const |
Definition at line 697 of file CGVTables.cpp.
References clang::CodeGen::CodeGenTypeCache::GlobalsInt8PtrTy, clang::CodeGen::CodeGenTypeCache::Int32Ty, and UseRelativeLayout().
Referenced by EmitVTableTypeMetadata().
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 1063 of file CGVTables.cpp.
References clang::ASTContext::getCurrentKeyFunction(), getCXXABI(), clang::ASTContext::getLangOpts(), getTarget(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::NamedDecl::isExternallyVisible(), clang::FunctionDecl::isInlined(), shouldEmitAvailableExternallyVTable(), 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().
|
inline |
Definition at line 790 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GetVTTParameter(), setVTableSelectiveDLLImportExport(), and shouldEmitVTableAtEndOfTranslationUnit().
ConstantAddress CodeGenModule::GetWeakRefReference | ( | const ValueDecl * | VD | ) |
Get a reference to the target of VD.
Definition at line 4012 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 EmitFunctionDeclPointer().
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 666 of file AMDGPU.cpp.
References 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 693 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 351 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 6514 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 1277 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 651 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 3768 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 3795 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 3819 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 3716 of file CodeGenModule.cpp.
References getContext(), clang::FileEntryRef::getName(), clang::ASTContext::getNoSanitizeList(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isValid(), Loc, and SM.
bool CodeGenModule::isInNoSanitizeList | ( | SanitizerMask | Kind, |
llvm::GlobalVariable * | GV, | ||
SourceLocation | Loc, | ||
QualType | Ty, | ||
StringRef | Category = StringRef() |
||
) | const |
Definition at line 3736 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 881 of file CodeGenTypes.cpp.
References clang::ASTContext::getTypeSize(), and clang::ast_matchers::type.
Definition at line 877 of file CodeGenTypes.cpp.
References clang::ast_matchers::type.
bool CodeGenModule::lookupRepresentativeDecl | ( | StringRef | MangledName, |
GlobalDecl & | Result | ||
) | const |
Definition at line 7949 of file CodeGenModule.cpp.
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 5729 of file CodeGenModule.cpp.
References clang::CPlusPlus, clang::First, getLangOpts(), and clang::Internal.
void CodeGenModule::maybeSetTrivialComdat | ( | const Decl & | D, |
llvm::GlobalObject & | GO | ||
) |
Definition at line 5790 of file CodeGenModule.cpp.
References 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 1830 of file CGCall.cpp.
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 1593 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 1601 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 1609 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 8340 of file CodeGenModule.cpp.
bool CodeGenModule::NeedAllVtablesTypeId | ( | ) | const |
Returns whether this module needs the "all-vtables" type identifier.
Definition at line 8156 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 8302 of file CodeGenModule.cpp.
References clang::LangOptions::CUID, getContext(), clang::ASTContext::getCUIDHash(), clang::PresumedLoc::getFilename(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getSourceManager(), ID, clang::PresumedLoc::isValid(), clang::PreprocessorOptions::Macros, and SM.
void CodeGenModule::RefreshTypeCacheForClass | ( | const CXXRecordDecl * | Class | ) |
Definition at line 1538 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass().
void CodeGenModule::Release | ( | ) |
Finalize LLVM code generation.
Definition at line 895 of file CodeGenModule.cpp.
References addCompilerUsedGlobal(), AddGlobalCtor(), clang::ASTContext::CUDAExternalDeviceDeclODRUsedByHost, clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), EmitDeferredUnusedCoverageMappings(), EmitGlobalAnnotations(), EmitMainVoidAlias(), clang::serialized_diags::Error, clang::TargetOptions::Features, finalizeKCFITypes(), clang::CodeGenOptions::FP32DenormalMode, clang::CodeGenOptions::FPDenormalMode, GetAddrOfGlobal(), clang::getClangVendor(), getCodeGenOpts(), getContext(), clang::ASTContext::getCurrentNamedModule(), getDiags(), clang::Decl::getEndLoc(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::LangStandard::getLangStandardForKind(), getLLVMContext(), getModule(), getModuleDebugInfo(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::CharUnits::getQuantity(), getTarget(), 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, 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::LangOptionsBase::None, clang::CodeGen::InstrProfStats::reportDiagnostics(), clang::LangOptions::Sanitize, clang::CodeGen::CodeGenPGO::setProfileVersion(), clang::CodeGen::CodeGenPGO::setValueProfilingFlag(), clang::PreprocessorOptions::SourceDateEpoch, clang::T, and clang::serialized_diags::Warning.
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 1602 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 1597 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 1624 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 1607 of file CGCall.cpp.
References clang::Double, clang::Float, clang::RISCV::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 1592 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::getReturnInfo(), and clang::CodeGen::ABIArgInfo::isIndirect().
Referenced by clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), and ReturnSlotInterferesWithArgs().
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 2237 of file CGExprConstant.cpp.
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 1250 of file CGBlocks.cpp.
Referenced by buildGlobalBlock().
void CodeGenModule::setAspectsEnumDecl | ( | const EnumDecl * | ED | ) |
Definition at line 5797 of file CodeGenModule.cpp.
References Error(), getDiags(), clang::Decl::getLocation(), and clang::DiagnosticsEngine::Report().
Referenced by clang::CodeGen::CodeGenTypes::UpdateCompletedType().
|
inline |
Definition at line 740 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction().
|
inline |
Definition at line 732 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 2761 of file CodeGenModule.cpp.
References addUsedOrCompilerUsedGlobal(), clang::DefaultVisibility, clang::GlobalDecl::getDecl(), getLangOpts(), clang::Decl::hasAttr(), clang::Internal, 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 1820 of file CodeGenModule.cpp.
References clang::Decl::hasAttr(), clang::NamedDecl::isExternallyVisible(), and shouldMapVisibilityToDLLExport().
void CodeGenModule::setDLLImportDLLExport | ( | llvm::GlobalValue * | GV, |
GlobalDecl | D | ||
) | const |
Definition at line 1809 of file CodeGenModule.cpp.
References getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), and clang::CodeGen::CGCXXABI::setCXXDestructorDLLStorage().
Referenced by clang::CodeGen::CGCXXABI::setCXXDestructorDLLStorage(), and setGVProperties().
void CodeGenModule::setDSOLocal | ( | llvm::GlobalValue * | GV | ) | const |
Definition at line 1805 of file CodeGenModule.cpp.
References shouldAssumeDSOLocal().
Referenced by configureBlocksRuntimeObject(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), GenerateStringLiteral(), GetAddrOfConstantCFString(), and setGVPropertiesAux().
|
inline |
Definition at line 1337 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 1656 of file CodeGenModule.cpp.
References clang::DefaultVisibility, clang::Decl::getAttr(), getDiags(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::NamedDecl::getLinkageAndVisibility(), GetLLVMVisibility(), clang::Decl::getLocation(), clang::LinkageInfo::getVisibility(), clang::Decl::hasAttr(), clang::HiddenVisibility, clang::LinkageInfo::isVisibilityExplicit(), clang::ProtectedVisibility, and clang::DiagnosticsEngine::Report().
Referenced by setGVPropertiesAux().
void CodeGenModule::setGVProperties | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 1838 of file CodeGenModule.cpp.
References 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 1832 of file CodeGenModule.cpp.
References clang::GlobalDecl::getDecl(), setDLLImportDLLExport(), and setGVPropertiesAux().
Referenced by GetOrCreateLLVMGlobal(), SetCommonAttributes(), and setThunkProperties().
void CodeGenModule::setGVPropertiesAux | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 1844 of file CodeGenModule.cpp.
References 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 2916 of file CodeGenModule.cpp.
References clang::GlobalDecl::getDecl(), SetLLVMFunctionAttributes(), and SetLLVMFunctionAttributesForDefinition().
Referenced by emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), emitOutlinedFunctionPrologue(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), setBlockHelperAttributesVisibility(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().
void CodeGenModule::setKCFIType | ( | const FunctionDecl * | FD, |
llvm::Function * | F | ||
) |
Set type metadata to the given function.
Definition at line 2960 of file CodeGenModule.cpp.
References CreateKCFITypeId(), 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 2239 of file CodeGenModule.cpp.
References ConstructAttributeList(), Error(), clang::GlobalDecl::getDecl(), getTarget(), getTriple(), ID, and Loc.
Referenced by clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), 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 2574 of file CodeGenModule.cpp.
References checkIfDeclaredInSYCLNamespace(), CreateFunctionTypeMetadataForIcall(), CreateMetadataIdentifierForType(), clang::Decl::getAttr(), clang::ASTContext::getCharWidth(), getCodeGenOpts(), getContext(), getCXXABI(), getDataLayout(), getLangOpts(), clang::Decl::getMaxAlignment(), clang::ASTContext::getMemberPointerType(), getMostBaseClasses(), clang::ASTContext::getRecordType(), getTarget(), clang::FunctionDecl::getTemplateInstantiationPattern(), getTriple(), clang::QualType::getTypePtr(), clang::GVA_AvailableExternally, clang::Decl::hasAttr(), hasUnwindExceptions(), Id, clang::FunctionDecl::isInlined(), isStackProtectorOn(), max(), 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(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitLambdaInAllocaImplFn(), 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 706 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
|
inline |
Definition at line 718 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 1874 of file CodeGenModule.cpp.
References clang::Decl::getAttr(), GetDefaultLLVMTLSModel(), GetLLVMTLSModel(), and clang::VarDecl::getTLSKind().
Referenced by GetOrCreateLLVMGlobal().
|
inline |
Definition at line 748 of file CodeGenModule.h.
|
inline |
Definition at line 1634 of file CodeGenModule.h.
References getTriple().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::FinishFunction(), and clang::CodeGen::CodeGenFunction::StartFunction().
Definition at line 962 of file CodeGenModule.h.
References getLangOpts(), and getTriple().
Referenced by GetAddrOfRTTIDescriptor().
|
inline |
Definition at line 870 of file CodeGenModule.h.
References clang::DefaultVisibility, getLangOpts(), clang::NamedDecl::getLinkageAndVisibility(), clang::LinkageInfo::getVisibility(), clang::LangOptions::hasDefaultVisibilityExportMapping(), clang::LangOptions::isAllDefaultVisibilityExportMapping(), clang::LangOptions::isExplicitDefaultVisibilityExportMapping(), and clang::LinkageInfo::isVisibilityExplicit().
Referenced by GetOrCreateLLVMGlobal(), and setDLLImportDLLExport().
|
inline |
Definition at line 784 of file CodeGenModule.h.
bool CodeGenModule::stopAutoInit | ( | ) |
Definition at line 8277 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 5786 of file CodeGenModule.cpp.
References getTriple().
Referenced by buildBlockDescriptor(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), GenerateStringLiteral(), getClangCallTerminateFn(), 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 34 of file CGCXX.cpp.
References addReplacement(), clang::AliasDecl, clang::Type::castAs(), clang::Class, clang::serialized_diags::create(), clang::Dtor_Base, clang::RecordDecl::field_empty(), GetAddrOfGlobal(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::FunctionType::getCallConv(), getCodeGenOpts(), clang::GlobalDecl::getDecl(), clang::RecordType::getDecl(), clang::CXXRecordDecl::getDestructor(), getFunctionLinkage(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), getMangledName(), getModule(), clang::CXXMethodDecl::getParent(), getTarget(), getTriple(), clang::ValueDecl::getType(), getTypes(), clang::Decl::hasAttr(), clang::FunctionDecl::hasTrivialBody(), clang::CharUnits::isZero(), and SetCommonAttributes().
void CodeGenModule::UpdateCompletedType | ( | const TagDecl * | TD | ) |
Definition at line 1533 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::UpdateCompletedType().
llvm::FoldingSet<BlockByrefHelpers> clang::CodeGen::CodeGenModule::ByrefHelpersCache |
Definition at line 1028 of file CodeGenModule.h.
Referenced by buildByrefHelpers().
int clang::CodeGen::CodeGenModule::GlobalUniqueCount |
Definition at line 592 of file CodeGenModule.h.
llvm::FunctionCallee clang::CodeGen::CodeGenModule::IsOSVersionAtLeastFn = nullptr |
Definition at line 692 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable().
llvm::FunctionCallee clang::CodeGen::CodeGenModule::IsPlatformVersionAtLeastFn = nullptr |
Definition at line 694 of file CodeGenModule.h.
Referenced by emitIsPlatformVersionAtLeast().