clang  3.7.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::CodeGen::CodeGenModule Class Reference

#include <CodeGenModule.h>

Inheritance diagram for clang::CodeGen::CodeGenModule:
[legend]
Collaboration diagram for clang::CodeGen::CodeGenModule:
[legend]

Classes

class  ByrefHelpers
 A pair of helper functions for a __block variable. More...
 
struct  Structor
 

Public Types

typedef std::vector< StructorCtorList
 

Public Member Functions

 CodeGenModule (ASTContext &C, const HeaderSearchOptions &headersearchopts, const PreprocessorOptions &ppopts, const CodeGenOptions &CodeGenOpts, llvm::Module &M, const llvm::DataLayout &TD, DiagnosticsEngine &Diags, CoverageSourceInfo *CoverageInfo=nullptr)
 
 ~CodeGenModule ()
 
void clear ()
 
void Release ()
 Finalize LLVM code generation. More...
 
CGObjCRuntimegetObjCRuntime ()
 Return a reference to the configured Objective-C runtime. More...
 
bool hasObjCRuntime ()
 Return true iff an Objective-C runtime has been configured. More...
 
CGOpenCLRuntimegetOpenCLRuntime ()
 Return a reference to the configured OpenCL runtime. More...
 
CGOpenMPRuntimegetOpenMPRuntime ()
 Return a reference to the configured OpenMP runtime. More...
 
CGCUDARuntimegetCUDARuntime ()
 Return a reference to the configured CUDA runtime. More...
 
ARCEntrypointsgetARCEntrypoints () const
 
RREntrypointsgetRREntrypoints () const
 
InstrProfStatsgetPGOStats ()
 
llvm::IndexedInstrProfReader * getPGOReader () const
 
CoverageMappingModuleGengetCoverageMapping () const
 
llvm::Constant * getStaticLocalDeclAddress (const VarDecl *D)
 
void setStaticLocalDeclAddress (const VarDecl *D, llvm::Constant *C)
 
llvm::Constant * getOrCreateStaticVarDecl (const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
 
llvm::GlobalVariable * getStaticLocalDeclGuardAddress (const VarDecl *D)
 
void setStaticLocalDeclGuardAddress (const VarDecl *D, llvm::GlobalVariable *C)
 
bool lookupRepresentativeDecl (StringRef MangledName, GlobalDecl &Result) const
 
llvm::Constant * getAtomicSetterHelperFnMap (QualType Ty)
 
void setAtomicSetterHelperFnMap (QualType Ty, llvm::Constant *Fn)
 
llvm::Constant * getAtomicGetterHelperFnMap (QualType Ty)
 
void setAtomicGetterHelperFnMap (QualType Ty, llvm::Constant *Fn)
 
llvm::Constant * getTypeDescriptorFromMap (QualType Ty)
 
void setTypeDescriptorInMap (QualType Ty, llvm::Constant *C)
 
CGDebugInfogetModuleDebugInfo ()
 
llvm::MDNode * getNoObjCARCExceptionsMetadata ()
 
ASTContextgetContext () const
 
const LangOptionsgetLangOpts () const
 
const HeaderSearchOptionsgetHeaderSearchOpts () const
 
const PreprocessorOptionsgetPreprocessorOpts () const
 
const CodeGenOptionsgetCodeGenOpts () const
 
llvm::Module & getModule () const
 
DiagnosticsEnginegetDiags () const
 
const llvm::DataLayout & getDataLayout () const
 
const TargetInfogetTarget () const
 
const llvm::Triple & getTriple () const
 
bool supportsCOMDAT () const
 
void maybeSetTrivialComdat (const Decl &D, llvm::GlobalObject &GO)
 
CGCXXABIgetCXXABI () const
 
llvm::LLVMContext & getLLVMContext ()
 
bool shouldUseTBAA () const
 
const TargetCodeGenInfogetTargetCodeGenInfo ()
 
CodeGenTypesgetTypes ()
 
CodeGenVTablesgetVTables ()
 
ItaniumVTableContextgetItaniumVTableContext ()
 
MicrosoftVTableContextgetMicrosoftVTableContext ()
 
CtorListgetGlobalCtors ()
 
CtorListgetGlobalDtors ()
 
llvm::MDNode * getTBAAInfo (QualType QTy)
 
llvm::MDNode * getTBAAInfoForVTablePtr ()
 
llvm::MDNode * getTBAAStructInfo (QualType QTy)
 
llvm::MDNode * getTBAAStructTypeInfo (QualType QTy)
 Return the MDNode in the type DAG for the given struct type. More...
 
llvm::MDNode * getTBAAStructTagInfo (QualType BaseTy, llvm::MDNode *AccessN, uint64_t O)
 Return the path-aware tag for given base type, access node and offset. More...
 
bool isTypeConstant (QualType QTy, bool ExcludeCtorDtor)
 
bool isPaddedAtomicType (QualType type)
 
bool isPaddedAtomicType (const AtomicType *type)
 
void DecorateInstruction (llvm::Instruction *Inst, llvm::MDNode *TBAAInfo, bool ConvertTypeToTag=true)
 
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 setTLSMode (llvm::GlobalValue *GV, const VarDecl &D) const
 
llvm::Constant * GetAddrOfGlobal (GlobalDecl GD)
 
llvm::GlobalVariable * CreateOrReplaceCXXRuntimeVariable (StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage)
 
llvm::Function * CreateGlobalInitOrDestructFunction (llvm::FunctionType *ty, const Twine &name, SourceLocation Loc=SourceLocation(), bool TLS=false)
 
unsigned GetGlobalVarAddressSpace (const VarDecl *D, unsigned AddrSpace)
 
llvm::Constant * GetAddrOfGlobalVar (const VarDecl *D, llvm::Type *Ty=nullptr)
 
llvm::Constant * GetAddrOfFunction (GlobalDecl GD, llvm::Type *Ty=0, bool ForVTable=false, bool DontDefer=false)
 
llvm::Constant * GetAddrOfRTTIDescriptor (QualType Ty, bool ForEH=false)
 Get the address of the RTTI descriptor for the given type. More...
 
llvm::Constant * getAddrOfCXXCatchHandlerType (QualType Ty, QualType CatchHandlerType)
 
llvm::Constant * GetAddrOfUuidDescriptor (const CXXUuidofExpr *E)
 Get the address of a uuid descriptor . More...
 
llvm::Constant * GetAddrOfThunk (GlobalDecl GD, const ThunkInfo &Thunk)
 Get the address of the thunk for the given global decl. More...
 
llvm::Constant * GetWeakRefReference (const ValueDecl *VD)
 Get a reference to the target of VD. 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)
 
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, const char *)
 Gets the address of a block which requires no captures. More...
 
llvm::Constant * GetAddrOfConstantCFString (const StringLiteral *Literal)
 Return a pointer to a constant CFString object for the given string. More...
 
llvm::GlobalVariable * GetAddrOfConstantString (const StringLiteral *Literal)
 
llvm::Constant * GetConstantArrayFromStringLiteral (const StringLiteral *E)
 Return a constant array for the given string. More...
 
llvm::GlobalVariable * GetAddrOfConstantStringFromLiteral (const StringLiteral *S, StringRef Name=".str")
 Return a pointer to a constant array for the given string literal. More...
 
llvm::GlobalVariable * GetAddrOfConstantStringFromObjCEncode (const ObjCEncodeExpr *)
 Return a pointer to a constant array for the given ObjCEncodeExpr node. More...
 
llvm::GlobalVariable * GetAddrOfConstantCString (const std::string &Str, const char *GlobalName=nullptr, unsigned Alignment=0)
 
llvm::Constant * GetAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *E)
 
llvm::Constant * 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 (const CXXMethodDecl *MD, StructorType Type)
 
llvm::GlobalValue * getAddrOfCXXStructor (const CXXMethodDecl *MD, StructorType Type, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false)
 Return the address of the constructor/destructor of the given type. More...
 
llvm::ValuegetBuiltinLibFunction (const FunctionDecl *FD, unsigned BuiltinID)
 
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::Constant *DtorFn, llvm::Constant *Object)
 Add a destructor and object to add to the C++ global destructor function. More...
 
llvm::Constant * CreateRuntimeFunction (llvm::FunctionType *Ty, StringRef Name, llvm::AttributeSet ExtraAttrs=llvm::AttributeSet())
 Create a new runtime function with the specified type and name. More...
 
llvm::Constant * CreateBuiltinFunction (llvm::FunctionType *Ty, StringRef Name, llvm::AttributeSet ExtraAttrs=llvm::AttributeSet())
 Create a new compiler builtin function 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::Constant * getLLVMLifetimeStartFn ()
 Lazily declare the .lifetime.start intrinsic. More...
 
llvm::Constant * getLLVMLifetimeEndFn ()
 Lazily declare the .lifetime.end intrinsic. More...
 
void UpdateCompletedType (const TagDecl *TD)
 
llvm::Constant * getMemberPointerConstant (const UnaryOperator *e)
 
llvm::Constant * EmitConstantInit (const VarDecl &D, CodeGenFunction *CGF=nullptr)
 
llvm::Constant * EmitConstantExpr (const Expr *E, QualType DestType, CodeGenFunction *CGF=nullptr)
 
llvm::Constant * EmitConstantValue (const APValue &Value, QualType DestType, CodeGenFunction *CGF=nullptr)
 
llvm::Constant * EmitConstantValueForMemory (const APValue &Value, QualType DestType, CodeGenFunction *CGF=nullptr)
 
llvm::Constant * EmitNullConstant (QualType T)
 
llvm::Constant * EmitNullConstantForBase (const CXXRecordDecl *Record)
 
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 (const Decl *D, llvm::Function *F, const CGFunctionInfo &FI)
 
void SetLLVMFunctionAttributes (const Decl *D, const CGFunctionInfo &Info, llvm::Function *F)
 Set the LLVM function attributes (sext, zext, etc). More...
 
void SetLLVMFunctionAttributesForDefinition (const Decl *D, llvm::Function *F)
 
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)
 
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 (const CGFunctionInfo &Info, const Decl *TargetDecl, AttributeListType &PAL, unsigned &CallingConv, bool AttrOnCallSite)
 
StringRef getMangledName (GlobalDecl GD)
 
StringRef getBlockMangledName (GlobalDecl GD, const BlockDecl *BD)
 
void EmitTentativeDefinition (const VarDecl *D)
 
void EmitVTable (CXXRecordDecl *Class)
 
void EmitFundamentalRTTIDescriptors ()
 Emit the RTTI descriptors for the builtin types. More...
 
void AppendLinkerOptions (StringRef Opts)
 Appends Opts to the "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 "Linker Options" metadata value. More...
 
llvm::GlobalVariable::LinkageTypes getFunctionLinkage (GlobalDecl GD)
 
void setFunctionLinkage (GlobalDecl GD, llvm::Function *F)
 
void setFunctionDLLStorageClass (GlobalDecl GD, llvm::Function *F)
 Set the DLL storage class on F. More...
 
llvm::GlobalVariable::LinkageTypes getVTableLinkage (const CXXRecordDecl *RD)
 
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)
 
void AddGlobalAnnotations (const ValueDecl *D, llvm::GlobalValue *GV)
 
bool isInSanitizerBlacklist (llvm::Function *Fn, SourceLocation Loc) const
 
bool isInSanitizerBlacklist (llvm::GlobalVariable *GV, SourceLocation Loc, QualType Ty, StringRef Category=StringRef()) const
 
SanitizerMetadatagetSanitizerMetadata ()
 
void addDeferredVTable (const CXXRecordDecl *RD)
 
void EmitGlobal (GlobalDecl D)
 
bool TryEmitDefinitionAsAlias (GlobalDecl Alias, GlobalDecl Target, bool InEveryTU)
 
bool TryEmitBaseDestructorAsAlias (const CXXDestructorDecl *D)
 
void setFunctionDefinitionAttributes (const FunctionDecl *D, llvm::Function *F)
 Set attributes for a global definition. More...
 
llvm::GlobalValue * GetGlobalValue (StringRef Ref)
 
void SetCommonAttributes (const Decl *D, llvm::GlobalValue *GV)
 
void setAliasAttributes (const Decl *D, llvm::GlobalValue *GV)
 
void addReplacement (StringRef Name, llvm::Constant *C)
 
void EmitOMPThreadPrivateDecl (const OMPThreadPrivateDecl *D)
 Emit a code for threadprivate directive. More...
 
bool IsCFIBlacklistedRecord (const CXXRecordDecl *RD)
 
void EmitVTableBitSetEntries (llvm::GlobalVariable *VTable, const VTableLayout &VTLayout)
 
llvm::MDTuple * CreateVTableBitSetEntry (llvm::GlobalVariable *VTable, CharUnits Offset, const CXXRecordDecl *RD)
 Create a bitset entry for the given vtable. More...
 
llvm::Constant * getTerminateFn ()
 Get the declaration of std::terminate for the platform. More...
 
Custom Blocks Runtime Interfaces
llvm::Constant * getNSConcreteGlobalBlock ()
 
llvm::Constant * getNSConcreteStackBlock ()
 
llvm::Constant * getBlockObjectAssign ()
 
llvm::Constant * getBlockObjectDispose ()
 
- Public Member Functions inherited from clang::CodeGen::CodeGenTypeCache
llvm::CallingConv::ID getRuntimeCC () const
 
llvm::CallingConv::ID getBuiltinCC () const
 

Static Public Member Functions

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

Public Attributes

llvm::FoldingSet< ByrefHelpersByrefHelpersCache
 
int GlobalUniqueCount
 
- Public Attributes inherited from clang::CodeGen::CodeGenTypeCache
llvm::Type * VoidTy
 void More...
 
llvm::IntegerType * Int8Ty
 i8, i16, i32, and i64 More...
 
llvm::IntegerType * Int16Ty
 
llvm::IntegerType * Int32Ty
 
llvm::IntegerType * Int64Ty
 
llvm::Type * FloatTy
 float, double More...
 
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...
 
unsigned char PointerWidthInBits
 The width of a pointer into the generic address space. More...
 
union {
   unsigned char   PointerAlignInBytes
 
   unsigned char   PointerSizeInBytes
 
   unsigned char   SizeSizeInBytes
 
}; 
 
llvm::CallingConv::ID RuntimeCC
 
llvm::CallingConv::ID BuiltinCC
 

Detailed Description

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

Definition at line 262 of file CodeGenModule.h.

Member Typedef Documentation

Definition at line 278 of file CodeGenModule.h.

Constructor & Destructor Documentation

CodeGenModule::CodeGenModule ( ASTContext C,
const HeaderSearchOptions headersearchopts,
const PreprocessorOptions ppopts,
const CodeGenOptions CodeGenOpts,
llvm::Module &  M,
const llvm::DataLayout &  TD,
DiagnosticsEngine Diags,
CoverageSourceInfo CoverageInfo = nullptr 
)
CodeGenModule::~CodeGenModule ( )

Definition at line 164 of file CodeGenModule.cpp.

Member Function Documentation

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

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

Definition at line 924 of file CodeGenModule.cpp.

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

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

Definition at line 894 of file CodeGenModule.h.

void CodeGenModule::AddDeferredUnusedCoverageMapping ( Decl D)

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

Definition at line 3399 of file CodeGenModule.cpp.

References clang::Decl::getKind().

Referenced by EmitTopLevelDecl().

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

Definition at line 1093 of file CodeGenModule.h.

void CodeGenModule::AddDependentLib ( StringRef  Lib)

Appends a dependent lib to the "Linker Options" metadata value.

Definition at line 973 of file CodeGenModule.cpp.

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

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

Appends a detect mismatch command to the linker options.

Definition at line 966 of file CodeGenModule.cpp.

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

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

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

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

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

Definition at line 207 of file CodeGenModule.cpp.

References AttributeLangSupport::C.

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

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

Definition at line 918 of file CodeGenModule.cpp.

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

void CodeGenModule::AppendLinkerOptions ( StringRef  Opts)

Appends Opts to the "Linker Options" metadata value.

Definition at line 961 of file CodeGenModule.cpp.

References getLLVMContext().

void CodeGenModule::clear ( )

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

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

llvm::Function * CodeGenModule::codegenCXXStructor ( const CXXMethodDecl MD,
StructorType  Type 
)
CharUnits CodeGenModule::computeNonVirtualBaseClassOffset ( const CXXRecordDecl DerivedClass,
CastExpr::path_const_iterator  Start,
CastExpr::path_const_iterator  End 
)
void CodeGenModule::ConstructAttributeList ( const CGFunctionInfo Info,
const Decl TargetDecl,
AttributeListType PAL,
unsigned CallingConv,
bool  AttrOnCallSite 
)

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

Parameters
Info- The function type information.
TargetDecl- The decl these attributes are being constructed for. If supplied the attributes applied to this decl may contribute to the function attributes and calling convention.
PAL[out] - On return, the attribute list to use.
CallingConv[out] - On return, the LLVM calling convention to use.

Definition at line 1388 of file CGCall.cpp.

References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_end(), clang::CodeGen::CGFunctionInfo::arg_size(), clang::TargetOptions::CPU, clang::CodeGen::ABIArgInfo::Direct, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::Type::getAs(), clang::Decl::getAttr(), clang::CodeGen::CodeGenTypes::getContext(), clang::CodeGen::CGFunctionInfo::getEffectiveCallingConvention(), 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::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::CodeGenTypes::getTarget(), clang::TargetInfo::getTargetOpts(), clang::Decl::hasAttr(), clang::Type::hasSignedIntegerRepresentation(), clang::Type::hasUnsignedIntegerRepresentation(), clang::CodeGen::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::CGFunctionInfo::isChainCall(), clang::Type::isConstantSizeType(), clang::Type::isIncompleteType(), clang::CodeGen::CGFunctionInfo::isNoReturn(), clang::FunctionProtoType::isNothrow(), clang::Type::isSignedIntegerOrEnumerationType(), clang::Type::isUnsignedIntegerOrEnumerationType(), clang::CXXMethodDecl::isVirtual(), and clang::TargetInfo::setFeatureEnabled().

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

llvm::Constant * CodeGenModule::CreateBuiltinFunction ( llvm::FunctionType *  FTy,
StringRef  Name,
llvm::AttributeSet  ExtraAttrs = llvm::AttributeSet() 
)

Create a new compiler builtin function with the specified type and name.

CreateBuiltinFunction - Create a new builtin function with the specified type and name.

Definition at line 1690 of file CodeGenModule.cpp.

References AttributeLangSupport::C, and clang::CodeGen::CodeGenTypeCache::getBuiltinCC().

llvm::Function * CodeGenModule::CreateGlobalInitOrDestructFunction ( llvm::FunctionType *  ty,
const Twine &  name,
SourceLocation  Loc = SourceLocation(),
bool  TLS = false 
)
llvm::GlobalVariable * CodeGenModule::CreateOrReplaceCXXRuntimeVariable ( StringRef  Name,
llvm::Type *  Ty,
llvm::GlobalValue::LinkageTypes  Linkage 
)

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

References getModule(), and supportsCOMDAT().

Referenced by clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), and clang::CodeGen::CodeGenVTables::GetAddrOfVTT().

llvm::Constant * CodeGenModule::CreateRuntimeFunction ( llvm::FunctionType *  FTy,
StringRef  Name,
llvm::AttributeSet  ExtraAttrs = llvm::AttributeSet() 
)

Create a new runtime function with the specified type and name.

CreateRuntimeFunction - Create a new runtime function with the specified type and name.

Definition at line 1675 of file CodeGenModule.cpp.

References AttributeLangSupport::C, and clang::CodeGen::CodeGenTypeCache::getRuntimeCC().

Referenced by createARCRuntimeFunction(), clang::createDispatchFiniFunction(), clang::createDispatchInitFunction(), clang::createDispatchNextFunction(), clang::createForStaticInitFunction(), clang::createRuntimeFunction(), clang::CodeGen::CodeGenVTables::CreateVTableInitializer(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), emitAtomicLibcall(), emitCheckHandlerCall(), EmitDtorSanitizerCallback(), clang::CodeGen::CodeGenFunction::EmitFunctionInstrumentation(), emitGlobalDtorWithCXAAtExit(), emitGlobalDtorWithTLRegDtor(), clang::CodeGen::CodeGenFunction::EmitMCountInstrumentation(), emitRTtypeidCall(), getAllocateExceptionFn(), getBadCastFn(), getBadTypeidFn(), getBeginCatchFn(), getBlockObjectAssign(), getBlockObjectDispose(), getCatchallRethrowFn(), 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 1872 of file CodeGenModule.cpp.

Referenced by emitGlobalDtorWithCXAAtExit(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), GetAddrOfConstantCFString(), and GetAddrOfConstantString().

llvm::MDTuple * CodeGenModule::CreateVTableBitSetEntry ( llvm::GlobalVariable *  VTable,
CharUnits  Offset,
const CXXRecordDecl RD 
)
void CodeGenModule::DecorateInstruction ( llvm::Instruction *  Inst,
llvm::MDNode *  TBAAInfo,
bool  ConvertTypeToTag = true 
)

Decorate the instruction with a TBAA tag. For scalar TBAA, the tag is the same as the type. For struct-path aware TBAA, the tag is different from the type: base type, access type and offset. When ConvertTypeToTag is true, we create a tag based on the scalar type.

Decorate the instruction with a TBAA tag. For both scalar TBAA and struct-path aware TBAA, the tag has the same format: base type, access type and offset. When ConvertTypeToTag is true, we create a tag based on the scalar type.

Definition at line 471 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTBAA::getTBAAScalarTagInfo().

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

llvm::Constant * CodeGenModule::EmitAnnotateAttr ( llvm::GlobalValue *  GV,
const AnnotateAttr *  AA,
SourceLocation  L 
)

Generate the llvm::ConstantStruct which contains the annotation information for a given GlobalValue. The annotation struct is {i8 *, i8 *, i8 *, i32}. The first field is a constant expression, the GlobalValue being annotated. The second field is the constant string created from the AnnotateAttr's annotation. The third field is a constant string containing the name of the translation unit. The fourth field is the line number in the file of the annotated value declaration.

Definition at line 1178 of file CodeGenModule.cpp.

References EmitAnnotationLineNo(), EmitAnnotationString(), EmitAnnotationUnit(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.

Referenced by AddGlobalAnnotations().

llvm::Constant * CodeGenModule::EmitAnnotationLineNo ( SourceLocation  L)
llvm::Constant * CodeGenModule::EmitAnnotationString ( StringRef  Str)
llvm::Constant * CodeGenModule::EmitAnnotationUnit ( SourceLocation  Loc)
llvm::Constant * CodeGenModule::EmitConstantExpr ( const Expr E,
QualType  DestType,
CodeGenFunction CGF = nullptr 
)
llvm::Constant * CodeGenModule::EmitConstantInit ( const VarDecl D,
CodeGenFunction CGF = nullptr 
)
llvm::Constant * CodeGenModule::EmitConstantValue ( const APValue Value,
QualType  DestType,
CodeGenFunction CGF = nullptr 
)

Emit the given constant value as a constant, in the type's scalar representation.

Definition at line 1228 of file CGExprConstant.cpp.

References clang::APValue::AddrLabelDiff, clang::APValue::Array, AttributeLangSupport::C, clang::APValue::ComplexFloat, clang::APValue::ComplexInt, clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), EmitConstantExpr(), EmitConstantValueForMemory(), clang::CodeGen::CGCXXABI::EmitMemberPointer(), clang::APValue::Float, clang::APValue::getAddrLabelDiffLHS(), clang::APValue::getAddrLabelDiffRHS(), clang::APValue::getArrayFiller(), clang::APValue::getArrayInitializedElt(), clang::APValue::getArrayInitializedElts(), clang::APValue::getArraySize(), clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::APValue::getComplexFloatImag(), clang::APValue::getComplexFloatReal(), clang::APValue::getComplexIntImag(), clang::APValue::getComplexIntReal(), getCXXABI(), clang::ArrayType::getElementType(), clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getKind(), clang::ASTContext::getLangOpts(), clang::APValue::getLValueBase(), clang::APValue::getLValueOffset(), clang::CharUnits::getQuantity(), clang::Expr::getType(), getTypes(), clang::ASTContext::getTypeSize(), clang::APValue::getVectorElt(), clang::APValue::getVectorLength(), clang::APValue::hasArrayFiller(), Inits, clang::APValue::Int, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::APValue::isInt(), clang::APValue::LValue, clang::APValue::MemberPointer, clang::APValue::Struct, clang::APValue::Uninitialized, clang::APValue::Union, and clang::APValue::Vector.

Referenced by EmitConstantExpr(), EmitConstantValueForMemory(), and GetAddrOfGlobalTemporary().

llvm::Constant * CodeGenModule::EmitConstantValueForMemory ( const APValue Value,
QualType  DestType,
CodeGenFunction CGF = nullptr 
)

Emit the given constant value as a constant, in the type's memory representation.

Definition at line 1430 of file CGExprConstant.cpp.

References AttributeLangSupport::C, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), EmitConstantValue(), and getTypes().

Referenced by EmitConstantInit(), and EmitConstantValue().

void CodeGenModule::EmitDeferredUnusedCoverageMappings ( )

Emit all the deferred coverage mappings for the uninstrumented functions.

Definition at line 3437 of file CodeGenModule.cpp.

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

Referenced by Release().

void clang::CodeGen::CodeGenModule::EmitFundamentalRTTIDescriptors ( )

Emit the RTTI descriptors for the builtin types.

void CodeGenModule::EmitGlobal ( GlobalDecl  D)
void CodeGenModule::EmitGlobalAnnotations ( )

Emit all the global annotations.

Definition at line 1133 of file CodeGenModule.cpp.

References AnnotationSection, and getModule().

Referenced by Release().

llvm::Constant * CodeGenModule::EmitNullConstant ( QualType  T)
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 1589 of file CGExprConstant.cpp.

References EmitNullConstant().

Referenced by EmitNullBaseClassInitialization().

void CodeGenModule::EmitOMPThreadPrivateDecl ( const OMPThreadPrivateDecl D)

Emit a code for threadprivate directive.

Parameters
DThreadprivate declaration.

Definition at line 3662 of file CodeGenModule.cpp.

References clang::emitThreadPrivateVarDefinition(), GetAddrOfGlobalVar(), getContext(), getOpenMPRuntime(), and clang::OMPThreadPrivateDecl::varlists().

Referenced by EmitTopLevelDecl().

void CodeGenModule::EmitTentativeDefinition ( const VarDecl D)

Definition at line 1877 of file CodeGenModule.cpp.

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

void CodeGenModule::EmitTopLevelDecl ( Decl D)
void CodeGenModule::EmitVTable ( CXXRecordDecl theClass)

This is a callback from Sema to tell us that that a particular v-table 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 766 of file CGVTables.cpp.

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

void CodeGenModule::EmitVTableBitSetEntries ( llvm::GlobalVariable *  VTable,
const VTableLayout VTLayout 
)
void CodeGenModule::Error ( SourceLocation  loc,
StringRef  error 
)
void CodeGenModule::ErrorUnsupported ( const Stmt S,
const char *  Type 
)
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 498 of file CodeGenModule.cpp.

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

llvm::Constant * CodeGenModule::GetAddrOfConstantCFString ( const StringLiteral Literal)
llvm::Constant * CodeGenModule::GetAddrOfConstantCompoundLiteral ( const CompoundLiteralExpr E)

Returns a pointer to a constant global variable for the given file-scope compound literal expression.

Definition at line 1442 of file CGExprConstant.cpp.

References clang::CompoundLiteralExpr::isFileScope().

llvm::GlobalVariable * CodeGenModule::GetAddrOfConstantCString ( const std::string &  Str,
const char *  GlobalName = nullptr,
unsigned  Alignment = 0 
)

Returns a pointer to a character array containing the literal and a terminating '\0' character. The result has pointer to array type.

Parameters
GlobalNameIf provided, the name to use for the global (if one is created).

GetAddrOfConstantCString - Returns a pointer to a character array containing the literal and a terminating '\0' character. The result has pointer to array type.

Definition at line 2983 of file CodeGenModule.cpp.

References AttributeLangSupport::C, GenerateStringLiteral(), clang::ASTContext::getAlignOfGlobalVarInChars(), getContext(), getLLVMContext(), and clang::CharUnits::getQuantity().

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

llvm::GlobalVariable * CodeGenModule::GetAddrOfConstantString ( const StringLiteral Literal)
llvm::GlobalVariable * CodeGenModule::GetAddrOfConstantStringFromLiteral ( const StringLiteral S,
StringRef  Name = ".str" 
)
llvm::GlobalVariable * 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 2973 of file CodeGenModule.cpp.

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

llvm::Constant * CodeGenModule::getAddrOfCXXCatchHandlerType ( QualType  Ty,
QualType  CatchHandlerType 
)
llvm::GlobalValue * CodeGenModule::getAddrOfCXXStructor ( const CXXMethodDecl MD,
StructorType  Type,
const CGFunctionInfo FnInfo = nullptr,
llvm::FunctionType *  FnType = nullptr,
bool  DontDefer = false 
)
llvm::Constant * CodeGenModule::GetAddrOfFunction ( GlobalDecl  GD,
llvm::Type *  Ty = 0,
bool  ForVTable = false,
bool  DontDefer = false 
)

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.

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 (this occurs when we see a definition of the function).

Definition at line 1660 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTypes::ConvertType(), clang::GlobalDecl::getDecl(), getMangledName(), and getTypes().

Referenced by clang::CodeGen::CodeGenVTables::CreateVTableInitializer(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), EmitFunctionDeclLValue(), EmitNewDeleteCall(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), and GetAddrOfGlobal().

llvm::Constant* clang::CodeGen::CodeGenModule::GetAddrOfGlobal ( GlobalDecl  GD)
inline
llvm::Constant * CodeGenModule::GetAddrOfGlobalBlock ( const BlockExpr BE,
const char *  name 
)
llvm::Constant * CodeGenModule::GetAddrOfGlobalTemporary ( const MaterializeTemporaryExpr E,
const Expr Inner 
)
llvm::Constant * CodeGenModule::GetAddrOfGlobalVar ( const VarDecl D,
llvm::Type *  Ty = nullptr 
)

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 greated with the specified type instead of whatever the normal requested type would be.

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.

Definition at line 1855 of file CodeGenModule.cpp.

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

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

llvm::Constant * CodeGenModule::GetAddrOfRTTIDescriptor ( QualType  Ty,
bool  ForEH = false 
)
llvm::Constant * CodeGenModule::GetAddrOfThunk ( GlobalDecl  GD,
const ThunkInfo Thunk 
)
llvm::Constant * CodeGenModule::GetAddrOfUuidDescriptor ( const CXXUuidofExpr E)

Get the address of a uuid descriptor .

Definition at line 1274 of file CodeGenModule.cpp.

References getModule(), clang::CXXUuidofExpr::getUuidAsStringRef(), and supportsCOMDAT().

ARCEntrypoints& clang::CodeGen::CodeGenModule::getARCEntrypoints ( ) const
inline
llvm::Constant* clang::CodeGen::CodeGenModule::getAtomicGetterHelperFnMap ( QualType  Ty)
inline
llvm::Constant* clang::CodeGen::CodeGenModule::getAtomicSetterHelperFnMap ( QualType  Ty)
inline
llvm::Type * CodeGenModule::getBlockDescriptorType ( )

Fetches the type of a generic block descriptor.

Definition at line 901 of file CGBlocks.cpp.

References clang::CodeGen::CodeGenTypes::ConvertType(), clang::serialized_diags::create(), getContext(), and getTypes().

Referenced by buildBlockDescriptor(), getGenericBlockLiteralType(), and initializeForBlockHeader().

StringRef CodeGenModule::getBlockMangledName ( GlobalDecl  GD,
const BlockDecl BD 
)
llvm::Constant * CodeGenModule::getBlockObjectAssign ( )
llvm::Constant * CodeGenModule::getBlockObjectDispose ( )
llvm::Value * 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 37 of file CGBuiltin.cpp.

References clang::ASTContext::BuiltinInfo, Context, clang::Builtin::Context::GetName(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), and clang::Builtin::Context::isLibFunction().

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

Definition at line 614 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenPGO::assignRegionCounters(), clang::CodeGen::CodeGenFunction::CodeGenFunction(), createReferenceTemporary(), clang::CodeGen::CodeGenFunction::EmitARCDestroyStrong(), clang::CodeGen::CodeGenFunction::EmitARCInitWeak(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleasedReturnValue(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBlockWithFallThrough(), clang::CodeGen::CodeGenFunction::EmitCaseStmt(), clang::CodeGen::CodeGenPGO::emitCounterIncrement(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), EmitDeclInvariant(), clang::CodeGen::CodeGenFunction::EmitDeclRefExprDbgValue(), clang::CodeGen::CodeGenFunction::EmitDestructorBody(), clang::CodeGen::CodeGenFunction::EmitLifetimeStart(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(), EmitTopLevelDecl(), emitWritebackArg(), clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), GenOpenCLArgMetadata(), clang::CodeGen::CodeGenFunction::getARCCleanupKind(), getCodegenToUse(), clang::CodeGen::CodeGenFunction::incrementProfileCounter(), clang::CodeGen::CodeGenFunction::LValueIsSuitableForInlineAtomic(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), Release(), clang::CodeGen::CodeGenFunction::ShouldInstrumentFunction(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), clang::CodeGen::CodeGenFunction::StartFunction(), TryEmitBaseDestructorAsAlias(), TryEmitDefinitionAsAlias(), tryEmitFMulAdd(), and clang::CodeGen::CodeGenFunction::typeIsSuitableForInlineAtomic().

llvm::Constant * CodeGenModule::GetConstantArrayFromStringLiteral ( const StringLiteral E)
ASTContext& clang::CodeGen::CodeGenModule::getContext ( ) const
inline

Definition at line 608 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), buildBlockDescriptor(), buildByrefHelpers(), clang::CodeGen::CodeGenFunction::BuildByRefType(), clang::CodeGen::CGCXXABI::buildThisParam(), clang::CodeGen::CGDebugInfo::completeClassData(), clang::CodeGen::CGDebugInfo::completeRequiredType(), clang::CodeGen::CGDebugInfo::completeType(), computeBlockInfo(), clang::CodeGen::CGObjCRuntime::ComputeIvarBaseOffset(), computeNonVirtualBaseClassOffset(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CGOpenCLRuntime::convertOpenCLSpecificType(), clang::CodeGen::CodeGenFunction::createAtExitStub(), clang::CodeGen::CreateItaniumCXXABI(), createKmpTaskTRecordDecl(), createKmpTaskTWithPrivatesRecordDecl(), createPrivatesRecordDecl(), clang::CodeGen::CodeGenVTables::CreateVTableInitializer(), EmitAnnotationLineNo(), EmitAnnotationUnit(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), EmitAtomicUpdateValue(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CodeGenFunction::emitByrefStructureInit(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCondBrHints(), emitCopyprivateCopyFunction(), emitDestructorsFunction(), clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::emitKmpRoutineEntryT(), clang::CodeGen::CGCXXABI::EmitMemberFunctionPointer(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), emitOMPAtomicRMW(), EmitOMPThreadPrivateDecl(), emitProxyTaskFunction(), emitReductionFunction(), emitTaskPrivateMappingFunction(), EmitTopLevelDecl(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), clang::CodeGen::CodeGenFunction::EnterCXXTryStmt(), extractFieldType(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), GenerateStringLiteral(), GenOpenCLArgMetadata(), GetAddrOfConstantCFString(), GetAddrOfConstantCString(), GetAddrOfConstantString(), GetAddrOfConstantStringFromLiteral(), GetAddrOfConstantStringFromObjCEncode(), GetAddrOfGlobalTemporary(), GetAddrOfGlobalVar(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), getAsmSrcLocInfo(), getBlockDescriptorType(), clang::CodeGen::CGCXXABI::getContext(), clang::CodeGen::CodeGenFunction::getContext(), getFunctionLinkage(), GetGlobalVarAddressSpace(), getGuardAcquireFn(), getLLVMLinkageVarDefinition(), getMemberPointerConstant(), GetNonVirtualBaseClassOffset(), getOrCreateStaticVarDecl(), clang::getOrCreateThreadPrivateCache(), clang::CodeGen::CodeGenVTables::getSecondaryVirtualPointerIndex(), clang::CodeGen::CodeGenVTables::getSubVTTIndex(), GetWeakRefReference(), InitCatchParam(), initializeForBlockHeader(), isInSanitizerBlacklist(), clang::CodeGen::CodeGenVTables::isVTableExternal(), LookupFieldBitOffset(), clang::CodeGen::CGDebugInfo::setLocation(), shouldBeInCOMDAT(), ShouldUseExternalRTTIDescriptor(), and clang::CodeGen::CodeGenFunction::StartThunk().

CoverageMappingModuleGen* clang::CodeGen::CodeGenModule::getCoverageMapping ( ) const
inline
CGCUDARuntime& clang::CodeGen::CodeGenModule::getCUDARuntime ( )
inline

Return a reference to the configured CUDA runtime.

Definition at line 532 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitCUDAKernelCallExpr(), and clang::CodeGen::CodeGenFunction::GenerateCode().

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

Definition at line 623 of file CodeGenModule.h.

Referenced by BuildAppleKextVirtualCall(), CalculateCookiePadding(), clang::CodeGen::CodeGenFunction::CodeGenFunction(), CodeGenModule(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateVTableBitSetEntry(), clang::CodeGen::CodeGenVTables::CreateVTableInitializer(), EmitArrayDelete(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitCallArg(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), EmitConstantValue(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), EmitDeclDestroy(), clang::CodeGen::CodeGenFunction::EmitDelegateCallArg(), clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), EmitDynamicCastToNull(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitMemberInitializer(), EmitNullConstant(), EmitObjectDelete(), EmitTopLevelDecl(), EmitTypeidFromVTable(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CodeGen::CodeGenFunction::ExitCXXTryStmt(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), clang::CodeGen::CodeGenFunction::GetAddressOfBaseClass(), GetAddrOfConstantStringFromLiteral(), getAddrOfCXXCatchHandlerType(), GetAddrOfGlobalTemporary(), GetAddrOfRTTIDescriptor(), GetAddrOfThunk(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), GetAddrOfVTTVTable(), getBlockMangledName(), getFunctionLinkage(), getMangledName(), getMemberPointerConstant(), getTerminateFn(), clang::CodeGen::CodeGenFunction::getTerminateHandler(), clang::CodeGen::CodeGenFunction::getTerminateLandingPad(), getUniqueTagTypeName(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), clang::CodeGen::CodeGenFunction::InitializeVTablePointer(), clang::CodeGen::CodeGenFunction::InitializeVTablePointers(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), PerformReturnAdjustment(), pushTemporaryCleanup(), setFunctionDLLStorageClass(), setThunkProperties(), clang::CodeGen::CodeGenFunction::StartFunction(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), and clang::CodeGen::CodeGenFunction::StartThunk().

const llvm::DataLayout& clang::CodeGen::CodeGenModule::getDataLayout ( ) const
inline
DiagnosticsEngine& clang::CodeGen::CodeGenModule::getDiags ( ) const
inline
llvm::GlobalValue::LinkageTypes CodeGenModule::getFunctionLinkage ( GlobalDecl  GD)
llvm::Type * CodeGenModule::getGenericBlockLiteralType ( )
CtorList& clang::CodeGen::CodeGenModule::getGlobalCtors ( )
inline

Definition at line 642 of file CodeGenModule.h.

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

Definition at line 643 of file CodeGenModule.h.

llvm::GlobalValue * CodeGenModule::GetGlobalValue ( StringRef  Ref)
unsigned CodeGenModule::GetGlobalVarAddressSpace ( const VarDecl D,
unsigned  AddrSpace 
)

Return the 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.

Definition at line 1900 of file CodeGenModule.cpp.

References clang::LangAS::cuda_constant, clang::LangAS::cuda_device, clang::LangAS::cuda_shared, getContext(), clang::ASTContext::getTargetAddressSpace(), and clang::Decl::hasAttr().

Referenced by GetAddrOfGlobalTemporary(), and getOrCreateStaticVarDecl().

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

Definition at line 610 of file CodeGenModule.h.

llvm::Function * CodeGenModule::getIntrinsic ( unsigned  IID,
ArrayRef< llvm::Type * >  Tys = None 
)
ItaniumVTableContext& clang::CodeGen::CodeGenModule::getItaniumVTableContext ( )
inline
const LangOptions& clang::CodeGen::CodeGenModule::getLangOpts ( ) const
inline

Definition at line 609 of file CodeGenModule.h.

Referenced by buildBlockDescriptor(), clang::CodeGen::CodeGenFunction::CodeGenFunction(), CodeGenModule(), clang::CodeGen::CGDebugInfo::completeType(), computeBlockInfo(), configureBlocksRuntimeObject(), createARCRuntimeFunction(), CreateGlobalInitOrDestructFunction(), clang::CodeGen::CreateGNUObjCRuntime(), clang::CodeGen::SanitizerMetadata::disableSanitizerForGlobal(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), EmitBaseInitializer(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallOrInvoke(), clang::CodeGen::CodeGenFunction::EmitDelegatingCXXConstructorCall(), clang::CodeGen::CodeGenPGO::emitEmptyCounterMapping(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), EmitGlobal(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolCleanup(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), EmitTopLevelDecl(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), GenerateStringLiteral(), GetAddrOfConstantString(), GetAddrOfRTTIDescriptor(), getARCEntrypoints(), getAsmSrcLocInfo(), clang::CodeGen::CodeGenFunction::getInvokeDestImpl(), clang::CodeGen::CodeGenFunction::getLangOpts(), getLLVMLinkageForDeclarator(), clang::getOrCreateThreadPrivateCache(), getStaticDeclName(), getTerminateFn(), getTypeInfoLinkage(), clang::CodeGen::CodeGenFunction::IvarTypeWithAggrGCObjects(), MaybeHandleStaticInExternC(), clang::CodeGen::SanitizerMetadata::reportGlobalToASan(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), tryCaptureAsConstant(), and UseOptimizedSetter().

llvm::LLVMContext& clang::CodeGen::CodeGenModule::getLLVMContext ( )
inline
llvm::Constant * CodeGenModule::getLLVMLifetimeEndFn ( )

Lazily declare the .lifetime.end intrinsic.

Definition at line 1631 of file CGDecl.cpp.

References getModule().

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

llvm::Constant * CodeGenModule::getLLVMLifetimeStartFn ( )

Lazily declare the .lifetime.start intrinsic.

Definition at line 1623 of file CGDecl.cpp.

References getModule().

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

llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageForDeclarator ( const DeclaratorDecl D,
GVALinkage  Linkage,
bool  IsConstantVariable 
)
llvm::GlobalValue::LinkageTypes CodeGenModule::getLLVMLinkageVarDefinition ( const VarDecl VD,
bool  IsConstant 
)
static llvm::GlobalValue::VisibilityTypes clang::CodeGen::CodeGenModule::GetLLVMVisibility ( Visibility  V)
inlinestatic
StringRef CodeGenModule::getMangledName ( GlobalDecl  GD)
llvm::Constant * CodeGenModule::getMemberPointerConstant ( const UnaryOperator e)
MicrosoftVTableContext& clang::CodeGen::CodeGenModule::getMicrosoftVTableContext ( )
inline
llvm::Module& clang::CodeGen::CodeGenModule::getModule ( ) const
inline

Definition at line 615 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), buildBlockDescriptor(), buildGlobalBlock(), CreateGlobalInitOrDestructFunction(), CreateOrReplaceCXXRuntimeVariable(), createReferenceTemporary(), clang::CodeGen::SanitizerMetadata::disableSanitizerForInstruction(), EmitAnnotationString(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleasedReturnValue(), clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), emitConstructorDestructorAlias(), emitCopyprivateCopyFunction(), emitCXXDestructor(), emitDestructorsFunction(), EmitGlobalAnnotations(), EmitGlobalDeclMetadata(), EmitGlobalNamedRegister(), EmitNullBaseClassInitialization(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), emitProxyTaskFunction(), emitReductionFunction(), emitTaskPrivateMappingFunction(), EmitTopLevelDecl(), emitUsed(), EmitVTableBitSetEntries(), clang::CodeGen::CodeGenVTables::EmitVTTDefinition(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), clang::CodeGen::CodeGenFunction::FinishFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), GenerateStringLiteral(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfConstantCFString(), GetAddrOfConstantString(), GetAddrOfGlobalTemporary(), GetAddrOfUuidDescriptor(), getClangCallTerminateFn(), GetGlobalValue(), getInitThreadEpochPtr(), getIntrinsic(), getLLVMLifetimeEndFn(), getLLVMLifetimeStartFn(), clang::getOrCreateInternalVariable(), getOrCreateStaticVarDecl(), getTypeInfoVTable(), clang::CodeGen::CodeGenFunction::recoverAddrOfEscapedLocal(), Release(), clang::CodeGen::SanitizerMetadata::reportGlobalToASan(), setThunkProperties(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), and TryEmitDefinitionAsAlias().

CGDebugInfo* clang::CodeGen::CodeGenModule::getModuleDebugInfo ( )
inline
llvm::Constant * CodeGenModule::GetNonVirtualBaseClassOffset ( const CXXRecordDecl ClassDecl,
CastExpr::path_const_iterator  PathBegin,
CastExpr::path_const_iterator  PathEnd 
)
llvm::MDNode* clang::CodeGen::CodeGenModule::getNoObjCARCExceptionsMetadata ( )
inline

Definition at line 602 of file CodeGenModule.h.

References getLLVMContext(), and clang::None.

llvm::Constant * CodeGenModule::getNSConcreteGlobalBlock ( )
llvm::Constant * CodeGenModule::getNSConcreteStackBlock ( )
QualType CodeGenModule::getObjCFastEnumerationStateType ( )
CGObjCRuntime& clang::CodeGen::CodeGenModule::getObjCRuntime ( )
inline
CGOpenCLRuntime& clang::CodeGen::CodeGenModule::getOpenCLRuntime ( )
inline

Return a reference to the configured OpenCL runtime.

Definition at line 520 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenTypes::ConvertType(), and clang::CodeGen::CodeGenFunction::EmitVarDecl().

CGOpenMPRuntime& clang::CodeGen::CodeGenModule::getOpenMPRuntime ( )
inline
llvm::Constant * CodeGenModule::getOrCreateStaticVarDecl ( const VarDecl D,
llvm::GlobalValue::LinkageTypes  Linkage 
)
llvm::IndexedInstrProfReader* clang::CodeGen::CodeGenModule::getPGOReader ( ) const
inline

Definition at line 548 of file CodeGenModule.h.

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

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

Definition at line 547 of file CodeGenModule.h.

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

Definition at line 612 of file CodeGenModule.h.

RREntrypoints& clang::CodeGen::CodeGenModule::getRREntrypoints ( ) const
inline
SanitizerMetadata* clang::CodeGen::CodeGenModule::getSanitizerMetadata ( )
inline
llvm::ConstantInt * CodeGenModule::getSize ( CharUnits  numChars)
llvm::Constant* clang::CodeGen::CodeGenModule::getStaticLocalDeclAddress ( const VarDecl D)
inline
llvm::GlobalVariable* clang::CodeGen::CodeGenModule::getStaticLocalDeclGuardAddress ( const VarDecl D)
inline

Definition at line 566 of file CodeGenModule.h.

const TargetInfo& clang::CodeGen::CodeGenModule::getTarget ( ) const
inline
const TargetCodeGenInfo & CodeGenModule::getTargetCodeGenInfo ( )
CharUnits CodeGenModule::GetTargetTypeStoreSize ( llvm::Type *  Ty) const

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

Definition at line 1895 of file CodeGenModule.cpp.

References clang::ASTContext::toCharUnitsFromBits().

llvm::MDNode * CodeGenModule::getTBAAInfo ( QualType  QTy)
llvm::MDNode * CodeGenModule::getTBAAInfoForVTablePtr ( )
llvm::MDNode * CodeGenModule::getTBAAStructInfo ( QualType  QTy)
llvm::MDNode * CodeGenModule::getTBAAStructTagInfo ( QualType  BaseTy,
llvm::MDNode *  AccessN,
uint64_t  O 
)

Return the path-aware tag for given base type, access node and offset.

Definition at line 459 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTBAA::getTBAAStructTagInfo().

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

Return the MDNode in the type DAG for the given struct type.

Definition at line 453 of file CodeGenModule.cpp.

References clang::CodeGen::CodeGenTBAA::getTBAAStructTypeInfo().

llvm::Constant * CodeGenModule::getTerminateFn ( )
const llvm::Triple & CodeGenModule::getTriple ( ) const

Definition at line 7096 of file CodeGen/TargetInfo.cpp.

References getTarget(), and clang::TargetInfo::getTriple().

Referenced by supportsCOMDAT().

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

Definition at line 593 of file CodeGenModule.h.

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

Definition at line 630 of file CodeGenModule.h.

Referenced by clang::CodeGen::CodeGenABITypes::arrangeCXXMethodType(), clang::CodeGen::CodeGenABITypes::arrangeFreeFunctionCall(), clang::CodeGen::CodeGenABITypes::arrangeFreeFunctionType(), clang::CodeGen::CodeGenABITypes::arrangeObjCMessageSendSignature(), clang::CodeGen::CodeGenFunction::BuildAppleKextVirtualDestructorCall(), buildBlockDescriptor(), buildGlobalBlock(), codegenCXXStructor(), computeBlockInfo(), clang::CodeGen::CGCXXABI::ConvertMemberPointerType(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::createAtExitStub(), CreateGlobalInitOrDestructFunction(), clang::CodeGen::CodeGenVTables::CreateVTableInitializer(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), emitAtomicLibcall(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), EmitConstantExpr(), EmitConstantInit(), EmitConstantValue(), EmitConstantValueForMemory(), emitCopyprivateCopyFunction(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXStructorCall(), clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), emitDestructorsFunction(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), EmitGlobal(), clang::emitKmpRoutineEntryT(), clang::CodeGen::CGCXXABI::EmitLoadOfMemberFunctionPointer(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNewDeleteCall(), EmitNullBaseClassInitialization(), EmitNullConstant(), EmitNullConstant(), EmitNullConstantForBase(), clang::CodeGen::CodeGenFunction::EmitNullInitialization(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), emitProxyTaskFunction(), emitReductionFunction(), clang::CodeGen::CodeGenFunction::EmitSynthesizedCXXCopyCtorCall(), emitTaskPrivateMappingFunction(), clang::CodeGen::CodeGenFunction::EmitVAArg(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCCtorDtorMethod(), clang::CodeGen::CodeGenFunction::generateThunk(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), GetAddrOfConstantCFString(), GetAddrOfConstantString(), getAddrOfCXXStructor(), GetAddrOfFunction(), GetAddrOfGlobalTemporary(), GetAddrOfGlobalVar(), GetAddrOfThunk(), getBlockDescriptorType(), clang::CodeGen::CGCXXABI::GetBogusMemberPointer(), GetConstantArrayFromStringLiteral(), getGuardAcquireFn(), clang::CodeGen::CGObjCRuntime::getMessageSendInfo(), getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenFunction::getTypes(), GetWeakRefReference(), initializeForBlockHeader(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper(), and TryEmitDefinitionAsAlias().

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

Fetches the global unique block count.

Definition at line 789 of file CodeGenModule.h.

llvm::GlobalVariable::LinkageTypes CodeGenModule::getVTableLinkage ( const CXXRecordDecl RD)
CodeGenVTables& clang::CodeGen::CodeGenModule::getVTables ( )
inline
llvm::Constant * CodeGenModule::GetWeakRefReference ( const ValueDecl VD)
void CodeGenModule::HandleCXXStaticMemberVarInstantiation ( VarDecl VD)
bool clang::CodeGen::CodeGenModule::hasObjCRuntime ( )
inline

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

Definition at line 517 of file CodeGenModule.h.

bool CodeGenModule::IsCFIBlacklistedRecord ( const CXXRecordDecl RD)

Returns whether the given record is blacklisted from control flow integrity checks.

Definition at line 848 of file CGVTables.cpp.

References clang::Decl::isInStdNamespace().

Referenced by EmitVTableBitSetEntries(), and clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck().

bool CodeGenModule::isInSanitizerBlacklist ( llvm::Function *  Fn,
SourceLocation  Loc 
) const
bool CodeGenModule::isInSanitizerBlacklist ( llvm::GlobalVariable *  GV,
SourceLocation  Loc,
QualType  Ty,
StringRef  Category = StringRef() 
) const
bool CodeGenModule::isPaddedAtomicType ( QualType  type)

Definition at line 626 of file CodeGenTypes.cpp.

References clang::Type::castAs().

bool CodeGenModule::isPaddedAtomicType ( const AtomicType type)
bool CodeGenModule::isTypeConstant ( QualType  Ty,
bool  ExcludeCtor 
)

isTypeConstant - Determine whether an object of this type can be emitted as a constant.

If ExcludeCtor is true, the duration when the object's constructor runs will not be considered. The caller will need to verify that the object is not written to during its construction.

Definition at line 1708 of file CodeGenModule.cpp.

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

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

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

Definition at line 3520 of file CodeGenModule.cpp.

template<typename SomeDecl >
void CodeGenModule::MaybeHandleStaticInExternC ( const SomeDecl *  D,
llvm::GlobalValue *  GV 
)

If the declaration has internal linkage but is inside an extern "C" linkage specification, prepare to emit an alias for it to the expected name.

Definition at line 1915 of file CodeGenModule.cpp.

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

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

Definition at line 1972 of file CodeGenModule.cpp.

References shouldBeInCOMDAT().

Referenced by emitCXXConstructor().

void CodeGenModule::Release ( )
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 1214 of file CGCall.cpp.

bool CodeGenModule::ReturnTypeUsesFP2Ret ( QualType  ResultType)

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

Definition at line 1236 of file CGCall.cpp.

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

bool CodeGenModule::ReturnTypeUsesFPRet ( QualType  ResultType)
bool CodeGenModule::ReturnTypeUsesSRet ( const CGFunctionInfo FI)

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

Definition at line 1210 of file CGCall.cpp.

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

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

void CodeGenModule::setAliasAttributes ( const Decl D,
llvm::GlobalValue *  GV 
)

Set attributes which must be preserved by an alias. This includes common attributes (i.e. it includes a call to SetCommonAttributes).

NOTE: This should only be called for definitions.

Definition at line 819 of file CodeGenModule.cpp.

References clang::Decl::hasAttr(), and SetCommonAttributes().

Referenced by emitConstructorDestructorAlias(), and TryEmitDefinitionAsAlias().

void clang::CodeGen::CodeGenModule::setAtomicGetterHelperFnMap ( QualType  Ty,
llvm::Constant *  Fn 
)
inline
void clang::CodeGen::CodeGenModule::setAtomicSetterHelperFnMap ( QualType  Ty,
llvm::Constant *  Fn 
)
inline
void CodeGenModule::SetCommonAttributes ( const Decl D,
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 808 of file CodeGenModule.cpp.

References addUsedGlobal(), clang::DefaultVisibility, clang::Decl::hasAttr(), and setGlobalVisibility().

Referenced by setAliasAttributes().

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

Set attributes for a global definition.

Definition at line 695 of file CodeGenModule.cpp.

Referenced by codegenCXXStructor().

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

Definition at line 1033 of file CodeGenModule.h.

References getFunctionLinkage().

Referenced by codegenCXXStructor(), and setThunkProperties().

void CodeGenModule::setGlobalVisibility ( llvm::GlobalValue *  GV,
const NamedDecl D 
) const
void CodeGenModule::SetInternalFunctionAttributes ( const Decl D,
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 839 of file CodeGenModule.cpp.

References clang::InternalLinkage, SetLLVMFunctionAttributes(), and SetLLVMFunctionAttributesForDefinition().

Referenced by clang::CodeGen::CodeGenFunction::GenerateCapturedStmtFunction(), and clang::CodeGen::CodeGenFunction::StartObjCMethod().

void CodeGenModule::SetLLVMFunctionAttributes ( const Decl D,
const CGFunctionInfo Info,
llvm::Function *  F 
)
void CodeGenModule::SetLLVMFunctionAttributesForDefinition ( const Decl D,
llvm::Function *  F 
)
void clang::CodeGen::CodeGenModule::setStaticLocalDeclAddress ( const VarDecl D,
llvm::Constant *  C 
)
inline
void clang::CodeGen::CodeGenModule::setStaticLocalDeclGuardAddress ( const VarDecl D,
llvm::GlobalVariable *  C 
)
inline

Definition at line 569 of file CodeGenModule.h.

References AttributeLangSupport::C.

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

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

Referenced by GetAddrOfGlobalTemporary(), and getOrCreateStaticVarDecl().

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

Definition at line 596 of file CodeGenModule.h.

References AttributeLangSupport::C.

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

Definition at line 626 of file CodeGenModule.h.

bool CodeGenModule::supportsCOMDAT ( ) const
bool CodeGenModule::TryEmitBaseDestructorAsAlias ( const CXXDestructorDecl D)
bool CodeGenModule::TryEmitDefinitionAsAlias ( GlobalDecl  AliasDecl,
GlobalDecl  TargetDecl,
bool  InEveryTU 
)

Try to emit a definition as a global alias for another definition. If InEveryTU is true, we know that an equivalent alias can be produced in every translation unit.

Definition at line 113 of file CGCXX.cpp.

References clang::serialized_diags::create(), GetAddrOfGlobal(), getCodeGenOpts(), clang::GlobalDecl::getDecl(), getFunctionLinkage(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetGlobalValue(), getMangledName(), getModule(), getTypes(), clang::Decl::hasAttr(), and setAliasAttributes().

Referenced by emitCXXDestructor(), and TryEmitBaseDestructorAsAlias().

void CodeGenModule::UpdateCompletedType ( const TagDecl TD)

Member Data Documentation

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

Definition at line 786 of file CodeGenModule.h.

Referenced by buildByrefHelpers().

int clang::CodeGen::CodeGenModule::GlobalUniqueCount

Definition at line 476 of file CodeGenModule.h.


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