clang
10.0.0git
|
This class organizes the cross-function state that is used while generating LLVM code. More...
#include "/work/www-prereleases/10.0.0/rc2/docsbuild/clang/lib/CodeGen/CodeGenModule.h"
Classes | |
struct | Structor |
Public Types | |
typedef std::vector< Structor > | CtorList |
Public Member Functions | |
CodeGenModule (ASTContext &C, const HeaderSearchOptions &headersearchopts, const PreprocessorOptions &ppopts, const CodeGenOptions &CodeGenOpts, llvm::Module &M, DiagnosticsEngine &Diags, CoverageSourceInfo *CoverageInfo=nullptr) | |
~CodeGenModule () | |
void | clear () |
void | Release () |
Finalize LLVM code generation. More... | |
bool | getExpressionLocationsEnabled () const |
Return true if we should emit location information for expressions. More... | |
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... | |
CGOpenCLRuntime & | getOpenCLRuntime () |
Return a reference to the configured OpenCL runtime. More... | |
CGOpenMPRuntime & | getOpenMPRuntime () |
Return a reference to the configured OpenMP runtime. More... | |
llvm::OpenMPIRBuilder * | getOpenMPIRBuilder () |
Return a pointer to the configured OpenMPIRBuilder, if any. More... | |
CGCUDARuntime & | getCUDARuntime () |
Return a reference to the configured CUDA 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 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 () |
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 | isTypeConstant (QualType QTy, bool ExcludeCtorDtor) |
isTypeConstant - Determine whether an object of this type can be emitted as a constant. More... | |
bool | isPaddedAtomicType (QualType type) |
bool | isPaddedAtomicType (const AtomicType *type) |
void | DecorateInstructionWithTBAA (llvm::Instruction *Inst, TBAAAccessInfo TBAAInfo) |
DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag. More... | |
void | DecorateInstructionWithInvariantGroup (llvm::Instruction *I, const CXXRecordDecl *RD) |
Adds !invariant.barrier !tag to instruction. More... | |
llvm::ConstantInt * | getSize (CharUnits numChars) |
Emit the given number of characters as a value of type size_t. More... | |
void | setGlobalVisibility (llvm::GlobalValue *GV, const NamedDecl *D) const |
Set the visibility for the given LLVM GlobalValue. More... | |
void | setDSOLocal (llvm::GlobalValue *GV) const |
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::Constant * | GetAddrOfGlobal (GlobalDecl GD, ForDefinition_t IsForDefinition=NotForDefinition) |
llvm::GlobalVariable * | CreateOrReplaceCXXRuntimeVariable (StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage, unsigned Alignment) |
Will return a global variable of the given type. More... | |
llvm::Function * | CreateGlobalInitOrDestructFunction (llvm::FunctionType *ty, const Twine &name, const CGFunctionInfo &FI, SourceLocation Loc=SourceLocation(), bool TLS=false) |
LangAS | GetGlobalVarAddressSpace (const VarDecl *D) |
Return the AST address space of the underlying global variable for D, as determined by its declaration. More... | |
llvm::Constant * | GetAddrOfGlobalVar (const VarDecl *D, llvm::Type *Ty=nullptr, ForDefinition_t IsForDefinition=NotForDefinition) |
Return the llvm::Constant for the address of the given global variable. More... | |
LangAS | getStringLiteralAddressSpace () const |
Return the AST address space of string literal, which is used to emit the string literal as global variable in LLVM IR. More... | |
llvm::Constant * | GetAddrOfFunction (GlobalDecl GD, llvm::Type *Ty=nullptr, bool ForVTable=false, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition) |
Return the address of the given function. More... | |
llvm::Constant * | GetAddrOfRTTIDescriptor (QualType Ty, bool ForEH=false) |
Get the address of the RTTI descriptor for the given type. More... | |
ConstantAddress | GetAddrOfUuidDescriptor (const CXXUuidofExpr *E) |
Get the address of a uuid descriptor . More... | |
llvm::Constant * | GetAddrOfThunk (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 | getVBaseAlignment (CharUnits DerivedAlign, const CXXRecordDecl *Derived, const CXXRecordDecl *VBase) |
Returns the assumed alignment of a virtual base of a class. More... | |
CharUnits | getDynamicOffsetAlignment (CharUnits ActualAlign, const CXXRecordDecl *Class, CharUnits ExpectedTargetAlign) |
Given a class pointer with an actual known alignment, and the expected alignment of an object at a dynamic offset w.r.t that pointer, return the alignment to assume at the offset. More... | |
CharUnits | computeNonVirtualBaseClassOffset (const CXXRecordDecl *DerivedClass, CastExpr::path_const_iterator Start, CastExpr::path_const_iterator End) |
llvm::Constant * | GetNonVirtualBaseClassOffset (const CXXRecordDecl *ClassDecl, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd) |
Returns the offset from a derived class to a class. More... | |
int | getUniqueBlockCount () |
Fetches the global unique block count. More... | |
llvm::Type * | getBlockDescriptorType () |
Fetches the type of a generic block descriptor. More... | |
llvm::Type * | getGenericBlockLiteralType () |
The type of a generic block literal. More... | |
llvm::Constant * | GetAddrOfGlobalBlock (const BlockExpr *BE, StringRef Name) |
Gets the address of a block which requires no captures. More... | |
llvm::Constant * | getAddrOfGlobalBlockIfEmitted (const BlockExpr *BE) |
Returns the address of a block which requires no caputres, or null if we've yet to emit the block for BE. More... | |
void | setAddrOfGlobalBlock (const BlockExpr *BE, llvm::Constant *Addr) |
Notes that BE's global block is available via Addr. More... | |
ConstantAddress | GetAddrOfConstantCFString (const StringLiteral *Literal) |
Return a pointer to a constant CFString object for the given string. More... | |
ConstantAddress | GetAddrOfConstantString (const StringLiteral *Literal) |
Return a pointer to a constant NSString object for the given string. More... | |
llvm::Constant * | GetConstantArrayFromStringLiteral (const StringLiteral *E) |
Return a constant array for the given string. More... | |
ConstantAddress | GetAddrOfConstantStringFromLiteral (const StringLiteral *S, StringRef Name=".str") |
Return a pointer to a constant array for the given string literal. More... | |
ConstantAddress | GetAddrOfConstantStringFromObjCEncode (const ObjCEncodeExpr *) |
Return a pointer to a constant array for the given ObjCEncodeExpr node. More... | |
ConstantAddress | GetAddrOfConstantCString (const std::string &Str, const char *GlobalName=nullptr) |
Returns a pointer to a character array containing the literal and a terminating '\0' character. More... | |
ConstantAddress | GetAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *E) |
Returns a pointer to a constant global variable for the given file-scope compound literal expression. More... | |
llvm::GlobalVariable * | getAddrOfConstantCompoundLiteralIfEmitted (const CompoundLiteralExpr *E) |
If it's been emitted already, returns the GlobalVariable corresponding to a compound literal. More... | |
void | setAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *CLE, llvm::GlobalVariable *GV) |
Notes that CLE's GlobalVariable is GV. More... | |
ConstantAddress | GetAddrOfGlobalTemporary (const MaterializeTemporaryExpr *E, const Expr *Inner) |
Returns a pointer to a global variable representing a temporary with static or thread storage duration. More... | |
QualType | getObjCFastEnumerationStateType () |
Retrieve the record type that describes the state of an Objective-C fast enumeration loop (for..in). More... | |
llvm::Function * | codegenCXXStructor (GlobalDecl GD) |
llvm::Constant * | getAddrOfCXXStructor (GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition) |
Return the address of the constructor/destructor of the given type. More... | |
llvm::FunctionCallee | getAddrAndTypeOfCXXStructor (GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition) |
llvm::Constant * | getBuiltinLibFunction (const FunctionDecl *FD, unsigned BuiltinID) |
Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf". More... | |
llvm::Function * | getIntrinsic (unsigned IID, ArrayRef< llvm::Type *> Tys=None) |
void | EmitTopLevelDecl (Decl *D) |
Emit code for a single top level declaration. More... | |
void | AddDeferredUnusedCoverageMapping (Decl *D) |
Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration. More... | |
void | ClearUnusedCoverageMapping (const Decl *D) |
Remove the deferred empty coverage mapping as this declaration is actually instrumented. More... | |
void | EmitDeferredUnusedCoverageMappings () |
Emit all the deferred coverage mappings for the uninstrumented functions. More... | |
void | HandleCXXStaticMemberVarInstantiation (VarDecl *VD) |
Tell the consumer that this variable has been instantiated. More... | |
template<typename SomeDecl > | |
void | MaybeHandleStaticInExternC (const SomeDecl *D, llvm::GlobalValue *GV) |
If the declaration has internal linkage but is inside an extern "C" linkage specification, prepare to emit an alias for it to the expected name. More... | |
void | addUsedGlobal (llvm::GlobalValue *GV) |
Add a global to a list to be added to the llvm.used metadata. More... | |
void | addCompilerUsedGlobal (llvm::GlobalValue *GV) |
Add a global to a list to be added to the llvm.compiler.used metadata. More... | |
void | AddCXXDtorEntry (llvm::FunctionCallee DtorFn, llvm::Constant *Object) |
Add a destructor and object to add to the C++ global destructor function. More... | |
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::FunctionCallee | CreateConvergentRuntimeFunction (llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs=llvm::AttributeList(), bool Local=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 .lifetime.start intrinsic. More... | |
llvm::Function * | getLLVMLifetimeEndFn () |
Lazily declare the .lifetime.end intrinsic. More... | |
void | UpdateCompletedType (const TagDecl *TD) |
llvm::Constant * | getMemberPointerConstant (const UnaryOperator *e) |
void | EmitExplicitCastExprType (const ExplicitCastExpr *E, CodeGenFunction *CGF=nullptr) |
Emit type info if type of an expression is a variably modified type. More... | |
llvm::Constant * | EmitNullConstant (QualType T) |
Return the result of value-initializing the given type, i.e. More... | |
llvm::Constant * | EmitNullConstantForBase (const CXXRecordDecl *Record) |
Return a null constant appropriate for zero-initializing a base class with the given type. More... | |
void | Error (SourceLocation loc, StringRef error) |
Emit a general error that something can't be done. More... | |
void | ErrorUnsupported (const Stmt *S, const char *Type) |
Print out an error that codegen doesn't support the specified stmt yet. More... | |
void | ErrorUnsupported (const Decl *D, const char *Type) |
Print out an error that codegen doesn't support the specified decl yet. More... | |
void | SetInternalFunctionAttributes (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) |
Set the LLVM function attributes (sext, zext, etc). More... | |
void | SetLLVMFunctionAttributesForDefinition (const Decl *D, llvm::Function *F) |
Set the LLVM function attributes which only apply to a function definition. More... | |
bool | ReturnTypeUsesSRet (const CGFunctionInfo &FI) |
Return true iff the given type uses 'sret' when used as a return type. More... | |
bool | ReturnSlotInterferesWithArgs (const CGFunctionInfo &FI) |
Return true iff the given type uses an argument slot when 'sret' is used as a return type. More... | |
bool | ReturnTypeUsesFPRet (QualType ResultType) |
Return true iff the given type uses 'fpret' when used as a return type. More... | |
bool | ReturnTypeUsesFP2Ret (QualType ResultType) |
Return true iff the given type uses 'fp2ret' when used as a return type. More... | |
void | ConstructAttributeList (StringRef Name, const CGFunctionInfo &Info, CGCalleeInfo CalleeInfo, llvm::AttributeList &Attrs, unsigned &CallingConv, bool AttrOnCallSite) |
Get the LLVM attributes and calling convention to use for a particular function type. More... | |
void | AddDefaultFnAttrs (llvm::Function &F) |
Adds attributes to F according to our CodeGenOptions and LangOptions, as though we had emitted it ourselves. More... | |
StringRef | getMangledName (GlobalDecl GD) |
StringRef | getBlockMangledName (GlobalDecl GD, const BlockDecl *BD) |
void | EmitTentativeDefinition (const VarDecl *D) |
void | EmitExternalDeclaration (const VarDecl *D) |
void | EmitVTable (CXXRecordDecl *Class) |
This is a callback from Sema to tell us that a particular vtable is required to be emitted in this translation unit. More... | |
void | RefreshTypeCacheForClass (const CXXRecordDecl *Class) |
void | AppendLinkerOptions (StringRef Opts) |
Appends Opts to the "llvm.linker.options" metadata value. More... | |
void | AddDetectMismatch (StringRef Name, StringRef Value) |
Appends a detect mismatch command to the linker options. More... | |
void | AddDependentLib (StringRef Lib) |
Appends a dependent lib to the appropriate metadata value. More... | |
llvm::GlobalVariable::LinkageTypes | getFunctionLinkage (GlobalDecl GD) |
void | setFunctionLinkage (GlobalDecl GD, llvm::Function *F) |
llvm::GlobalVariable::LinkageTypes | getVTableLinkage (const CXXRecordDecl *RD) |
Return the appropriate linkage for the vtable, VTT, and type information of the given class. More... | |
CharUnits | GetTargetTypeStoreSize (llvm::Type *Ty) const |
Return the store size, in character units, of the given LLVM type. More... | |
llvm::GlobalValue::LinkageTypes | getLLVMLinkageForDeclarator (const DeclaratorDecl *D, GVALinkage Linkage, bool IsConstantVariable) |
Returns LLVM linkage for a declarator. More... | |
llvm::GlobalValue::LinkageTypes | getLLVMLinkageVarDefinition (const VarDecl *VD, bool IsConstant) |
Returns LLVM linkage for a declarator. More... | |
void | EmitGlobalAnnotations () |
Emit all the global annotations. More... | |
llvm::Constant * | EmitAnnotationString (StringRef Str) |
Emit an annotation string. More... | |
llvm::Constant * | EmitAnnotationUnit (SourceLocation Loc) |
Emit the annotation's translation unit. More... | |
llvm::Constant * | EmitAnnotationLineNo (SourceLocation L) |
Emit the annotation line number. More... | |
llvm::Constant * | EmitAnnotateAttr (llvm::GlobalValue *GV, const AnnotateAttr *AA, SourceLocation L) |
Generate the llvm::ConstantStruct which contains the annotation information for a given GlobalValue. More... | |
void | AddGlobalAnnotations (const ValueDecl *D, llvm::GlobalValue *GV) |
Add global annotations that are set on D, for the global GV. More... | |
bool | isInSanitizerBlacklist (SanitizerMask Kind, llvm::Function *Fn, SourceLocation Loc) const |
bool | isInSanitizerBlacklist (llvm::GlobalVariable *GV, SourceLocation Loc, QualType Ty, StringRef Category=StringRef()) const |
bool | imbueXRayAttrs (llvm::Function *Fn, SourceLocation Loc, StringRef Category=StringRef()) const |
Imbue XRay attributes to a function, applying the always/never attribute lists in the process. More... | |
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 | emitOpenMPDeviceFunctionRedefinition (GlobalDecl OldGD, GlobalDecl NewGD, llvm::GlobalValue *GV) |
Emits the definition of OldGD function with body from NewGD . 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... | |
llvm::GlobalObject::VCallVisibility | GetVCallVisibilityLevel (const CXXRecordDecl *RD) |
Returns the vcall visibility of the given type. More... | |
void | EmitVTableTypeMetadata (const CXXRecordDecl *RD, llvm::GlobalVariable *VTable, const VTableLayout &VTLayout) |
Emit type metadata for the given vtable using the given layout. More... | |
llvm::ConstantInt * | CreateCrossDsoCfiTypeId (llvm::Metadata *MD) |
Generate a cross-DSO type identifier for MD. More... | |
llvm::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... | |
bool | NeedAllVtablesTypeId () const |
Returns whether this module needs the "all-vtables" type identifier. More... | |
void | AddVTableTypeMetadata (llvm::GlobalVariable *VTable, CharUnits Offset, const CXXRecordDecl *RD) |
Create and attach type metadata for the given vtable. More... | |
std::vector< const CXXRecordDecl * > | getMostBaseClasses (const CXXRecordDecl *RD) |
Return a vector of most-base classes for RD. More... | |
llvm::FunctionCallee | getTerminateFn () |
Get the declaration of std::terminate for the platform. More... | |
llvm::SanitizerStatReport & | getSanStats () |
llvm::Value * | createOpenCLIntToSamplerConversion (const Expr *E, CodeGenFunction &CGF) |
void | GenOpenCLArgMetadata (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... | |
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::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 |
float, double More... | |
llvm::Type * | FloatTy |
llvm::Type * | DoubleTy |
llvm::IntegerType * | IntTy |
int More... | |
union { | |
llvm::IntegerType * IntPtrTy | |
llvm::IntegerType * SizeTy | |
llvm::IntegerType * PtrDiffTy | |
}; | |
intptr_t, size_t, and ptrdiff_t, which we assume are the same size. More... | |
union { | |
llvm::PointerType * VoidPtrTy | |
llvm::PointerType * Int8PtrTy | |
}; | |
void* in address space 0 More... | |
union { | |
llvm::PointerType * VoidPtrPtrTy | |
llvm::PointerType * Int8PtrPtrTy | |
}; | |
void** in address space 0 More... | |
union { | |
llvm::PointerType * AllocaVoidPtrTy | |
llvm::PointerType * AllocaInt8PtrTy | |
}; | |
void* in alloca address space More... | |
union { | |
unsigned char IntSizeInBytes | |
unsigned char IntAlignInBytes | |
}; | |
The size and alignment of the builtin C type 'int'. More... | |
unsigned char | PointerWidthInBits |
The width of a pointer into the generic address space. More... | |
union { | |
unsigned char PointerAlignInBytes | |
unsigned char PointerSizeInBytes | |
}; | |
The size and alignment of a pointer into the generic address space. More... | |
union { | |
unsigned char SizeSizeInBytes | |
unsigned char SizeAlignInBytes | |
}; | |
The size and alignment of size_t. More... | |
LangAS | ASTAllocaAddressSpace |
llvm::CallingConv::ID | RuntimeCC |
This class organizes the cross-function state that is used while generating LLVM code.
Definition at line 280 of file CodeGenModule.h.
typedef std::vector<Structor> clang::CodeGen::CodeGenModule::CtorList |
Definition at line 296 of file CodeGenModule.h.
CodeGenModule::CodeGenModule | ( | ASTContext & | C, |
const HeaderSearchOptions & | headersearchopts, | ||
const PreprocessorOptions & | ppopts, | ||
const CodeGenOptions & | CodeGenOpts, | ||
llvm::Module & | M, | ||
DiagnosticsEngine & | Diags, | ||
CoverageSourceInfo * | CoverageInfo = nullptr |
||
) |
Definition at line 94 of file CodeGenModule.cpp.
CodeGenModule::~CodeGenModule | ( | ) |
Definition at line 179 of file CodeGenModule.cpp.
References clang::CodeGen::CGOpenMPRuntime(), clang::CodeGen::CreateGNUObjCRuntime(), clang::CodeGen::CreateMacObjCRuntime(), clang::CodeGen::CreateNVCUDARuntime(), clang::ObjCRuntime::FragileMacOSX, clang::ObjCRuntime::GCC, clang::ObjCRuntime::getKind(), getLangOpts(), getTriple(), clang::ObjCRuntime::GNUstep, clang::ObjCRuntime::iOS, clang::ObjCRuntime::MacOSX, clang::LangOptions::ObjCRuntime, clang::ObjCRuntime::ObjFW, and clang::ObjCRuntime::WatchOS.
void CodeGenModule::addCompilerUsedGlobal | ( | llvm::GlobalValue * | GV | ) |
Add a global to a list to be added to the llvm.compiler.used metadata.
Definition at line 1912 of file CodeGenModule.cpp.
Referenced by emitInterWarpCopyFunction(), getBlockLayoutInfoString(), clang::CodeGen::registerTargetFirstprivateCopy(), and clang::CodeGen::registerTargetGlobalVariable().
|
inline |
Add a destructor and object to add to the C++ global destructor function.
Definition at line 1031 of file CodeGenModule.h.
void CodeGenModule::AddDefaultFnAttrs | ( | llvm::Function & | F | ) |
Adds attributes to F according to our CodeGenOptions and LangOptions, as though we had emitted it ourselves.
We remove any attributes on F that conflict with the attributes we add here.
This is useful for adding attrs to bitcode modules that you want to link with but don't control, such as CUDA's libdevice. When linking with such a bitcode library, you might want to set e.g. its functions' "unsafe-fp-math" attribute to match the attr of the functions you're codegen'ing. Otherwise, LLVM will interpret the bitcode module's lack of unsafe-fp-math attrs as tantamount to unsafe-fp-math=false, and then LLVM will propagate unsafe-fp-math=false up to every transitive caller of a function in the bitcode library!
With the exception of fast-math attrs, this will only make the attributes on the function more conservative. But it's unsafe to call this on a function which relies on particular fast-math attributes for correctness. It's up to you to ensure that this is safe.
Definition at line 1829 of file CGCall.cpp.
void CodeGenModule::AddDeferredUnusedCoverageMapping | ( | Decl * | D | ) |
Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration.
Definition at line 5513 of file CodeGenModule.cpp.
References clang::XRayInstrKind::Function, clang::Decl::getBeginLoc(), getContext(), clang::SourceManager::getFileID(), clang::Decl::getKind(), clang::SourceManager::getMainFileID(), clang::ASTContext::getSourceManager(), LimitedCoverage(), and SM.
Referenced by EmitTopLevelDecl().
|
inline |
Definition at line 1247 of file CodeGenModule.h.
References clang::CodeGen::NotForDefinition, Offset, and Priority.
void CodeGenModule::AddDependentLib | ( | StringRef | Lib | ) |
Appends a dependent lib to the appropriate metadata value.
Definition at line 1963 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 1954 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 2252 of file CodeGenModule.cpp.
References EmitAnnotateAttr(), clang::Decl::getLocation(), clang::Decl::hasAttr(), and clang::Decl::specific_attrs().
Referenced by emitOpenMPDeviceFunctionRedefinition(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), HandleCXXStaticMemberVarInstantiation(), and maybeSetTrivialComdat().
void CodeGenModule::addGlobalValReplacement | ( | llvm::GlobalValue * | GV, |
llvm::Constant * | C | ||
) |
Definition at line 271 of file CodeGenModule.cpp.
void CodeGenModule::addReplacement | ( | StringRef | Name, |
llvm::Constant * | C | ||
) |
Definition at line 236 of file CodeGenModule.cpp.
Referenced by emitConstructorDestructorAlias().
void CodeGenModule::addUsedGlobal | ( | llvm::GlobalValue * | GV | ) |
Add a global to a list to be added to the llvm.used metadata.
Definition at line 1906 of file CodeGenModule.cpp.
Referenced by buildGlobalBlock(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::emitDeclareTargetVarDefinition(), emitGlobalDtorWithTLRegDtor(), 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 5887 of file CodeGenModule.cpp.
References CreateCrossDsoCfiTypeId(), CreateMetadataIdentifierForType(), getLLVMContext(), clang::CharUnits::getQuantity(), clang::TypeDecl::getTypeForDecl(), and NeedAllVtablesTypeId().
void CodeGenModule::AppendLinkerOptions | ( | StringRef | Opts | ) |
Appends Opts to the "llvm.linker.options" metadata value.
Definition at line 1949 of file CodeGenModule.cpp.
References getLLVMContext().
Referenced by emitGlobalDtorWithTLRegDtor(), and EmitTopLevelDecl().
void CodeGenModule::clear | ( | ) |
Definition at line 380 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 5539 of file CodeGenModule.cpp.
llvm::Function * CodeGenModule::codegenCXXStructor | ( | GlobalDecl | GD | ) |
Definition at line 207 of file CGCXX.cpp.
References clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::ForDefinition, clang::CodeGen::CodeGenFunction::GenerateCode(), getAddrOfCXXStructor(), clang::GlobalDecl::getDecl(), getTypes(), setFunctionLinkage(), and SetLLVMFunctionAttributesForDefinition().
Referenced by decomposeTypeForEH(), and emitConstructorDestructorAlias().
CharUnits CodeGenModule::computeNonVirtualBaseClassOffset | ( | const CXXRecordDecl * | DerivedClass, |
CastExpr::path_const_iterator | Start, | ||
CastExpr::path_const_iterator | End | ||
) |
Definition at line 150 of file CGClass.cpp.
References clang::Type::castAs(), End, clang::ASTContext::getASTRecordLayout(), getContext(), clang::CXXBaseSpecifier::getType(), clang::CXXBaseSpecifier::isVirtual(), Offset, and clang::CharUnits::Zero().
Referenced by GetNonVirtualBaseClassOffset().
void CodeGenModule::ConstructAttributeList | ( | StringRef | Name, |
const CGFunctionInfo & | Info, | ||
CGCalleeInfo | CalleeInfo, | ||
llvm::AttributeList & | Attrs, | ||
unsigned & | CallingConv, | ||
bool | AttrOnCallSite | ||
) |
Get the LLVM attributes and calling convention to use for a particular function type.
Name | - The function name. |
Info | - The function type information. |
CalleeInfo | - The callee information these attributes are being constructed for. If valid, the attributes applied to this decl may contribute to the function attributes and calling convention. |
Attrs | [out] - On return, the attribute list to use. |
CallingConv | [out] - On return, the LLVM calling convention to use. |
Definition at line 1836 of file CGCall.cpp.
References AddAttributesFromFunctionProtoType(), clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_end(), clang::CodeGen::CGFunctionInfo::arg_size(), clang::CodeGen::ABIArgInfo::CoerceAndExpand, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::CodeGen::ABIArgInfo::Direct, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::FunctionType::ExtParameterInfo::getABI(), clang::Type::getAs(), clang::CodeGen::CGCalleeInfo::getCalleeDecl(), clang::CodeGen::CGCalleeInfo::getCalleeFunctionProtoType(), clang::CodeGen::CodeGenTypes::getContext(), clang::GlobalDecl::getDecl(), clang::CodeGen::CGFunctionInfo::getEffectiveCallingConvention(), clang::CodeGen::CGFunctionInfo::getExtParameterInfo(), clang::CodeGen::ABIArgInfo::getIndirectAlign(), clang::CodeGen::ABIArgInfo::getIndirectByVal(), clang::CodeGen::ABIArgInfo::getInReg(), clang::CodeGen::ABIArgInfo::getKind(), clang::CodeGen::CodeGenTypes::getLLVMContext(), clang::CodeGen::ABIArgInfo::getPaddingInReg(), clang::Type::getPointeeType(), clang::CharUnits::getQuantity(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::ASTContext::getTypeInfoInChars(), clang::CodeGen::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::CGFunctionInfo::isChainCall(), clang::Type::isConstantSizeType(), clang::Type::isIncompleteType(), clang::FunctionType::ExtParameterInfo::isNoEscape(), clang::CodeGen::CGFunctionInfo::isNoReturn(), clang::CodeGen::ABIArgInfo::isSignExt(), clang::CXXMethodDecl::isVirtual(), clang::Type::isVoidType(), clang::CharUnits::isZero(), clang::CodeGen::Ordinary, clang::SwiftContext, clang::SwiftErrorResult, and clang::SwiftIndirectResult.
Referenced by SetLLVMFunctionAttributes().
|
inline |
Create or return a runtime function declaration with the specified type and name.
This will automatically add the convergent attribute to the function declaration.
Definition at line 1047 of file CodeGenModule.h.
References EmitNullConstant(), and EmitNullConstantForBase().
Referenced by clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction().
llvm::ConstantInt * CodeGenModule::CreateCrossDsoCfiTypeId | ( | llvm::Metadata * | MD | ) |
Generate a cross-DSO type identifier for MD.
Definition at line 1225 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypeCache::Int64Ty.
Referenced by AddVTableTypeMetadata(), CreateFunctionTypeMetadataForIcall(), and clang::CodeGen::CodeGenFunction::EmitCall().
void CodeGenModule::CreateFunctionTypeMetadataForIcall | ( | const FunctionDecl * | FD, |
llvm::Function * | F | ||
) |
Create and attach type metadata to the given function.
Definition at line 1786 of file CodeGenModule.cpp.
References CreateCrossDsoCfiTypeId(), CreateMetadataIdentifierForType(), CreateMetadataIdentifierGeneralized(), clang::Decl::getAttr(), getCodeGenOpts(), getCXXABI(), clang::DeclarationName::getCXXOverloadedOperator(), clang::GlobalDecl::getDecl(), clang::NamedDecl::getDeclName(), getLangOpts(), getLLVMContext(), getOpenMPRuntime(), getTargetCodeGenInfo(), getTriple(), clang::ValueDecl::getType(), getTypes(), clang::SanitizerSet::has(), clang::Decl::hasAttr(), clang::FunctionDecl::isInlineBuiltinDeclaration(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::LangOptions::Sanitize, setGVProperties(), setLinkageForGV(), SetLLVMFunctionAttributes(), and clang::CodeGen::TargetCodeGenInfo::setTargetAttributes().
Referenced by SetLLVMFunctionAttributesForDefinition().
llvm::Function * CodeGenModule::CreateGlobalInitOrDestructFunction | ( | llvm::FunctionType * | ty, |
const Twine & | name, | ||
const CGFunctionInfo & | FI, | ||
SourceLocation | Loc = SourceLocation() , |
||
bool | TLS = false |
||
) |
Definition at line 336 of file CGDeclCXX.cpp.
Referenced by clang::CodeGen::CodeGenFunction::createAtExitStub(), clang::CodeGen::emitDeclareTargetVarDefinition(), emitGlobalDtorWithTLRegDtor(), clang::CodeGen::emitRequiresDirectiveRegFun(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), and getThreadLocalWrapperLinkage().
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 5827 of file CodeGenModule.cpp.
Referenced by AddVTableTypeMetadata(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenFunction::EmitCall(), 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 5832 of file CodeGenModule.cpp.
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 5868 of file CodeGenModule.cpp.
References GeneralizeFunctionType(), and getContext().
Referenced by CreateFunctionTypeMetadataForIcall(), and clang::CodeGen::CodeGenFunction::EmitCall().
llvm::Value * CodeGenModule::createOpenCLIntToSamplerConversion | ( | const Expr * | E, |
CodeGenFunction & | CGF | ||
) |
Definition at line 5912 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CreateRuntimeFunction(), clang::CodeGen::ConstantEmitter::emitAbstract(), getOpenCLRuntime(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), clang::Expr::getType(), and clang::QualType::getTypePtr().
Referenced by clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().
llvm::GlobalVariable * CodeGenModule::CreateOrReplaceCXXRuntimeVariable | ( | StringRef | Name, |
llvm::Type * | Ty, | ||
llvm::GlobalValue::LinkageTypes | Linkage, | ||
unsigned | Alignment | ||
) |
Will return a global variable of the given type.
If a variable with a different type already exists then a new variable with the right type will be created and all uses of the old variable will be replaced with a bitcast to the new variable.
Definition at line 3643 of file CodeGenModule.cpp.
llvm::FunctionCallee CodeGenModule::CreateRuntimeFunction | ( | llvm::FunctionType * | FTy, |
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 3366 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), createOpenCLIntToSamplerConversion(), clang::CodeGen::createRuntimeFunction(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable(), emitCheckHandlerCall(), emitGlobalDtorWithCXAAtExit(), emitGlobalDtorWithTLRegDtor(), clang::CodeGen::CodeGenFunction::emitImplicitAssignmentOperatorBody(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCRelease(), emitObjCValueOperation(), emitRTtypeidCall(), clang::CodeGen::CodeGenVTables::EmitThunks(), getAllocateExceptionFn(), getBadCastFn(), getBadTypeidFn(), getBeginCatchFn(), getClangCallTerminateFn(), getEndCatchFn(), getFreeExceptionFn(), getGetExceptionPtrFn(), getGuardAbortFn(), getGuardAcquireFn(), getGuardReleaseFn(), getInitThreadAbortFn(), getInitThreadFooterFn(), getInitThreadHeaderFn(), getItaniumDynamicCastFn(), getPersonalityFn(), getTerminateFn(), getThrowFn(), getUnexpectedFn(), and clang::CodeGen::CodeGenFunction::registerGlobalDtorWithAtExit().
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 3710 of file CodeGenModule.cpp.
Referenced by emitGlobalDtorWithCXAAtExit(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), GetAddrOfConstantCFString(), and GetConstantStringEntry().
Address CodeGenModule::createUnnamedGlobalFrom | ( | const VarDecl & | D, |
llvm::Constant * | Constant, | ||
CharUnits | Align | ||
) |
Definition at line 1081 of file CGDecl.cpp.
References clang::CodeGen::CodeGenFunction::getContext(), and clang::ASTContext::getTargetAddressSpace().
Referenced by createUnnamedGlobalForMemcpyFrom(), and clang::CodeGen::CodeGenFunction::EmitDeclRefLValue().
void CodeGenModule::DecorateInstructionWithInvariantGroup | ( | llvm::Instruction * | I, |
const CXXRecordDecl * | RD | ||
) |
Adds !invariant.barrier !tag to instruction.
Definition at line 738 of file CodeGenModule.cpp.
References getLLVMContext().
void CodeGenModule::DecorateInstructionWithTBAA | ( | llvm::Instruction * | Inst, |
TBAAAccessInfo | TBAAInfo | ||
) |
DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag.
Definition at line 732 of file CodeGenModule.cpp.
References getTBAAAccessTagInfo().
Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfReference(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), and clang::CodeGen::CodeGenFunction::EmitStoreOfScalar().
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 2228 of file CodeGenModule.cpp.
References EmitAnnotationLineNo(), EmitAnnotationString(), EmitAnnotationUnit(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.
Referenced by AddGlobalAnnotations().
llvm::Constant * CodeGenModule::EmitAnnotationLineNo | ( | SourceLocation | L | ) |
Emit the annotation line number.
Definition at line 2220 of file CodeGenModule.cpp.
References getContext(), clang::SourceManager::getExpansionLineNumber(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::PresumedLoc::isValid(), and SM.
Referenced by EmitAnnotateAttr(), and clang::CodeGen::CodeGenFunction::EmitAnnotationCall().
llvm::Constant * CodeGenModule::EmitAnnotationString | ( | StringRef | Str | ) |
Emit an annotation string.
Definition at line 2196 of file CodeGenModule.cpp.
References getLLVMContext(), and getModule().
Referenced by EmitAnnotateAttr(), clang::CodeGen::CodeGenFunction::EmitAnnotationCall(), and EmitAnnotationUnit().
llvm::Constant * CodeGenModule::EmitAnnotationUnit | ( | SourceLocation | Loc | ) |
Emit the annotation's translation unit.
Definition at line 2212 of file CodeGenModule.cpp.
References EmitAnnotationString(), clang::SourceManager::getBufferName(), getContext(), clang::PresumedLoc::getFilename(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::PresumedLoc::isValid(), and SM.
Referenced by EmitAnnotateAttr(), and clang::CodeGen::CodeGenFunction::EmitAnnotationCall().
void CodeGenModule::EmitDeferredUnusedCoverageMappings | ( | ) |
Emit all the deferred coverage mappings for the uninstrumented functions.
Definition at line 5554 of file CodeGenModule.cpp.
References clang::Ctor_Base, clang::Dtor_Base, clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping(), clang::XRayInstrKind::Function, 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 1023 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::Expr::getType(), and clang::Type::isVariablyModifiedType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(), and findPeephole().
void CodeGenModule::EmitExternalDeclaration | ( | const VarDecl * | D | ) |
Definition at line 3745 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 2444 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), clang::VarDecl::Definition, clang::FunctionDecl::doesDeclarationForceExternallyVisibleDefinition(), clang::FunctionDecl::doesThisDeclarationHaveABody(), EmitOMPDeclareMapper(), EmitOMPDeclareReduction(), GetAddrOfGlobalVar(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), clang::ASTContext::getInlineVariableDefinitionKind(), getLangOpts(), getMangledName(), getOpenMPRuntime(), getTypes(), clang::Decl::hasAttr(), clang::ASTContext::isMSStaticDataMemberInlineDefinition(), clang::ASTContext::Strong, and clang::CodeGen::Type.
Referenced by clang::CodeGen::emitDeferredTargetDecls(), and EmitTopLevelDecl().
void CodeGenModule::EmitGlobalAnnotations | ( | ) |
Emit all the global annotations.
Definition at line 2183 of file CodeGenModule.cpp.
References getModule().
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 2295 of file CGExprConstant.cpp.
References clang::Type::castAs(), EmitNullConstant(), clang::CodeGen::ConstantEmitter::emitNullForMemory(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ArrayType::getElementType(), clang::ConstantArrayType::getSize(), and clang::Type::isMemberDataPointerType().
Referenced by clang::CodeGen::ConstantEmitter::emitAbstract(), emitInitWithReductionInitializer(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitNullConstant(), clang::CodeGen::ConstantEmitter::emitNullForMemory(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), isSimpleZero(), maybeSetTrivialComdat(), 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 2326 of file CGExprConstant.cpp.
References EmitNullConstant().
Referenced by EmitNullBaseClassInitialization().
void CodeGenModule::EmitOMPDeclareMapper | ( | const OMPDeclareMapperDecl * | D, |
CodeGenFunction * | CGF = nullptr |
||
) |
Emit a code for declare mapper construct.
Definition at line 2527 of file CGDecl.cpp.
References 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 2520 of file CGDecl.cpp.
References 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 2535 of file CGDecl.cpp.
void CodeGenModule::EmitOMPThreadPrivateDecl | ( | const OMPThreadPrivateDecl * | D | ) |
Emit a code for threadprivate directive.
D | Threadprivate declaration. |
Definition at line 5787 of file CodeGenModule.cpp.
References clang::CodeGen::emitThreadPrivateVarDefinition(), GetAddrOfGlobalVar(), clang::QualType::getCanonicalType(), getContext(), getCXXABI(), getDeclAlign(), clang::Type::getLinkage(), getLLVMContext(), clang::CodeGen::CGCXXABI::getMangleContext(), getOpenMPRuntime(), clang::isExternallyVisible(), clang::MangleContext::mangleTypeName(), and clang::OMPThreadPrivateDecl::varlists().
void CodeGenModule::emitOpenMPDeviceFunctionRedefinition | ( | GlobalDecl | OldGD, |
GlobalDecl | NewGD, | ||
llvm::GlobalValue * | GV | ||
) |
Emits the definition of OldGD
function with body from NewGD
.
Required for proper handling of declare variant directive on the GPU.
Definition at line 2774 of file CodeGenModule.cpp.
References AddGlobalAnnotations(), clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), clang::CodeGen::ForDefinition, clang::CodeGen::CodeGenFunction::GenerateCode(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getLangOpts(), getMangledName(), clang::ASTContext::getSourceManager(), getTypes(), MaybeHandleStaticInExternC(), maybeSetTrivialComdat(), setFunctionLinkage(), setGVProperties(), and SetLLVMFunctionAttributesForDefinition().
Referenced by clang::CodeGen::CGOpenMPRuntimeNVPTX::tryEmitDeclareVariant().
void CodeGenModule::EmitTentativeDefinition | ( | const VarDecl * | D | ) |
Definition at line 3722 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 5263 of file CodeGenModule.cpp.
References AddDeferredUnusedCoverageMapping(), AddDependentLib(), AddDetectMismatch(), AppendLinkerOptions(), clang::ExternalASTSource::EK_Never, clang::CodeGen::CGCXXABI::EmitCXXConstructors(), clang::CodeGen::CGCXXABI::EmitCXXDestructors(), EmitGlobal(), clang::XRayInstrKind::Function, clang::CodeGen::CodeGenFunction::GenerateObjCMethod(), clang::Decl::getASTContext(), getCodeGenOpts(), getContext(), getCXXABI(), clang::ASTContext::getExternalSource(), clang::Decl::getKind(), getModule(), getModuleDebugInfo(), clang::Decl::isTemplated(), clang::PCK_Compiler, clang::PCK_ExeStr, clang::PCK_Lib, clang::PCK_Linker, clang::PCK_Unknown, clang::PCK_User, and clang::TSK_ExplicitInstantiationDefinition.
Referenced by AllTrivialInitializers(), and HandleCXXStaticMemberVarInstantiation().
void CodeGenModule::EmitVTable | ( | CXXRecordDecl * | theClass | ) |
This is a callback from Sema to tell us that a particular vtable is required to be emitted in this translation unit.
This is only called for vtables that must be emitted (mainly due to key functions). For weak vtables, CodeGen tracks when they are needed and emits them as-needed.
Definition at line 924 of file CGVTables.cpp.
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 1072 of file CGVTables.cpp.
void CodeGenModule::Error | ( | SourceLocation | loc, |
StringRef | error | ||
) |
Emit a general error that something can't be done.
Definition at line 744 of file CodeGenModule.cpp.
References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getFullLoc(), and clang::DiagnosticsEngine::Report().
Referenced by clang::CodeGen::CGOpenMPRuntimeNVPTX::checkArchForUnifiedAddressing(), createCoroData(), clang::CodeGen::ConstantEmitter::emitAbstract(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), and getBundlesForCoroEnd().
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 751 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), AddVariableConstraints(), AllTrivialInitializers(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), emitGlobalDtorWithTLRegDtor(), clang::CodeGen::CodeGenFunction::EmitNVPTXDevicePrintfCallExpr(), findPeephole(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), and maybeSetTrivialComdat().
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 761 of file CodeGenModule.cpp.
References clang::DiagnosticsEngine::Error, clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), clang::ASTContext::getFullLoc(), clang::Decl::getLocation(), clang::DiagnosticsEngine::Report(), and clang::CodeGen::Type.
void CodeGenModule::GenOpenCLArgMetadata | ( | 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 1279 of file CodeGenModule.cpp.
References ArgInfoAddressSpace(), clang::CodeGen::CodeGenFunction::Builder, clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::QualType::getAsString(), clang::Decl::getAttr(), clang::QualType::getCanonicalType(), getCodeGenOpts(), clang::NamedDecl::getName(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::ASTContext::getPrintingPolicy(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::QualType::isCanonical(), clang::QualType::isConstQualified(), clang::Type::isImageType(), clang::Type::isPipeType(), clang::Type::isPointerType(), clang::QualType::isRestrictQualified(), clang::QualType::isVolatileQualified(), 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 221 of file CGCXX.cpp.
References clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::Dtor_Base, clang::Dtor_Complete, clang::TargetInfo::getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getMangledName(), getTarget(), getTypes(), clang::GlobalDecl::getWithDtorType(), and clang::TargetCXXABI::isMicrosoft().
Referenced by EmitDeclDestroy(), and pushTemporaryCleanup().
ConstantAddress CodeGenModule::GetAddrOfConstantCFString | ( | const StringLiteral * | Literal | ) |
Return a pointer to a constant CFString object for the given string.
Definition at line 4662 of file CodeGenModule.cpp.
References clang::TranslationUnitDecl::castToDeclContext(), clang::LangOptions::CFRuntime, clang::CodeGen::CodeGenTypes::ConvertType(), CreateRuntimeVariable(), clang::ExternalLinkage, 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::LangOptions::Swift, clang::LangOptions::Swift4_1, clang::LangOptions::Swift4_2, clang::LangOptions::Swift5_0, clang::CodeGen::Type, and clang::interp::Zero().
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 2167 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 2154 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 5014 of file CodeGenModule.cpp.
References castStringLiteralToDefaultAddressSpace(), GenerateStringLiteral(), clang::ASTContext::getAlignOfGlobalVarInChars(), getContext(), and getLLVMContext().
Referenced by buildBlockDescriptor(), createConstantGlobalStructAndAddToParent(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), GetAddrOfConstantStringFromObjCEncode(), and getBlockLayoutInfoString().
ConstantAddress clang::CodeGen::CodeGenModule::GetAddrOfConstantString | ( | const StringLiteral * | Literal | ) |
Return a pointer to a constant NSString object for the given string.
Or a user defined String object as defined via -fconstant-string-class=class_name option.
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 4956 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 5004 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 978 of file CodeGenModule.h.
References clang::CodeGen::NotForDefinition.
Referenced by codegenCXXStructor(), decomposeTypeForEH(), 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 3298 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertType(), clang::Dtor_Base, clang::Dtor_Complete, clang::TargetInfo::getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), getMangledName(), getTarget(), clang::ValueDecl::getType(), getTypes(), and clang::TargetCXXABI::isMicrosoft().
Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), EmitFunctionDeclPointer(), EmitNewDeleteCall(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfGlobal(), and HandleCXXStaticMemberVarInstantiation().
llvm::Constant * CodeGenModule::GetAddrOfGlobal | ( | GlobalDecl | GD, |
ForDefinition_t | IsForDefinition = NotForDefinition |
||
) |
Definition at line 3621 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::getAddrOfDeclareTargetVar(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().
llvm::Constant * CodeGenModule::GetAddrOfGlobalBlock | ( | const BlockExpr * | BE, |
StringRef | Name | ||
) |
Gets the address of a block which requires no captures.
Definition at line 1361 of file CGBlocks.cpp.
References clang::CodeGen::CGBlockInfo::Block, clang::CodeGen::CGBlockInfo::BlockExpression, computeBlockInfo(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::BlockExpr::getBlockDecl(), and clang::CodeGen::CGBlockInfo::Name.
|
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 911 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 5048 of file CodeGenModule.cpp.
References getContext(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), 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 3692 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), getContext(), getMangledName(), clang::ValueDecl::getType(), getTypes(), and clang::VarDecl::hasGlobalStorage().
Referenced by EmitGlobal(), EmitGlobalVarDeclLValue(), EmitOMPThreadPrivateDecl(), GetAddrOfGlobal(), HandleCXXStaticMemberVarInstantiation(), isTypeConstant(), and maybeSetTrivialComdat().
Get the address of the RTTI descriptor for the given type.
Definition at line 5772 of file CodeGenModule.cpp.
References clang::CodeGen::CGCXXABI::getAddrOfRTTIDescriptor(), getCXXABI(), getLangOpts(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::Type::isObjCObjectPointerType().
Referenced by detectAmbiguousBases(), clang::CodeGen::CodeGenFunction::EmitCall(), emitRTtypeidCall(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), getBadTypeidFn(), and clang::CodeGen::CodeGenFunction::StartFunction().
llvm::Constant * CodeGenModule::GetAddrOfThunk | ( | StringRef | Name, |
llvm::Type * | FnTy, | ||
GlobalDecl | GD | ||
) |
Get the address of the thunk for the given global decl.
Definition at line 34 of file CGVTables.cpp.
ConstantAddress CodeGenModule::GetAddrOfUuidDescriptor | ( | const CXXUuidofExpr * | E | ) |
Get the address of a uuid descriptor .
Definition at line 2385 of file CodeGenModule.cpp.
References clang::CXXUuidofExpr::getUuidStr().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXUuidofExpr().
|
inline |
Definition at line 651 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction().
|
inline |
Definition at line 643 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 1186 of file CGBlocks.cpp.
References clang::serialized_diags::create(), clang::OpenCL, clang::opencl_constant, and clang::CodeGen::Type.
Referenced by buildBlockDescriptor(), and initializeForBlockHeader().
StringRef CodeGenModule::getBlockMangledName | ( | GlobalDecl | GD, |
const BlockDecl * | BD | ||
) |
Definition at line 1121 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 2994 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), and clang::CodeGen::Type.
llvm::FunctionCallee CodeGenModule::getBlockObjectDispose | ( | ) |
Definition at line 2981 of file CGBlocks.cpp.
References configureBlocksRuntimeObject(), and clang::CodeGen::Type.
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 82 of file CGBuiltin.cpp.
CharUnits CodeGenModule::getClassPointerAlignment | ( | const CXXRecordDecl * | RD | ) |
Returns the assumed alignment of an opaque pointer to the given class.
Return the best known alignment for an unknown pointer to a particular class.
Definition at line 37 of file CGClass.cpp.
References clang::ASTRecordLayout::getAlignment(), clang::ASTContext::getASTRecordLayout(), getContext(), clang::Decl::hasAttr(), clang::TagDecl::isCompleteDefinition(), and clang::CharUnits::One().
Referenced by clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), clang::CodeGen::CodeGenFunction::getNaturalTypeAlignment(), InitCatchParam(), and PerformReturnAdjustment().
|
inline |
Definition at line 680 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::AlwaysEmitXRayCustomEvents(), clang::CodeGen::CodeGenFunction::AlwaysEmitXRayTypedEvents(), clang::CodeGen::CGDebugInfo::CGDebugInfo(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenFunction::EmitARCDestroyStrong(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), emitCheckHandlerCall(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDeclRefExprDbgValue(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitSanitizerStatReport(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTrapCheck(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), emitWritebackArg(), enterBlockScope(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), GenOpenCLArgMetadata(), clang::CodeGen::CodeGenFunction::getARCCleanupKind(), getBlockDescriptorName(), clang::CodeGen::CodeGenTypes::getCodeGenOpts(), getCodegenToUse(), getCopyDestroyHelperFuncName(), GetIntrinsic(), getRangeForType(), clang::CodeGen::CodeGenFunction::incrementProfileCounter(), lookupRepresentativeDecl(), maybeSetTrivialComdat(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), needsTypeIdentifier(), Release(), requiresMemberFunctionPointerTypeMetadata(), shouldAssumeDSOLocal(), shouldEmitAvailableExternallyVTable(), shouldEmitVTableThunk(), clang::CodeGen::CodeGenFunction::ShouldInstrumentFunction(), clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue(), shouldSplitConstantStore(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), clang::CodeGen::CodeGenFunction::ShouldXRayInstrumentFunction(), clang::CodeGen::CodeGenFunction::StartFunction(), TryEmitBaseDestructorAsAlias(), tryGenerateSpecializedMessageSend(), and TypeRequiresBuiltinLaunder().
llvm::Constant * CodeGenModule::GetConstantArrayFromStringLiteral | ( | const StringLiteral * | E | ) |
Return a constant array for the given string.
Definition at line 4891 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertType(), clang::ASTContext::getAsConstantArrayType(), clang::StringLiteral::getCharByteWidth(), clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), clang::StringLiteral::getString(), clang::Expr::getType(), getTypes(), clang::Type::isPointerType(), and clang::CodeGen::Type.
|
inline |
Definition at line 674 of file CodeGenModule.h.
Referenced by AddDeferredUnusedCoverageMapping(), clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), AllTrivialInitializers(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), buildBlockDescriptor(), buildByrefHelpers(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), buildGlobalBlock(), clang::CodeGen::CGCXXABI::buildThisParam(), CanUseSingleInheritance(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CGOpenMPRuntime::CGOpenMPRuntime(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), classifyType(), clang::CodeGen::CGOpenMPRuntimeNVPTX::clear(), clang::CodeGen::CGObjCRuntime::ComputeBitfieldBitOffset(), computeBlockInfo(), clang::CodeGen::CGObjCRuntime::ComputeIvarBaseOffset(), computeNonVirtualBaseClassOffset(), ComputeVMIClassTypeInfoFlags(), configureBlocksRuntimeObject(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), clang::CodeGen::CodeGenFunction::createAtExitStub(), createConstantGlobalStructAndAddToParent(), clang::CodeGen::CreateItaniumCXXABI(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), CreateMetadataIdentifierGeneralized(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), createPrivatesRecordDecl(), decomposeTypeForEH(), clang::CodeGen::SanitizerMetadata::disableSanitizerForInstruction(), EmitAnnotationLineNo(), EmitAnnotationUnit(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::emitDeclareTargetVarDefinition(), EmitDeclDestroy(), emitDestructorsFunction(), clang::CodeGen::ConstantEmitter::emitForMemory(), EmitFunctionDeclPointer(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), clang::CodeGen::CodeGenFunction::EmitInheritedCXXConstructorCall(), emitInterWarpCopyFunction(), clang::CodeGen::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLambdaDelegatingInvokeBody(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CGCXXABI::EmitMemberFunctionPointer(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), EmitOMPThreadPrivateDecl(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitOutlinedFunctionCall(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReductionCombiner(), emitReductionListCopy(), clang::CodeGen::emitRequiresDirectiveRegFun(), clang::CodeGen::CodeGenFunction::EmitScalarRangeCheck(), clang::CodeGen::CodeGenFunction::EmitSEHExceptionCodeSave(), emitShuffleAndReduceFunction(), clang::CodeGen::emitTargetNumIterationsCall(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), emitTaskDupFunction(), clang::CodeGen::emitTaskInit(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitTeamsOutlinedFunction(), clang::CodeGen::emitThreadPrivateVarInit(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CGOpenMPRuntime::emitUpdateLocation(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), extractFieldType(), extractPBaseFlags(), FindIvarInterface(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), GenerateStringLiteral(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDerivedClass(), clang::CodeGen::CodeGenFunction::GetAddressOfDirectBaseInCompleteClass(), clang::CodeGen::CGOpenMPRuntimeNVPTX::getAddressOfLocalVariable(), GetAddrOfConstantCFString(), GetAddrOfConstantCString(), GetAddrOfConstantStringFromObjCEncode(), clang::CodeGen::getAddrOfDeclareTargetVar(), GetAddrOfGlobalTemporary(), GetAddrOfGlobalVar(), getAsmSrcLocInfo(), getBlockCaptureStr(), getBlockDescriptorName(), getBlockLayoutInfoString(), getClassPointerAlignment(), clang::CodeGen::CGCXXABI::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), getDeclareVariantFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::getDefaultFirstprivateAddressSpace(), getDynamicOffsetAlignment(), getFunctionLinkage(), GetGCAttrTypeForType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAcquireFn(), getLLVMLinkageVarDefinition(), getMaxAtomicAccessSize(), clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize(), getNonMemoryType(), clang::CodeGen::getNonTrivialCStructCopyAssignmentOperator(), clang::CodeGen::getNonTrivialCStructCopyConstructor(), clang::CodeGen::getNonTrivialCStructDefaultConstructor(), clang::CodeGen::getNonTrivialCStructDestructor(), clang::CodeGen::getNonTrivialCStructMoveAssignmentOperator(), clang::CodeGen::getNonTrivialCStructMoveConstructor(), GetNonVirtualBaseClassOffset(), clang::CodeGen::getOrCreateThreadPrivateCache(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), clang::CodeGen::getTgtOffloadEntryQTy(), getTypeInfoLinkage(), getVBaseAlignment(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), GetWeakRefReference(), hasMRCWeakIvars(), hasRequiredFeatures(), imbueXRayAttrs(), InitCatchParam(), clang::CodeGen::initializationPatternFor(), initializeForBlockHeader(), isInSanitizerBlacklist(), clang::CodeGen::swiftcall::isLegalIntegerType(), isTrivialFiller(), isTypeConstant(), clang::CodeGen::CodeGenVTables::isVTableExternal(), isWeakLinkedClass(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::LastprivateConditionalRAII(), maybeSetTrivialComdat(), clang::CodeGen::registerTargetFirstprivateCopy(), clang::CodeGen::registerTargetGlobalVariable(), requiresAMDGPUDefaultVisibility(), SetCommonAttributes(), SetLLVMFunctionAttributesForDefinition(), shouldBeInCOMDAT(), clang::CodeGen::CodeGenFunction::ShouldEmitVTableTypeCheckedLoad(), clang::CodeGen::CodeGenFunction::StartThunk(), supportsLightweightRuntime(), clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter(), clang::CodeGen::ConstantEmitter::tryEmitPrivate(), clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(), and TypeRequiresBuiltinLaunder().
|
inline |
Definition at line 613 of file CodeGenModule.h.
|
inline |
Return a reference to the configured CUDA runtime.
Definition at line 596 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateCode(), getMangledName(), and maybeSetTrivialComdat().
|
inline |
Definition at line 691 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), CalculateCookiePadding(), commonEmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateFunctionTypeMetadataForIcall(), EmitArrayDelete(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), EmitCompare(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), EmitDeclDestroy(), EmitDestroyingObjectDelete(), EmitDynamicCastToNull(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), EmitGlobalVarDeclLValue(), EmitMemberInitializer(), EmitNullBaseClassInitialization(), EmitObjectDelete(), EmitOMPThreadPrivateDecl(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenVTables::EmitThunks(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), EmitTypeidFromVTable(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), GetAddrOfRTTIDescriptor(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), GetAddrOfVTTVTable(), getBlockCaptureStr(), getBlockMangledName(), getFunctionLinkage(), GetIntrinsic(), getMangledNameImpl(), getTerminateFn(), getTypeIdentifier(), PerformReturnAdjustment(), clang::CodeGen::CGCallee::prepareConcreteCallee(), pushTemporaryCleanup(), setDLLImportDLLExport(), SetLLVMFunctionAttributesForDefinition(), setThunkProperties(), shouldEmitAvailableExternallyVTable(), clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::StartThunk(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Definition at line 683 of file CodeGenModule.h.
Referenced by AddVariableConstraints(), CoerceIntOrPtrToIntOrPtr(), constStructWithPadding(), CreateCoercedLoad(), CreateCoercedStore(), CreateTempAllocaForCoercion(), clang::CodeGen::CodeGenFunction::EmitAlignmentAssumption(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), EmitGEPOffsetInBytes(), clang::CodeGen::CodeGenFunction::EmitLifetimeEnd(), clang::CodeGen::CodeGenFunction::EmitLifetimeStart(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitNVPTXDevicePrintfCallExpr(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), emitPointerArithmetic(), emitStoresForConstant(), emitVoidPtrDirectVAArg(), emitWriteback(), emitWritebackArg(), EnterStructPointerForCoercedAccess(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalInitFunc(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), GetAddrOfConstantCFString(), clang::CodeGen::CodeGenFunction::getBlockByrefInfo(), getBlockLayoutInfoString(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), GetGCAttrTypeForType(), clang::CodeGen::swiftcall::getNaturalAlignment(), getOpaquePersonalityFn(), GetTargetTypeStoreSize(), getTypeAllocSize(), getTypeStoreSize(), initializeForBlockHeader(), isFullSizeType(), clang::CodeGen::DominatingLLVMValue::save(), and clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().
|
inline |
Definition at line 682 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::checkTargetFeatures(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), emitAArch64DeclareSimdFunction(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), Error(), ErrorUnsupported(), getAliasedGlobal(), getCudaArch(), isTypeConstant(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::LastprivateConditionalRAII(), clang::CodeGen::loadOffloadInfoMetadata(), Release(), and clang::CodeGen::CodeGenFunction::StartFunction().
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 71 of file CGClass.cpp.
References clang::ASTContext::getASTRecordLayout(), getContext(), clang::TagDecl::isCompleteDefinition(), and min().
Referenced by getVBaseAlignment().
bool CodeGenModule::getExpressionLocationsEnabled | ( | ) | const |
Return true if we should emit location information for expressions.
Definition at line 4853 of file CodeGenModule.cpp.
llvm::GlobalValue::LinkageTypes CodeGenModule::getFunctionLinkage | ( | GlobalDecl | GD | ) |
Definition at line 1205 of file CodeGenModule.cpp.
References getContext(), getCXXABI(), clang::TargetInfo::getCXXABI(), clang::CodeGen::CGCXXABI::getCXXDestructorLinkage(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::ASTContext::GetGVALinkageForFunction(), getLLVMLinkageForDeclarator(), clang::ASTContext::getTargetInfo(), clang::InternalLinkage, and clang::TargetCXXABI::isMicrosoft().
Referenced by emitConstructorDestructorAlias(), EmitDeferredUnusedCoverageMappings(), getCodegenToUse(), HandleCXXStaticMemberVarInstantiation(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().
llvm::Type * CodeGenModule::getGenericBlockLiteralType | ( | ) |
The type of a generic block literal.
Definition at line 1218 of file CGBlocks.cpp.
References clang::serialized_diags::create(), clang::OpenCL, and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitBlockCallExpr().
|
inline |
Definition at line 710 of file CodeGenModule.h.
|
inline |
Definition at line 711 of file CodeGenModule.h.
llvm::GlobalValue * CodeGenModule::GetGlobalValue | ( | StringRef | Ref | ) |
Definition at line 1142 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::createOffloadEntriesAndInfoMetadata(), emitConstructorDestructorAlias(), EmitGlobal(), emitGlobalDtorWithTLRegDtor(), EmitTentativeDefinition(), getAliasedGlobal(), getMangledNameImpl(), getThreadLocalWrapperLinkage(), GetWeakRefReference(), HandleCXXStaticMemberVarInstantiation(), isTypeConstant(), lookupRepresentativeDecl(), clang::CodeGen::markAsGlobalTarget(), clang::CodeGen::registerTargetGlobalVariable(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().
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 3754 of file CodeGenModule.cpp.
References clang::cuda_constant, clang::cuda_device, clang::cuda_shared, clang::Default, clang::FirstTargetAddressSpace, clang::QualType::getAddressSpace(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), getTargetCodeGenInfo(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::QualType::isConstQualified(), clang::opencl_constant, clang::opencl_global, and clang::opencl_local.
Referenced by isTypeConstant(), and maybeSetTrivialComdat().
|
inline |
Definition at line 676 of file CodeGenModule.h.
llvm::Function * CodeGenModule::getIntrinsic | ( | unsigned | IID, |
ArrayRef< llvm::Type *> | Tys = None |
||
) |
Definition at line 4621 of file CodeGenModule.cpp.
References getModule().
Referenced by clang::CodeGen::CallArgList::allocateArgumentMemory(), buildFMulAdd(), emitARCCopyOperation(), clang::CodeGen::CodeGenFunction::EmitARCDestroyWeak(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), emitARCLoadOperation(), clang::CodeGen::CodeGenFunction::EmitARCRelease(), emitARCStoreOperation(), clang::CodeGen::CodeGenFunction::EmitARCStoreStrongCall(), emitARCValueOperation(), emitBinaryBuiltin(), emitBinaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCatchDispatchBlock(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), EmitCXXNewAllocSize(), EmitFAbs(), clang::CodeGen::CodeGenFunction::EmitFieldAnnotations(), emitFPIntBuiltin(), EmitGEPOffsetInBytes(), clang::CodeGen::CodeGenFunction::EmitInvariantStart(), emitMaybeConstrainedFPToIntRoundBuiltin(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolPush(), EmitOverflowIntrinsic(), emitRangedBuiltin(), EmitScalarFMAExpr(), EmitSystemZIntrinsicWithCC(), emitTernaryBuiltin(), emitTernaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitTrapCall(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), emitUnaryBuiltin(), emitUnaryMaybeConstrainedFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitVarAnnotations(), emitWasmCatchPadBlock(), EmitX86AddSubSatExpr(), EmitX86CompressExpand(), EmitX86CompressStore(), EmitX86ConvertIntToFp(), EmitX86ExpandLoad(), EmitX86FMAExpr(), EmitX86FunnelShift(), EmitX86Ternlog(), clang::CodeGen::CallArgList::freeArgumentMemory(), and GetIntrinsic().
|
inline |
Definition at line 702 of file CodeGenModule.h.
References clang::CodeGen::CodeGenVTables::getItaniumVTableContext().
Referenced by ComputeVMIClassTypeInfoFlags().
|
inline |
Definition at line 675 of file CodeGenModule.h.
Referenced by addMonoNonMonoModifier(), buildBlockDescriptor(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CGOpenMPRuntimeNVPTX::CGOpenMPRuntimeNVPTX(), computeBlockInfo(), configureBlocksRuntimeObject(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CreateGNUObjCRuntime(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(), clang::CodeGen::SanitizerMetadata::disableSanitizerForGlobal(), clang::CodeGen::CodeGenFunction::EmitARCReclaimReturnedObject(), EmitAtomicOp(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), EmitBaseInitializer(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCommonOMPTargetDirective(), clang::CodeGen::emitDeclareTargetVarDefinition(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), EmitGlobal(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolCleanup(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), EmitObjectDelete(), emitOpenMPDeviceFunctionRedefinition(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitParallelOutlinedFunction(), clang::CodeGen::emitRequiresDirectiveRegFun(), emitShuffleAndReduceFunction(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitTeamsOutlinedFunction(), clang::CodeGen::emitThreadPrivateVarInit(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), enterBlockScope(), FindIvarInterface(), GenerateStringLiteral(), clang::CodeGen::EHPersonality::get(), GetAddrOfConstantCFString(), clang::CodeGen::getAddrOfDeclareTargetVar(), GetAddrOfRTTIDescriptor(), getAsmSrcLocInfo(), getBlockDescriptorName(), getBlockLayoutInfoString(), getClangCallTerminateFn(), GetConstantStringEntry(), getCopyDestroyHelperFuncName(), getDataSharingMode(), GetGCAttrTypeForType(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), clang::CodeGen::CodeGenFunction::getLangOpts(), getLLVMLinkageForDeclarator(), getMangledName(), getMaxAtomicAccessSize(), clang::CodeGen::getOrCreateThreadPrivateCache(), getSMsBlocksPerSM(), getStaticDeclName(), getTerminateFn(), getTypeInfoLinkage(), hasMRCWeakIvars(), initializeForBlockHeader(), clang::CodeGen::initLastprivateConditionalCounter(), clang::CodeGen::isNontemporalDecl(), isWeakLinkedClass(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::LastprivateConditionalRAII(), clang::CodeGen::loadOffloadInfoMetadata(), clang::CodeGen::markAsGlobalTarget(), MaybeHandleStaticInExternC(), maybeSetTrivialComdat(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::NontemporalDeclsRAII(), clang::CodeGen::registerTargetGlobalVariable(), clang::CodeGen::SanitizerMetadata::reportGlobalToASan(), requiresAMDGPUDefaultVisibility(), setARCRuntimeFunctionLinkage(), setGlobalVisibility(), shouldAssumeDSOLocal(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), supportsLightweightRuntime(), tryCaptureAsConstant(), tryGenerateSpecializedMessageSend(), UseOptimizedSetter(), ~CodeGenModule(), and clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII().
|
inline |
Definition at line 692 of file CodeGenModule.h.
Referenced by AddDependentLib(), addLinkOptionsPostorder(), AddVTableTypeMetadata(), AppendLinkerOptions(), buildBlockDescriptor(), buildGlobalBlock(), computeBlockInfo(), constStructWithPadding(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), createUnnamedGlobalForMemcpyFrom(), decomposeTypeForEH(), DecorateInstructionWithInvariantGroup(), clang::CodeGen::SanitizerMetadata::disableSanitizerForInstruction(), EmitAnnotationString(), EmitAtomicOp(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInitBranch(), EmitGlobalDeclMetadata(), clang::CodeGen::CodeGenFunction::EmitNVPTXDevicePrintfCallExpr(), EmitOMPThreadPrivateDecl(), EmitSignBit(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::swiftcall::SwiftAggLowering::finish(), GetAddrOfConstantCString(), getClangCallTerminateFn(), clang::CodeGen::swiftcall::SwiftAggLowering::getCoerceAndExpandTypes(), clang::CodeGen::CGOpenCLRuntime::getGenericVoidPointerType(), getGuardAbortFn(), getGuardAcquireFn(), getGuardReleaseFn(), getInitThreadAbortFn(), getInitThreadFooterFn(), getInitThreadHeaderFn(), clang::CodeGen::CodeGenFunction::getLLVMContext(), getOpaquePersonalityFn(), clang::CodeGen::CGOpenCLRuntime::getPipeElemAlign(), clang::CodeGen::CGOpenCLRuntime::getPipeElemSize(), clang::CodeGen::CGOpenCLRuntime::getSamplerType(), clang::CodeGen::CodeGenVTables::getVTableType(), clang::CodeGen::initializationPatternFor(), initializeAlloca(), lookupRepresentativeDecl(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
llvm::Function * CodeGenModule::getLLVMLifetimeEndFn | ( | ) |
Lazily declare the .lifetime.end intrinsic.
Definition at line 2318 of file CGDecl.cpp.
References clang::CodeGen::CodeGenTypeCache::AllocaInt8PtrTy, and clang::CodeGen::CodeGenFunction::EmitARCRelease().
Referenced by clang::CodeGen::CodeGenFunction::EmitLifetimeEnd().
llvm::Function * CodeGenModule::getLLVMLifetimeStartFn | ( | ) |
Lazily declare the .lifetime.start intrinsic.
Definition at line 2309 of file CGDecl.cpp.
References clang::CodeGen::CodeGenTypeCache::AllocaInt8PtrTy.
Referenced by clang::CodeGen::CodeGenFunction::EmitLifetimeStart().
llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageForDeclarator | ( | const DeclaratorDecl * | D, |
GVALinkage | Linkage, | ||
bool | IsConstantVariable | ||
) |
Returns LLVM linkage for a declarator.
Definition at line 4221 of file CodeGenModule.cpp.
References clang::ExternalLinkage, clang::Decl::getAsFunction(), getLangOpts(), clang::ASTContext::getLangOpts(), clang::GVA_AvailableExternally, clang::GVA_DiscardableODR, clang::GVA_Internal, clang::GVA_StrongExternal, clang::GVA_StrongODR, clang::Decl::hasAttr(), clang::InternalLinkage, clang::FunctionDecl::isMultiVersion(), and isVarDeclStrongDefinition().
Referenced by clang::CodeGen::CGCXXABI::getCXXDestructorLinkage(), getFunctionLinkage(), and getLLVMLinkageVarDefinition().
llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageVarDefinition | ( | const VarDecl * | VD, |
bool | IsConstant | ||
) |
Returns LLVM linkage for a declarator.
Definition at line 4293 of file CodeGenModule.cpp.
References getContext(), clang::ASTContext::GetGVALinkageForVariable(), and getLLVMLinkageForDeclarator().
Referenced by canEmitSpuriousReferenceToVariable(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), getThreadLocalWrapperLinkage(), HandleCXXStaticMemberVarInstantiation(), maybeSetTrivialComdat(), and clang::CodeGen::registerTargetGlobalVariable().
|
inlinestatic |
Definition at line 791 of file CodeGenModule.h.
References clang::DefaultVisibility, clang::HiddenVisibility, clang::CodeGen::NotForDefinition, and clang::ProtectedVisibility.
Referenced by extractPBaseFlags(), and setGlobalVisibility().
StringRef CodeGenModule::getMangledName | ( | GlobalDecl | GD | ) |
Definition at line 1089 of file CodeGenModule.cpp.
References clang::Ctor_Base, clang::Ctor_Complete, clang::GlobalDecl::getCanonicalDecl(), clang::GlobalDecl::getCtorType(), getCUDARuntime(), clang::TargetInfo::getCXXABI(), clang::GlobalDecl::getDecl(), clang::CodeGen::CGCUDARuntime::getDeviceStubName(), getLangOpts(), getMangledNameImpl(), getTarget(), clang::Decl::hasAttr(), and clang::TargetCXXABI::hasConstructorVariants().
Referenced by emitCommonOMPTargetDirective(), emitConstructorDestructorAlias(), clang::CodeGen::emitDeclareTargetVarDefinition(), EmitDeferredUnusedCoverageMappings(), EmitGlobal(), emitGlobalDtorWithTLRegDtor(), emitOpenMPDeviceFunctionRedefinition(), EmitTentativeDefinition(), clang::CodeGen::emitThreadPrivateVarInit(), generateUniqueName(), getAddrAndTypeOfCXXStructor(), clang::CodeGen::getAddrOfDeclareTargetVar(), GetAddrOfFunction(), GetAddrOfGlobalVar(), getAliasedGlobal(), clang::CodeGen::getOrCreateThreadPrivateCache(), getStaticDeclName(), getThreadLocalWrapperLinkage(), HandleCXXStaticMemberVarInstantiation(), clang::CodeGen::markAsGlobalTarget(), clang::CodeGen::registerTargetGlobalVariable(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().
llvm::Constant * CodeGenModule::getMemberPointerConstant | ( | const UnaryOperator * | e | ) |
Definition at line 2173 of file CGExprConstant.cpp.
References clang::ast_matchers::decl, EmitNullConstantForBase(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), and clang::CodeGen::Type.
|
inline |
Definition at line 706 of file CodeGenModule.h.
References clang::CodeGen::CodeGenVTables::getMicrosoftVTableContext().
Referenced by decomposeTypeForEH(), and detectAmbiguousBases().
|
inline |
Definition at line 681 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), buildBlockDescriptor(), buildGlobalBlock(), CanUseSingleInheritance(), clang::CodeGen::CGOpenMPRuntimeNVPTX::clear(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), clang::CodeGen::CGOpenMPRuntime::createOffloadEntry(), decomposeTypeForEH(), detectAmbiguousBases(), clang::CodeGen::SanitizerMetadata::disableSanitizerForInstruction(), EmitAnnotationString(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), clang::CodeGen::CodeGenFunction::EmitCheck(), emitConstructorDestructorAlias(), clang::CodeGen::emitDeclareTargetVarDefinition(), emitDestructorsFunction(), EmitGlobalAnnotations(), EmitGlobalDeclMetadata(), emitGlobalDtorWithTLRegDtor(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitNVPTXDevicePrintfCallExpr(), emitOffloadingArrays(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitOutlinedFunctionCall(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CGOpenMPRuntime::emitTargetOutlinedFunctionHelper(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitTeamsOutlinedFunction(), EmitTopLevelDecl(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CodeGenFunction::EncodeAddrForUseInPrologue(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), GenerateStringLiteral(), clang::CodeGen::CGOpenMPRuntimeNVPTX::getAddressOfLocalVariable(), clang::CodeGen::getAddrOfDeclareTargetVar(), getBlockLayoutInfoString(), getClangCallTerminateFn(), clang::CodeGen::ConstantEmitter::getCurrentAddrPrivate(), getInitThreadEpochPtr(), getIntrinsic(), getMasterThreadID(), getNVPTXNumThreads(), getNVPTXThreadID(), getNVPTXWarpSize(), getSanStats(), getThreadLocalWrapperLinkage(), getTypeInfoVTable(), HandleCXXStaticMemberVarInstantiation(), isSimpleZero(), isTrivialFiller(), isTypeConstant(), lookupRepresentativeDecl(), PersonalityHasOnlyCXXUses(), Release(), setThunkProperties(), supportsLightweightRuntime(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().
|
inline |
Definition at line 666 of file CodeGenModule.h.
Referenced by EmitTopLevelDecl(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), maybeSetTrivialComdat(), and clang::CodeGen::CodeGenTypes::UpdateCompletedType().
std::vector< const CXXRecordDecl * > CodeGenModule::getMostBaseClasses | ( | const CXXRecordDecl * | RD | ) |
Return a vector of most-base classes for RD.
This is used to implement control flow integrity checks for member function pointers.
A most-base class of a class C is defined as a recursive base class of C, including C itself, that does not have any bases.
Definition at line 1482 of file CodeGenModule.cpp.
References clang::CXXRecordDecl::bases(), and clang::CXXRecordDecl::getNumBases().
Referenced by SetLLVMFunctionAttributesForDefinition().
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 178 of file CGClass.cpp.
References computeNonVirtualBaseClassOffset(), clang::CodeGen::CodeGenTypes::ConvertType(), getContext(), clang::CharUnits::getQuantity(), clang::CharUnits::isZero(), Offset, clang::CodeGen::CodeGenTypeCache::PtrDiffTy, and clang::CodeGen::Type.
Referenced by clang::CodeGen::CGCXXABI::getMemberPointerAdjustment().
|
inline |
Definition at line 668 of file CodeGenModule.h.
llvm::Constant * CodeGenModule::getNSConcreteGlobalBlock | ( | ) |
Definition at line 3007 of file CGBlocks.cpp.
References configureBlocksRuntimeObject().
Referenced by buildGlobalBlock(), and clang::CodeGen::CodeGenFunction::EmitBlockLiteral().
llvm::Constant * CodeGenModule::getNSConcreteStackBlock | ( | ) |
Definition at line 3018 of file CGBlocks.cpp.
References configureBlocksRuntimeObject().
Referenced by clang::CodeGen::CodeGenFunction::EmitBlockLiteral().
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 1719 of file CGExprConstant.cpp.
References clang::CodeGen::ConstantEmitter::CGM, clang::CodeGen::ConstantAddress::getPointer(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitScalarInit(), and clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().
|
inline |
Definition at line 601 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::EmitARCRelease(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleasedReturnValue(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseNonBlock(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::EmitARCRetainBlock(), clang::CodeGen::CodeGenFunction::EmitARCRetainNonBlock(), clang::CodeGen::CodeGenFunction::EmitARCStoreStrongCall(), clang::CodeGen::CodeGenFunction::EmitARCStoreWeak(), clang::CodeGen::CodeGenFunction::EmitARCUnsafeClaimAutoreleasedReturnValue(), 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(), 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 4857 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::ArrayType::Normal, clang::Decl::setAccess(), clang::TagDecl::startDefinition(), and clang::ASTContext::UnsignedLongTy.
|
inline |
Return a reference to the configured Objective-C runtime.
Definition at line 572 of file CodeGenModule.h.
Referenced by buildBlockDescriptor(), clang::CodeGen::CodeGenFunction::EmitBlockCopyAndAutorelease(), 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::CodeGenFunction::EmitObjCSelectorExpr(), clang::CodeGen::CodeGenFunction::EmitObjCSelectorLValue(), clang::CodeGen::CodeGenFunction::EmitObjCStringLiteral(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), emitStructSetterCall(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), getBlockDescriptorName(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and tryEmitSpecializedAllocInit().
|
inline |
Return a reference to the configured OpenCL runtime.
Definition at line 581 of file CodeGenModule.h.
Referenced by buildGlobalBlock(), clang::CodeGen::CodeGenTypes::ConvertType(), createOpenCLIntToSamplerConversion(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), and initializeForBlockHeader().
|
inline |
Return a pointer to the configured OpenMPIRBuilder, if any.
Definition at line 593 of file CodeGenModule.h.
Referenced by emitParallelOrTeamsOutlinedFunction().
|
inline |
Return a reference to the configured OpenMP runtime.
Definition at line 587 of file CodeGenModule.h.
Referenced by CreateFunctionTypeMetadataForIcall(), clang::CodeGen::createOffloadEntriesAndInfoMetadata(), createRuntimeShuffleFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::DisableAutoDeclareTargetRAII(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), emitCommonOMPParallelDirective(), emitCommonOMPTargetDirective(), emitCommonOMPTeamsDirective(), clang::CodeGen::CodeGenFunction::EmitComplexPrePostIncDec(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), emitDeclTargetVarDeclLValue(), clang::CodeGen::emitDeferredTargetDecls(), emitDestructorsFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitFunctionProlog(), EmitGlobal(), emitGlobalToListReduceFunction(), clang::CodeGen::emitIfClause(), emitInitWithReductionInitializer(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), emitOffloadingArrays(), emitOMPAtomicCaptureExpr(), emitOMPAtomicReadExpr(), emitOMPAtomicUpdateExpr(), emitOMPAtomicWriteExpr(), emitOMPLoopBodyWithStopPoint(), emitOMPSimdRegion(), EmitOMPThreadPrivateDecl(), emitOutlinedFunctionPrologue(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReductionCombiner(), emitShuffleAndReduceFunction(), emitTargetRegion(), emitTaskDupFunction(), clang::CodeGen::emitTaskInit(), emitTaskPrivateMappingFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitTeamsOutlinedFunction(), EmitThreadPrivateVarDeclLValue(), generateUniqueName(), clang::CodeGen::initLastprivateConditionalCounter(), clang::CodeGen::isNontemporalDecl(), isTypeConstant(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::LastprivateConditionalRAII(), clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::NontemporalDeclsRAII(), clang::CodeGen::CodeGenFunction::StartFunction(), supportsLightweightRuntime(), clang::CodeGen::CodeGenFunction::~CodeGenFunction(), clang::CodeGen::CGOpenMPRuntime::DisableAutoDeclareTargetRAII::~DisableAutoDeclareTargetRAII(), clang::CodeGen::CGOpenMPRuntime::LastprivateConditionalRAII::~LastprivateConditionalRAII(), and clang::CodeGen::CGOpenMPRuntime::NontemporalDeclsRAII::~NontemporalDeclsRAII().
llvm::Constant * CodeGenModule::getOrCreateStaticVarDecl | ( | const VarDecl & | D, |
llvm::GlobalValue::LinkageTypes | Linkage | ||
) |
Definition at line 221 of file CGDecl.cpp.
References clang::Type::isConstantSizeType().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
|
inline |
Definition at line 611 of file CodeGenModule.h.
|
inline |
Definition at line 610 of file CodeGenModule.h.
|
inline |
Definition at line 678 of file CodeGenModule.h.
|
inline |
llvm::SanitizerStatReport & CodeGenModule::getSanStats | ( | ) |
Definition at line 5905 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 768 of file CodeGenModule.cpp.
References clang::CharUnits::getQuantity(), and clang::CodeGen::CodeGenTypeCache::SizeTy.
Referenced by clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), emitPointerArithmetic(), emitStructSetterCall(), clang::CodeGen::emitTaskInit(), clang::CodeGen::getOrCreateThreadPrivateCache(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), and tryEmitFMulAdd().
|
inline |
Definition at line 617 of file CodeGenModule.h.
|
inline |
Definition at line 629 of file CodeGenModule.h.
LangAS CodeGenModule::getStringLiteralAddressSpace | ( | ) | const |
Return the AST address space of string literal, which is used to emit the string literal as global variable in LLVM IR.
Note: This is not necessarily the address space of the string literal in AST. For address space agnostic language, e.g. C++, string literal in AST is always in default address space.
Definition at line 3786 of file CodeGenModule.cpp.
References clang::Default, getTarget(), and clang::opencl_constant.
Referenced by GenerateStringLiteral().
|
inline |
Definition at line 686 of file CodeGenModule.h.
Referenced by AddDependentLib(), addLinkOptionsPostorder(), AppendCPUSpecificCPUDispatchMangling(), AppendTargetMangling(), BuildAppleKextVirtualCall(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), configureBlocksRuntimeObject(), createCXXABI(), clang::CodeGen::CreateItaniumCXXABI(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CGCXXABI::EmitCtorCompleteObjectHandler(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), emitGlobalDtorWithTLRegDtor(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), FindIvarInterface(), clang::CodeGen::EHPersonality::get(), getAddrAndTypeOfCXXStructor(), GetAddrOfFunction(), getBlockLayoutInfoString(), getCodegenToUse(), getCudaArch(), GetGCAttrTypeForType(), getMangledName(), getMaxAtomicAccessSize(), getStringLiteralAddressSpace(), getTerminateFn(), getThreadLocalWrapperLinkage(), initializeForBlockHeader(), isThreadWrapperReplaceable(), clang::CodeGen::CodeGenVTables::isVTableExternal(), PersonalityHasOnlyCXXUses(), requiresAMDGPUDefaultVisibility(), SetCommonAttributes(), SetLLVMFunctionAttributesForDefinition(), and shouldEmitVTableThunk().
const TargetCodeGenInfo & CodeGenModule::getTargetCodeGenInfo | ( | ) |
Definition at line 9783 of file TargetInfo.cpp.
References clang::CodeGen::ABIInfo::getTarget(), clang::TargetInfo::getTriple(), and P.
Referenced by AddDependentLib(), addLinkOptionsPostorder(), arrangeFreeFunctionLikeCall(), buildGlobalBlock(), castStringLiteralToDefaultAddressSpace(), clang::CodeGen::CodeGenTypes::ClangCallConvToLLVMCallConv(), computeBlockInfo(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleasedReturnValue(), emitAutoreleasedReturnValueMarker(), clang::CodeGen::CodeGenFunction::EmitCall(), EmitDeclDestroy(), EmitGlobalDeclMetadata(), GetGlobalVarAddressSpace(), getPrologueSignature(), getSwiftABIInfo(), clang::CodeGen::CodeGenFunction::getTargetHooks(), InitCatchParam(), initializeForBlockHeader(), isTypeConstant(), lookupRepresentativeDecl(), SetCommonAttributes(), setCUDAKernelCallingConvention(), and clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().
CharUnits CodeGenModule::GetTargetTypeStoreSize | ( | llvm::Type * | Ty | ) | const |
Return the store size, in character units, of the given LLVM type.
Definition at line 3749 of file CodeGenModule.cpp.
References getDataLayout(), and clang::ASTContext::toCharUnitsFromBits().
Referenced by clang::CodeGen::getOrCreateThreadPrivateCache().
TBAAAccessInfo CodeGenModule::getTBAAAccessInfo | ( | QualType | AccessType | ) |
getTBAAAccessInfo - Get TBAA information that describes an access to an object of the given type.
Definition at line 678 of file CodeGenModule.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitArrayToPointerDecay(), clang::CodeGen::CodeGenFunction::EmitLoadOfReferenceLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::getNaturalTypeAlignment(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
llvm::MDNode * CodeGenModule::getTBAAAccessTagInfo | ( | TBAAAccessInfo | Info | ) |
getTBAAAccessTagInfo - Get TBAA tag for a given memory access.
Definition at line 703 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 697 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 751 of file CodeGenModule.h.
References clang::CodeGen::LValue::getTBAAInfo(), and clang::CodeGen::TBAAAccessInfo::isMayAlias().
Referenced by clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::ReductionCodeGen::emitInitialization(), clang::CodeGen::CodeGenFunction::EmitLValueForFieldInitialization(), clang::CodeGen::CodeGenFunction::EmitOMPArraySectionExpr(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), and loadToBegin().
llvm::MDNode * CodeGenModule::getTBAAStructInfo | ( | QualType | QTy | ) |
Definition at line 691 of file CodeGenModule.cpp.
llvm::MDNode * CodeGenModule::getTBAATypeInfo | ( | QualType | QTy | ) |
getTBAATypeInfo - Get metadata used to describe accesses to objects of the given type.
Definition at line 672 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 685 of file CodeGenModule.cpp.
llvm::FunctionCallee CodeGenModule::getTerminateFn | ( | ) |
Get the declaration of std::terminate for the platform.
Definition at line 50 of file CGException.cpp.
References clang::CPlusPlus, CreateRuntimeFunction(), getCXXABI(), getLangOpts(), getTarget(), clang::ObjCRuntime::hasTerminate(), clang::LangOptions::MSVC2015, clang::transformer::name(), and clang::CodeGen::CodeGenTypeCache::VoidTy.
Referenced by clang::CodeGen::CGCXXABI::emitTerminateForUnexpectedException(), and getClangCallTerminateFn().
|
inline |
Definition at line 687 of file CodeGenModule.h.
References clang::TargetInfo::getTriple().
Referenced by AddDependentLib(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenVTables::EmitThunks(), GetAddrOfConstantCFString(), getBlockLayoutInfoString(), getLinkageTypeForObjCMetadata(), getThreadLocalWrapperLinkage(), getTypeInfoLinkage(), isTypeConstant(), Release(), requiresAMDGPUDefaultVisibility(), setARCRuntimeFunctionLinkage(), shouldAssumeDSOLocal(), and ~CodeGenModule().
|
inline |
Definition at line 659 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor().
|
inline |
Definition at line 698 of file CodeGenModule.h.
Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData(), clang::CodeGen::arrangeCXXMethodType(), clang::CodeGen::arrangeFreeFunctionCall(), clang::CodeGen::arrangeFreeFunctionType(), clang::CodeGen::arrangeObjCMessageSendSignature(), buildBlockDescriptor(), buildGlobalBlock(), canEmitDelegateCallArgs(), CanUseSingleInheritance(), clang::CodeGen::CGOpenMPRuntime::CGOpenMPRuntime(), clang::CodeGen::CGOpenMPRuntimeNVPTX::clear(), codegenCXXStructor(), computeBlockInfo(), clang::CodeGen::computeSPIRKernelABIInfo(), ComputeVMIClassTypeInfoFlags(), clang::CodeGen::convertFreeFunctionType(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::convertTypeForMemory(), clang::CodeGen::CodeGenFunction::createAtExitStub(), createConstantGlobalStructAndAddToParent(), CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CGOpenMPRuntimeNVPTX::createNVPTXRuntimeFunction(), decomposeTypeForEH(), emitAddrOfFieldStorage(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitCombinerOrInitializer(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::emitDeclareTargetVarDefinition(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementLValue(), clang::CodeGen::ConstantEmitter::emitForMemory(), EmitFunctionDeclPointer(), EmitGlobal(), emitGlobalDtorWithTLRegDtor(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), clang::CodeGen::emitKmpRoutineEntryT(), clang::CodeGen::CodeGenFunction::EmitLambdaDelegatingInvokeBody(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CodeGenFunction::EmitLoadOfGlobalRegLValue(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), EmitNewDeleteCall(), EmitNullConstant(), EmitNullConstantForBase(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), emitOpenMPDeviceFunctionRedefinition(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitOutlinedFunctionCall(), emitOutlinedFunctionPrologue(), emitPreserveStructAccess(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitReductionCombiner(), clang::CodeGen::emitRequiresDirectiveRegFun(), emitShuffleAndReduceFunction(), clang::CodeGen::CodeGenFunction::EmitStoreThroughGlobalRegLValue(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::emitThreadPrivateVarInit(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), extractPBaseFlags(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), getAddrAndTypeOfCXXStructor(), GetAddrOfConstantCFString(), clang::CodeGen::getAddrOfDeclareTargetVar(), GetAddrOfFunction(), GetAddrOfGlobal(), GetAddrOfGlobalVar(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), GetConstantArrayFromStringLiteral(), GetGCAttrTypeForType(), getGuardAcquireFn(), clang::CodeGen::getLLVMFieldNumber(), getMasterThreadID(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), getThreadLocalWrapperLinkage(), clang::CodeGen::CodeGenFunction::getTypes(), GetWeakRefReference(), HandleCXXStaticMemberVarInstantiation(), isWeakLinkedClass(), maybeSetTrivialComdat(), clang::CodeGen::registerTargetFirstprivateCopy(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Fetches the global unique block count.
Definition at line 898 of file CodeGenModule.h.
CharUnits CodeGenModule::getVBaseAlignment | ( | CharUnits | actualDerivedAlign, |
const CXXRecordDecl * | derivedClass, | ||
const CXXRecordDecl * | vbaseClass | ||
) |
Returns the assumed alignment of a virtual base of a class.
Return the best known alignment for a pointer to a virtual base, given the alignment of a pointer to the derived class.
Definition at line 56 of file CGClass.cpp.
References clang::ASTContext::getASTRecordLayout(), getContext(), getDynamicOffsetAlignment(), and clang::TagDecl::isCompleteDefinition().
Referenced by ApplyNonVirtualAndVirtualOffset(), and hasDefaultCXXMethodCC().
llvm::GlobalObject::VCallVisibility CodeGenModule::GetVCallVisibilityLevel | ( | const CXXRecordDecl * | RD | ) |
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.
Definition at line 1049 of file CGVTables.cpp.
References clang::CXXRecordDecl::bases(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), clang::isExternallyVisible(), min(), and clang::CXXRecordDecl::vbases().
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 832 of file CGVTables.cpp.
References clang::InternalLinkage, and clang::NamedDecl::isExternallyVisible().
Referenced by getTypeIdentifier(), and getTypeInfoLinkage().
|
inline |
Definition at line 700 of file CodeGenModule.h.
Referenced by shouldEmitVTableAtEndOfTranslationUnit().
ConstantAddress CodeGenModule::GetWeakRefReference | ( | const ValueDecl * | VD | ) |
Get a reference to the target of VD.
Definition at line 2412 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::Decl::getAttr(), getContext(), clang::ASTContext::getDeclAlign(), GetGlobalValue(), clang::ASTContext::getTargetAddressSpace(), clang::ValueDecl::getType(), getTypes(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and EmitFunctionDeclPointer().
void CodeGenModule::HandleCXXStaticMemberVarInstantiation | ( | VarDecl * | VD | ) |
Tell the consumer that this variable has been instantiated.
Definition at line 4415 of file CodeGenModule.cpp.
References AddGlobalAnnotations(), clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::serialized_diags::create(), clang::VarDecl::Definition, EmitTopLevelDecl(), clang::ExternalLinkage, clang::CodeGen::ForDefinition, clang::CodeGen::CodeGenFunction::GenerateCode(), GetAddrOfFunction(), GetAddrOfGlobalVar(), clang::Decl::getAttr(), clang::GlobalDecl::getDecl(), clang::VarDecl::getDefinition(), getFunctionLinkage(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), getLLVMLinkageVarDefinition(), clang::Decl::getLocation(), getMangledName(), getModule(), clang::VarDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), getTypes(), clang::Decl::hasAttr(), clang::QualType::isConstQualified(), clang::VarDecl::isThisDeclarationADefinition(), clang::Decl::isWeakImported(), lookupRepresentativeDecl(), LT, MaybeHandleStaticInExternC(), maybeSetTrivialComdat(), SetCommonAttributes(), setFunctionLinkage(), setGVProperties(), SetLLVMFunctionAttributesForDefinition(), setTLSMode(), clang::TSK_ExplicitInstantiationDefinition, and clang::CodeGen::Type.
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 1014 of file CGVTables.cpp.
References clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), clang::DeclContext::getParent(), clang::LinkageInfo::getVisibility(), clang::Decl::hasAttr(), clang::HiddenVisibility, and clang::isExternallyVisible().
Referenced by requiresMemberFunctionPointerTypeMetadata().
|
inline |
Return true iff an Objective-C runtime has been configured.
Definition at line 578 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 2312 of file CodeGenModule.cpp.
References clang::ASTContext::DeclMustBeEmitted(), getContext(), clang::ASTContext::getInlineVariableDefinitionKind(), clang::ASTContext::getTargetInfo(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::ASTContext::getXRayFilter(), clang::Decl::isReferenced(), clang::TargetInfo::isTLSSupported(), isTypeConstant(), clang::Decl::isUsed(), clang::SourceLocation::isValid(), clang::SD_Static, clang::TSK_ImplicitInstantiation, and clang::ASTContext::WeakUnknown.
Referenced by clang::CodeGen::CodeGenFunction::StartFunction().
bool CodeGenModule::isInSanitizerBlacklist | ( | SanitizerMask | Kind, |
llvm::Function * | Fn, | ||
SourceLocation | Loc | ||
) | const |
Definition at line 2260 of file CodeGenModule.cpp.
References getContext(), clang::SourceManager::getFileEntryForID(), clang::SourceManager::getMainFileID(), clang::ASTContext::getSanitizerBlacklist(), clang::ASTContext::getSourceManager(), clang::SanitizerBlacklist::isBlacklistedLocation(), clang::SourceLocation::isValid(), and SM.
bool CodeGenModule::isInSanitizerBlacklist | ( | llvm::GlobalVariable * | GV, |
SourceLocation | Loc, | ||
QualType | Ty, | ||
StringRef | Category = StringRef() |
||
) | const |
Definition at line 2279 of file CodeGenModule.cpp.
References Category, clang::QualType::getAsString(), clang::QualType::getCanonicalType(), getContext(), clang::ASTContext::getSanitizerBlacklist(), clang::QualType::getTypePtr(), clang::QualType::getUnqualifiedType(), clang::QualType::isNull(), clang::Type::isRecordType(), clang::SanitizerSet::Mask, and clang::LangOptions::Sanitize.
Definition at line 703 of file CodeGenTypes.cpp.
References clang::Type::castAs().
Referenced by findPeephole().
bool CodeGenModule::isPaddedAtomicType | ( | const AtomicType * | type | ) |
Definition at line 707 of file CodeGenTypes.cpp.
References clang::ASTContext::getTypeSize(), and clang::AtomicType::getValueType().
isTypeConstant - Determine whether an object of this type can be emitted as a constant.
If ExcludeCtor is true, the duration when the object's constructor runs will not be considered. The caller will need to verify that the object is not written to during its construction.
Definition at line 3410 of file CodeGenModule.cpp.
References clang::CLanguageLinkage, clang::Default, clang::ExternalLinkage, clang::CodeGen::ConstantEmitter::finalize(), clang::QualType::getAddressSpace(), GetAddrOfGlobalVar(), clang::VarDecl::getAnyInitializer(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getAttr(), clang::ASTContext::getBaseElementType(), clang::GlobalDecl::getCanonicalDecl(), clang::VarDecl::getCanonicalDecl(), getContext(), clang::GlobalDecl::getDecl(), getDeclAlign(), getDiags(), GetGlobalValue(), GetGlobalVarAddressSpace(), clang::ASTContext::getLangOpts(), clang::VarDecl::getLanguageLinkage(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), clang::Decl::getLocation(), getModule(), getOpenMPRuntime(), clang::ASTContext::getTargetAddressSpace(), getTargetCodeGenInfo(), clang::VarDecl::getTLSKind(), getTriple(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasDefinition(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasInit(), clang::QualType::isConstant(), clang::QualType::isConstQualified(), clang::isExternallyVisible(), clang::Type::isReferenceType(), lookupRepresentativeDecl(), clang::opencl_global, clang::CodeGen::TargetCodeGenInfo::performAddrSpaceCast(), clang::DiagnosticsEngine::Report(), setGVProperties(), setLinkageForGV(), clang::CodeGen::TargetCodeGenInfo::setTargetAttributes(), setTLSMode(), clang::VarDecl::TLS_Dynamic, and clang::CodeGen::ConstantEmitter::tryEmitForInitializer().
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), imbueXRayAttrs(), isTrivialFiller(), maybeSetTrivialComdat(), and requiresAMDGPUDefaultVisibility().
bool CodeGenModule::lookupRepresentativeDecl | ( | StringRef | MangledName, |
GlobalDecl & | Result | ||
) | const |
Definition at line 5633 of file CodeGenModule.cpp.
References clang::CodeGenOptions::CoverageNotesFile, EmitGlobalDeclMetadata(), clang::CodeGen::TargetCodeGenInfo::emitTargetMD(), clang::getClangFullVersion(), getCodeGenOpts(), GetGlobalValue(), getLLVMContext(), getModule(), clang::NamedDecl::getMostRecentDecl(), GetPointerConstant(), getTargetCodeGenInfo(), clang::CodeGen::CodeGenTypeCache::Int16Ty, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::isHexDigit(), and clang::CodeGenOptions::RecordCommandLine.
Referenced by getMangledNameImpl(), HandleCXXStaticMemberVarInstantiation(), and isTypeConstant().
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 3820 of file CodeGenModule.cpp.
References clang::CPlusPlus, clang::First, getLangOpts(), and clang::InternalLinkage.
Referenced by emitOpenMPDeviceFunctionRedefinition(), HandleCXXStaticMemberVarInstantiation(), and maybeSetTrivialComdat().
void CodeGenModule::maybeSetTrivialComdat | ( | const Decl & | D, |
llvm::GlobalObject & | GO | ||
) |
Definition at line 3882 of file CodeGenModule.cpp.
References AddGlobalAnnotations(), clang::CodeGen::CGCUDARuntime::ConstantDeviceVar, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::CPlusPlus, clang::QualType::DK_cxx_destructor, EmitNullConstant(), ErrorUnsupported(), clang::CodeGen::CGCUDARuntime::ExternDeviceVar, GetAddrOfGlobalVar(), clang::VarDecl::getAnyInitializer(), clang::Decl::getAttr(), getCodeGenOpts(), getContext(), getCUDARuntime(), getDeclAlign(), GetGlobalVarAddressSpace(), getLangOpts(), getLLVMLinkageVarDefinition(), getModuleDebugInfo(), clang::NamedDecl::getName(), clang::ASTContext::getTargetAddressSpace(), clang::ASTContext::getTargetInfo(), clang::VarDecl::getTLSKind(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::ValueDecl::getType(), getTypes(), clang::Decl::hasAttr(), clang::VarDecl::hasDefinition(), clang::VarDecl::hasExternalStorage(), clang::InternalLinkage, clang::Type::isIncompleteType(), clang::Type::isReferenceType(), clang::Type::isSamplerT(), clang::VarDecl::isStaticLocal(), isTypeConstant(), MaybeHandleStaticInExternC(), clang::VarDecl::needsDestruction(), clang::OpenCL, clang::ASTContext::PSF_Write, clang::CodeGen::CGCUDARuntime::registerDeviceVar(), clang::ASTContext::SectionInfo::SectionFlags, clang::ASTContext::SectionInfos, setTLSMode(), shouldBeInCOMDAT(), clang::VarDecl::TLS_Dynamic, and clang::CodeGen::Type.
Referenced by decomposeTypeForEH(), emitConstructorDestructorAlias(), emitOpenMPDeviceFunctionRedefinition(), and HandleCXXStaticMemberVarInstantiation().
TBAAAccessInfo CodeGenModule::mergeTBAAInfoForCast | ( | TBAAAccessInfo | SourceInfo, |
TBAAAccessInfo | TargetInfo | ||
) |
mergeTBAAInfoForCast - Get merged TBAA information for the purposes of type casts.
Definition at line 709 of file CodeGenModule.cpp.
Referenced by emitOMPArraySectionBase(), and clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment().
TBAAAccessInfo CodeGenModule::mergeTBAAInfoForConditionalOperator | ( | TBAAAccessInfo | InfoA, |
TBAAAccessInfo | InfoB | ||
) |
mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the purposes of conditional operator.
Definition at line 717 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 725 of file CodeGenModule.cpp.
bool CodeGenModule::NeedAllVtablesTypeId | ( | ) | const |
Returns whether this module needs the "all-vtables" type identifier.
Definition at line 5874 of file CodeGenModule.cpp.
Referenced by AddVTableTypeMetadata().
void CodeGenModule::RefreshTypeCacheForClass | ( | const CXXRecordDecl * | Class | ) |
Definition at line 667 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass().
void CodeGenModule::Release | ( | ) |
Finalize LLVM code generation.
Definition at line 403 of file CodeGenModule.cpp.
References clang::TargetInfo::checkCFProtectionBranchSupported(), clang::TargetInfo::checkCFProtectionReturnSupported(), clang::CodeGenOptions::CodeModel, clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), EmitDeferredUnusedCoverageMappings(), EmitGlobalAnnotations(), clang::TargetInfo::getABI(), getCodeGenOpts(), getDiags(), clang::ASTContext::getLangOpts(), getModule(), clang::ASTContext::getTargetInfo(), getTriple(), clang::TargetInfo::getTriple(), clang::ASTContext::getTypeSizeInChars(), clang::ASTContext::getWideCharType(), clang::SanitizerSet::has(), clang::CodeGen::InstrProfStats::hasDiagnostics(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::InstrProfStats::reportDiagnostics(), clang::LangOptions::Sanitize, 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 1517 of file CGCall.cpp.
Referenced by clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), and isWeakLinkedClass().
Return true iff the given type uses 'fp2ret' when used as a return type.
Definition at line 1539 of file CGCall.cpp.
References clang::Type::getAs(), clang::CodeGen::CodeGenTypes::getTarget(), and clang::TargetInfo::useObjCFP2RetForComplexLongDouble().
Referenced by isWeakLinkedClass().
Return true iff the given type uses 'fpret' when used as a return type.
Definition at line 1522 of file CGCall.cpp.
References clang::TransferrableTargetInfo::Double, clang::TransferrableTargetInfo::Float, clang::Type::getAs(), clang::CodeGen::CodeGenTypes::getTarget(), clang::TransferrableTargetInfo::LongDouble, and clang::TargetInfo::useObjCFPRetForRealType().
Referenced by isWeakLinkedClass().
bool CodeGenModule::ReturnTypeUsesSRet | ( | const CGFunctionInfo & | FI | ) |
Return true iff the given type uses 'sret' when used as a return type.
Definition at line 1512 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::getReturnInfo(), and clang::CodeGen::ABIArgInfo::isIndirect().
Referenced by clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), and isWeakLinkedClass().
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 2159 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 1353 of file CGBlocks.cpp.
Referenced by buildGlobalBlock().
|
inline |
Definition at line 654 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction().
|
inline |
Definition at line 646 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 1654 of file CodeGenModule.cpp.
References addUsedGlobal(), clang::ParsedTargetAttr::Architecture, clang::TargetOptions::CPU, clang::DefaultVisibility, clang::TargetOptions::Features, clang::Decl::getAttr(), getContext(), clang::GlobalDecl::getDecl(), clang::ASTContext::getFunctionFeatureMap(), clang::Redeclarable< decl_type >::getMostRecentDecl(), getTarget(), getTargetCodeGenInfo(), clang::TargetInfo::getTargetOpts(), clang::Decl::hasAttr(), clang::SD_Static, setGVProperties(), and clang::CodeGen::TargetCodeGenInfo::setTargetAttributes().
Referenced by emitConstructorDestructorAlias(), HandleCXXStaticMemberVarInstantiation(), and clang::CodeGen::CGOpenMPRuntime::tryEmitDeclareVariant().
void CodeGenModule::setDLLImportDLLExport | ( | llvm::GlobalValue * | GV, |
GlobalDecl | D | ||
) | const |
Definition at line 874 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::setDLLImportDLLExport | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 885 of file CodeGenModule.cpp.
References clang::Decl::hasAttr(), and clang::NamedDecl::isExternallyVisible().
void CodeGenModule::setDSOLocal | ( | llvm::GlobalValue * | GV | ) | const |
Definition at line 870 of file CodeGenModule.cpp.
References shouldAssumeDSOLocal().
Referenced by CanUseSingleInheritance(), configureBlocksRuntimeObject(), clang::CodeGen::CodeGenFunction::EmitCfiCheckStub(), clang::CodeGen::CodeGenFunction::EmitCfiSlowPathCheck(), GenerateStringLiteral(), GetAddrOfConstantCFString(), and setGVPropertiesAux().
|
inline |
Definition at line 1183 of file CodeGenModule.h.
References Category.
Referenced by codegenCXXStructor(), emitOpenMPDeviceFunctionRedefinition(), HandleCXXStaticMemberVarInstantiation(), and setThunkProperties().
void CodeGenModule::setGlobalVisibility | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Set the visibility for the given LLVM GlobalValue.
Definition at line 772 of file CodeGenModule.cpp.
References clang::DefaultVisibility, getLangOpts(), clang::NamedDecl::getLinkageAndVisibility(), GetLLVMVisibility(), clang::LinkageInfo::getVisibility(), and clang::LinkageInfo::isVisibilityExplicit().
Referenced by 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 895 of file CodeGenModule.cpp.
References clang::GlobalDecl::getDecl(), setDLLImportDLLExport(), and setGVPropertiesAux().
Referenced by CreateFunctionTypeMetadataForIcall(), emitOpenMPDeviceFunctionRedefinition(), HandleCXXStaticMemberVarInstantiation(), isTypeConstant(), SetCommonAttributes(), and setThunkProperties().
void CodeGenModule::setGVProperties | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 901 of file CodeGenModule.cpp.
References setDLLImportDLLExport(), and setGVPropertiesAux().
void CodeGenModule::setGVPropertiesAux | ( | llvm::GlobalValue * | GV, |
const NamedDecl * | D | ||
) | const |
Definition at line 907 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 1763 of file CodeGenModule.cpp.
References clang::GlobalDecl::getDecl(), clang::InternalLinkage, SetLLVMFunctionAttributes(), and SetLLVMFunctionAttributesForDefinition().
Referenced by emitDestructorsFunction(), emitGlobalToListCopyFunction(), emitGlobalToListReduceFunction(), emitInterWarpCopyFunction(), emitListToGlobalCopyFunction(), emitListToGlobalReduceFunction(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitOutlinedFunctionCall(), emitOutlinedFunctionPrologue(), emitProxyTaskFunction(), emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), emitShuffleAndReduceFunction(), emitTaskDupFunction(), emitTaskPrivateMappingFunction(), clang::CodeGen::emitUserDefinedMapper(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), getMasterThreadID(), setBlockHelperAttributesVisibility(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().
void CodeGenModule::SetLLVMFunctionAttributes | ( | GlobalDecl | GD, |
const CGFunctionInfo & | Info, | ||
llvm::Function * | F | ||
) |
Set the LLVM function attributes (sext, zext, etc).
Definition at line 1232 of file CodeGenModule.cpp.
References ConstructAttributeList().
Referenced by CreateFunctionTypeMetadataForIcall(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), getThreadLocalWrapperLinkage(), 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 1496 of file CodeGenModule.cpp.
References CreateFunctionTypeMetadataForIcall(), CreateMetadataIdentifierForType(), clang::ASTContext::getCharWidth(), getContext(), getCXXABI(), clang::Decl::getMaxAlignment(), clang::ASTContext::getMemberPointerType(), getMostBaseClasses(), clang::ASTContext::getRecordType(), getTarget(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::QualType::getTypePtr(), clang::GVA_AvailableExternally, clang::Decl::hasAttr(), hasUnwindExceptions(), Id, clang::FunctionDecl::isInlined(), clang::CodeGenOptions::OnlyAlwaysInlining, clang::CodeGenOptions::OnlyHintInlining, clang::Redeclarable< decl_type >::redecls(), requiresMemberFunctionPointerTypeMetadata(), clang::LangOptions::SSPOn, clang::LangOptions::SSPReq, and clang::LangOptions::SSPStrong.
Referenced by codegenCXXStructor(), clang::CodeGen::CodeGenFunction::EmitCfiCheckFail(), emitOpenMPDeviceFunctionRedefinition(), getThreadLocalWrapperLinkage(), HandleCXXStaticMemberVarInstantiation(), setBlockHelperAttributesVisibility(), SetInternalFunctionAttributes(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().
|
inline |
Definition at line 620 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
|
inline |
Definition at line 632 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 937 of file CodeGenModule.cpp.
References clang::Decl::getAttr(), GetLLVMTLSModel(), and clang::VarDecl::getTLSKind().
Referenced by HandleCXXStaticMemberVarInstantiation(), isTypeConstant(), and maybeSetTrivialComdat().
|
inline |
Definition at line 662 of file CodeGenModule.h.
|
inline |
Definition at line 694 of file CodeGenModule.h.
bool CodeGenModule::supportsCOMDAT | ( | ) | const |
Definition at line 9779 of file TargetInfo.cpp.
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 clang::CXXRecordDecl::bases(), clang::RecordDecl::field_empty(), clang::RecordDecl::fields(), getCodeGenOpts(), clang::CXXRecordDecl::getNumVBases(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::hasTrivialBody(), and clang::RecordDecl::mayInsertExtraPadding().
Referenced by decomposeTypeForEH(), and emitConstructorDestructorAlias().
void CodeGenModule::UpdateCompletedType | ( | const TagDecl * | TD | ) |
Definition at line 662 of file CodeGenModule.cpp.
References clang::CodeGen::CodeGenTypes::UpdateCompletedType().
llvm::FoldingSet<BlockByrefHelpers> clang::CodeGen::CodeGenModule::ByrefHelpersCache |
Definition at line 895 of file CodeGenModule.h.
Referenced by buildByrefHelpers().
int clang::CodeGen::CodeGenModule::GlobalUniqueCount |
Definition at line 527 of file CodeGenModule.h.
llvm::FunctionCallee clang::CodeGen::CodeGenModule::IsOSVersionAtLeastFn = nullptr |
Definition at line 608 of file CodeGenModule.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable().