clang API Documentation

Classes | Typedefs | Enumerations | Functions | Variables
clang::CodeGen Namespace Reference

Classes

class  ABIArgInfo
class  RequiredArgs
class  CGFunctionInfo
class  CodeGenABITypes
class  BlockFlags
class  BlockFieldFlags
class  CGBlockInfo
 CGBlockInfo - Information to generate a block literal. More...
class  CGBuilderInserter
 This is an IRBuilder insertion helper that forwards to CodeGenFunction::InsertHelper, which adds necessary metadata to instructions. More...
struct  CallArg
class  CallArgList
class  FunctionArgList
class  ReturnValueSlot
class  EHScope
 A protected scope for zero-cost EH handling. More...
class  EHCatchScope
class  EHCleanupScope
 A cleanup scope which generates the cleanup blocks lazily. More...
class  EHFilterScope
class  EHTerminateScope
class  CGCUDARuntime
class  CGCXXABI
 Implements C++ ABI-specific code generation functions. More...
class  CGDebugInfo
class  SaveAndRestoreLocation
class  NoLocation
class  ArtificialLocation
struct  LoopAttributes
 Attributes that may be specified on loops. More...
class  LoopInfo
 Information used when generating a structured loop. More...
class  LoopInfoStack
 A stack of loop information corresponding to loop nesting levels. This stack can be used to prepare attributes which are applied when a loop is emitted. More...
class  CGObjCRuntime
 Implements runtime-specific code generation functions. More...
class  CGOpenCLRuntime
class  CGOpenMPRuntime
struct  DebugLocThreadIdTy
 Stores debug location and ThreadID for the function. More...
struct  CGBitFieldInfo
 Structure with information about how a bitfield should be accessed. More...
class  CGRecordLayout
class  RValue
class  LValue
class  AggValueSlot
 An aggregate value slot. More...
class  CodeGenVTables
class  SuppressDebugLocation
class  CodeGenFunction
struct  DominatingLLVMValue
struct  DominatingPointer< T, true >
struct  DominatingValue< RValue >
 A specialization of DominatingValue for RValue. More...
struct  OrderGlobalInits
struct  CodeGenTypeCache
struct  RREntrypoints
struct  ARCEntrypoints
class  InstrProfStats
 This class records statistics on instrumentation based profiling. More...
class  CodeGenModule
class  CodeGenPGO
class  RegionCounter
struct  TBAAPathTag
class  CodeGenTBAA
class  CodeGenTypes
class  CoverageMappingModuleGen
 Organizes the cross-function state that is used while generating code coverage mapping data. More...
class  CoverageMappingGen
 Organizes the per-function state that is used while generating code coverage mapping data. More...
struct  BranchFixup
struct  InvariantValue
struct  DominatingValue
struct  DominatingPointer< T, false >
struct  DominatingValue< T * >
class  EHScopeStack
class  SanitizerMetadata

Typedefs

typedef CGBuilderInserter
< PreserveNames
CGBuilderInserterTy
typedef llvm::IRBuilder
< PreserveNames,
llvm::ConstantFolder,
CGBuilderInserterTy
CGBuilderTy
typedef SmallVector
< llvm::AttributeSet, 8 > 
AttributeListType
typedef llvm::DenseMap
< unsigned, llvm::Value * > 
OpenMPDebugLocMapTy
 Map for SourceLocation and OpenMP runtime library debug locations.
typedef llvm::DenseMap
< llvm::Function
*, DebugLocThreadIdTy
OpenMPLocThreadIDMapTy
 Map of local debug location, ThreadId and functions.

Enumerations

enum  BlockByrefFlags {
  BLOCK_BYREF_HAS_COPY_DISPOSE = (1 << 25), BLOCK_BYREF_LAYOUT_MASK = (0xF << 28), BLOCK_BYREF_LAYOUT_EXTENDED = (1 << 28), BLOCK_BYREF_LAYOUT_NON_OBJECT = (2 << 28),
  BLOCK_BYREF_LAYOUT_STRONG = (3 << 28), BLOCK_BYREF_LAYOUT_WEAK = (4 << 28), BLOCK_BYREF_LAYOUT_UNRETAINED = (5 << 28)
}
enum  BlockLiteralFlags {
  BLOCK_HAS_COPY_DISPOSE = (1 << 25), BLOCK_HAS_CXX_OBJ = (1 << 26), BLOCK_IS_GLOBAL = (1 << 28), BLOCK_USE_STRET = (1 << 29),
  BLOCK_HAS_SIGNATURE = (1 << 30), BLOCK_HAS_EXTENDED_LAYOUT = (1 << 31)
}
enum  BlockFieldFlag_t {
  BLOCK_FIELD_IS_OBJECT = 0x03, BLOCK_FIELD_IS_BLOCK = 0x07, BLOCK_FIELD_IS_BYREF = 0x08, BLOCK_FIELD_IS_WEAK = 0x10,
  BLOCK_FIELD_IS_ARC = 0x40, BLOCK_BYREF_CALLER = 128, BLOCK_BYREF_CURRENT_MAX = 256
}
enum  IdentFieldIndex {
  IdentField_Reserved_1, IdentField_Flags, IdentField_Reserved_2, IdentField_Reserved_3,
  IdentField_PSource
}
enum  ARCPreciseLifetime_t { ARCImpreciseLifetime, ARCPreciseLifetime }
 Does an ARC strong l-value have precise lifetime? More...
enum  TypeEvaluationKind { TEK_Scalar, TEK_Complex, TEK_Aggregate }
enum  StructorType { Complete, Base, Deleting }
enum  CleanupKind {
  EHCleanup = 0x1, NormalCleanup = 0x2, NormalAndEHCleanup = EHCleanup | NormalCleanup, InactiveCleanup = 0x4,
  InactiveEHCleanup = EHCleanup | InactiveCleanup, InactiveNormalCleanup = NormalCleanup | InactiveCleanup, InactiveNormalAndEHCleanup = NormalAndEHCleanup | InactiveCleanup
}

Functions

BlockFlags operator| (BlockLiteralFlags l, BlockLiteralFlags r)
BlockFieldFlags operator| (BlockFieldFlag_t l, BlockFieldFlag_t r)
CGCUDARuntimeCreateNVCUDARuntime (CodeGenModule &CGM)
 Creates an instance of a CUDA runtime class.
CGCXXABICreateItaniumCXXABI (CodeGenModule &CGM)
 Creates an Itanium-family ABI.
CGCXXABICreateMicrosoftCXXABI (CodeGenModule &CGM)
 Creates a Microsoft-family ABI.
CGObjCRuntimeCreateGNUObjCRuntime (CodeGenModule &CGM)
 Creates an instance of an Objective-C runtime class.
CGObjCRuntimeCreateMacObjCRuntime (CodeGenModule &CGM)
llvm::ValueEmitOpenMPUpdateLocation (CodeGenFunction &CGF, SourceLocation Loc, OpenMPLocationFlags Flags=OMP_IDENT_KMPC)
 Emits object of ident_t type with info for source location.
llvm::Type * getIdentTyPointerTy ()
 Returns pointer to ident_t type.
llvm::Type * getKmpc_MicroPointerTy ()
 Returns pointer to kmpc_micro type.
llvm::Constant * CreateRuntimeFunction (OpenMPRTLFunction Function)
 Returns specified OpenMP runtime function.
llvm::Constant * getOrCreateThreadPrivateCache (const VarDecl *VD)
 If the specified mangled name is not in the module, create and return threadprivate cache object. This object is a pointer's worth of storage that's reserved for use by the OpenMP runtime.
virtual llvm::ValueEmitThreadIDAddress (CodeGenFunction &CGF, SourceLocation Loc)
 Emits address of the word in a memory where current thread id is stored.
llvm::ValueGetOpenMPThreadID (CodeGenFunction &CGF, SourceLocation Loc)
 Gets thread id value for the current thread.
llvm::Constant * GetOrCreateInternalVariable (llvm::Type *Ty, const llvm::Twine &Name)
 Gets (if variable with the given name already exist) or creates internal global variable with the specified Name. The created variable has linkage CommonLinkage by default and is initialized by null value.
void EmitOMPThreadPrivateVarInit (CodeGenFunction &CGF, llvm::Value *VDAddr, llvm::Value *Ctor, llvm::Value *CopyCtor, llvm::Value *Dtor, SourceLocation Loc)
 Emits initialization code for the threadprivate variables.
 CGOpenMPRuntime (CodeGenModule &CGM)
virtual ~CGOpenMPRuntime ()
struct context_vars *param D
OpenMP directive param
ThreadIDVar Variable for
thread id in the current
OpenMP region *virtual
llvm::Value
EmitOpenMPOutlinedFunction (const OMPExecutableDirective &D, const VarDecl *ThreadIDVar)
void FunctionFinished (CodeGenFunction &CGF)
 Cleans up references to the objects in finished function.
virtual void EmitOMPParallelCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *OutlinedFn, llvm::Value *CapturedStruct)
 Emits code for parallel call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct.
virtual void EmitOMPSerialCall (CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *OutlinedFn, llvm::Value *CapturedStruct)
 Emits code for serial call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct.
llvm::ValueGetCriticalRegionLock (StringRef CriticalName)
 Returns corresponding lock object for the specified critical region name. If the lock object does not exist it is created, otherwise the reference to the existing copy is returned.
virtual void EmitOMPCriticalRegionStart (CodeGenFunction &CGF, llvm::Value *RegionLock, SourceLocation Loc)
 Emits start of the critical region by calling void __kmpc_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name RegionLock)
virtual void EmitOMPCriticalRegionEnd (CodeGenFunction &CGF, llvm::Value *RegionLock, SourceLocation Loc)
 Emits end of the critical region by calling void __kmpc_end_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name RegionLock)
virtual void EmitOMPBarrierCall (CodeGenFunction &CGF, SourceLocation Loc, OpenMPLocationFlags Flags)
 Emits a barrier for OpenMP threads.
virtual void EmitOMPNumThreadsClause (CodeGenFunction &CGF, llvm::Value *NumThreads, SourceLocation Loc)
 Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads) to generate code for 'num_threads' clause.
virtual llvm::ValuegetOMPAddrOfThreadPrivate (CodeGenFunction &CGF, const VarDecl *VD, llvm::Value *VDAddr, SourceLocation Loc)
 Returns address of the threadprivate variable for the current thread.
virtual llvm::Function * EmitOMPThreadPrivateVarDefinition (const VarDecl *VD, llvm::Value *VDAddr, SourceLocation Loc, bool PerformInit, CodeGenFunction *CGF=nullptr)
 Emit a code for initialization of threadprivate variable. It emits a call to runtime library which adds initial value to the newly created threadprivate variable (if it is not constant) and registers destructor for the variable (if any).
CXXCtorType toCXXCtorType (StructorType T)
StructorType getFromCtorType (CXXCtorType T)
CXXDtorType toCXXDtorType (StructorType T)
StructorType getFromDtorType (CXXDtorType T)

Variables

class
clang::CodeGen::CGOpenMPRuntime 
ident_t
llvm::StructType * IdentTy
OpenMPDebugLocMapTy OpenMPDebugLocMap
llvm::FunctionType * Kmpc_MicroTy
 The type for a microtask which gets passed to __kmpc_fork_call(). Original representation is: typedef void (kmpc_micro)(kmp_int32 global_tid, kmp_int32 bound_tid,...);.
OpenMPLocThreadIDMapTy OpenMPLocThreadIDMap
llvm::ArrayType * KmpCriticalNameTy
 Type kmp_critical_name, originally defined as typedef kmp_int32 kmp_critical_name[8];.
llvm::StringMap
< llvm::AssertingVH
< llvm::Constant >
, llvm::BumpPtrAllocator > 
InternalVars
 An ordered map of auto-generated variables to their unique names. It stores variables with the following names: 1) ".gomp_critical_user_" + <critical_section_name> + ".var" for "omp critical" directives; 2) <mangled_name_for_global_var> + ".cache." for cache for threadprivate variables.
llvm::DenseSet< const VarDecl * > ThreadPrivateWithDefinition
 Set of threadprivate variables with the generated initializer.
 kmp_int32

Typedef Documentation

typedef SmallVector<llvm::AttributeSet, 8> clang::CodeGen::AttributeListType

Definition at line 43 of file CGCall.h.

Definition at line 47 of file CGBuilder.h.

typedef llvm::IRBuilder<PreserveNames, llvm::ConstantFolder, CGBuilderInserterTy> clang::CodeGen::CGBuilderTy

Definition at line 49 of file CGBuilder.h.

Map for SourceLocation and OpenMP runtime library debug locations.

Definition at line 150 of file CGOpenMPRuntime.h.

typedef llvm::DenseMap<llvm::Function *, DebugLocThreadIdTy> clang::CodeGen::OpenMPLocThreadIDMapTy

Map of local debug location, ThreadId and functions.

Definition at line 163 of file CGOpenMPRuntime.h.


Enumeration Type Documentation

Does an ARC strong l-value have precise lifetime?

Enumerator:
ARCImpreciseLifetime 
ARCPreciseLifetime 

Definition at line 101 of file CGValue.h.

Enumerator:
BLOCK_BYREF_HAS_COPY_DISPOSE 
BLOCK_BYREF_LAYOUT_MASK 
BLOCK_BYREF_LAYOUT_EXTENDED 
BLOCK_BYREF_LAYOUT_NON_OBJECT 
BLOCK_BYREF_LAYOUT_STRONG 
BLOCK_BYREF_LAYOUT_WEAK 
BLOCK_BYREF_LAYOUT_UNRETAINED 

Definition at line 50 of file CGBlocks.h.

Enumerator:
BLOCK_FIELD_IS_OBJECT 
BLOCK_FIELD_IS_BLOCK 
BLOCK_FIELD_IS_BYREF 
BLOCK_FIELD_IS_WEAK 
BLOCK_FIELD_IS_ARC 
BLOCK_BYREF_CALLER 
BLOCK_BYREF_CURRENT_MAX 

Definition at line 98 of file CGBlocks.h.

Enumerator:
BLOCK_HAS_COPY_DISPOSE 
BLOCK_HAS_CXX_OBJ 
BLOCK_IS_GLOBAL 
BLOCK_USE_STRET 
BLOCK_HAS_SIGNATURE 
BLOCK_HAS_EXTENDED_LAYOUT 

Definition at line 60 of file CGBlocks.h.

Enumerator:
EHCleanup 
NormalCleanup 
NormalAndEHCleanup 
InactiveCleanup 
InactiveEHCleanup 
InactiveNormalCleanup 
InactiveNormalAndEHCleanup 

Definition at line 77 of file EHScopeStack.h.

Enumerator:
IdentField_Reserved_1 

might be used in Fortran

IdentField_Flags 

OMP_IDENT_xxx flags; OMP_IDENT_KMPC identifies this union member.

IdentField_Reserved_2 

Not really used in Fortran any more.

IdentField_Reserved_3 

Source[4] in Fortran, do not use for C++.

IdentField_PSource 

String describing the source location. The string is composed of semi-colon separated fields which describe the source file, the function and a pair of line numbers that delimit the construct.

Definition at line 134 of file CGOpenMPRuntime.h.

Enumerator:
Complete 
Base 
Deleting 

Definition at line 59 of file CodeGenTypes.h.

The kind of evaluation to perform on values of a particular type. Basically, is the code in CGExprScalar, CGExprComplex, or CGExprAgg?

TODO: should vectors maybe be split out into their own thing?

Enumerator:
TEK_Scalar 
TEK_Complex 
TEK_Aggregate 

Definition at line 90 of file CodeGenFunction.h.


Function Documentation

CGOpenMPRuntime::CGOpenMPRuntime ( CodeGenModule CGM) [explicit]

Creates an instance of an Objective-C runtime class.

Definition at line 2835 of file CGObjCGNU.cpp.

References clang::ObjCRuntime::getKind(), clang::CodeGen::CodeGenModule::getLangOpts(), and clang::LangOptions::ObjCRuntime.

Creates a Microsoft-family ABI.

Definition at line 2619 of file CodeGen/MicrosoftCXXABI.cpp.

Referenced by createCXXABI().

Creates an instance of a CUDA runtime class.

Definition at line 123 of file CGCUDANV.cpp.

llvm::Constant* clang::CodeGen::CreateRuntimeFunction ( OpenMPRTLFunction  Function)

Returns specified OpenMP runtime function.

Parameters:
FunctionOpenMP runtime function.
Returns:
Specified function.

Referenced by EmitOMPBarrierCall(), EmitOMPCriticalRegionEnd(), EmitOMPCriticalRegionStart(), EmitOMPParallelCall(), EmitOMPSerialCall(), EmitOMPThreadPrivateVarInit(), getOMPAddrOfThreadPrivate(), and GetOpenMPThreadID().

void CGOpenMPRuntime::EmitOMPBarrierCall ( CodeGenFunction CGF,
SourceLocation  Loc,
OpenMPLocationFlags  Flags 
) [virtual]

Emits a barrier for OpenMP threads.

Parameters:
FlagsFlags for the barrier.

Definition at line 634 of file CGOpenMPRuntime.cpp.

References CreateRuntimeFunction(), EmitOpenMPUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), and GetOpenMPThreadID().

void CGOpenMPRuntime::EmitOMPCriticalRegionEnd ( CodeGenFunction CGF,
llvm::Value RegionLock,
SourceLocation  Loc 
) [virtual]

Emits end of the critical region by calling void __kmpc_end_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name RegionLock)

Parameters:
RegionLockThe lock object for critical region.

Definition at line 623 of file CGOpenMPRuntime.cpp.

References CreateRuntimeFunction(), EmitOpenMPUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), and GetOpenMPThreadID().

void CGOpenMPRuntime::EmitOMPCriticalRegionStart ( CodeGenFunction CGF,
llvm::Value RegionLock,
SourceLocation  Loc 
) [virtual]

Emits start of the critical region by calling void __kmpc_critical(ident_t *loc, kmp_int32 global_tid, kmp_critical_name RegionLock)

Parameters:
RegionLockThe lock object for critical region.

Definition at line 613 of file CGOpenMPRuntime.cpp.

References CreateRuntimeFunction(), EmitOpenMPUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), and GetOpenMPThreadID().

void CGOpenMPRuntime::EmitOMPNumThreadsClause ( CodeGenFunction CGF,
llvm::Value NumThreads,
SourceLocation  Loc 
) [virtual]

Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads) to generate code for 'num_threads' clause.

Parameters:
NumThreadsAn integer value of threads.

Definition at line 644 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, EmitOpenMPUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), GetOpenMPThreadID(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.

void CGOpenMPRuntime::EmitOMPParallelCall ( CodeGenFunction CGF,
SourceLocation  Loc,
llvm::Value OutlinedFn,
llvm::Value CapturedStruct 
) [virtual]

Emits code for parallel call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct.

Parameters:
OutlinedFnOutlined function to be run in parallel threads. Type of this function is void(*)(kmp_int32, kmp_int32, struct context_vars*).
CapturedStructA pointer to the record with the references to variables used in OutlinedFn function.

Definition at line 521 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, CreateRuntimeFunction(), clang::CodeGen::CodeGenFunction::EmitCastToVoidPtr(), EmitOpenMPUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), and getKmpc_MicroPointerTy().

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

void CGOpenMPRuntime::EmitOMPSerialCall ( CodeGenFunction CGF,
SourceLocation  Loc,
llvm::Value OutlinedFn,
llvm::Value CapturedStruct 
) [virtual]

Emits code for serial call of the OutlinedFn with variables captured in a record which address is stored in CapturedStruct.

Parameters:
OutlinedFnOutlined function to be run in serial mode.
CapturedStructA pointer to the record with the references to variables used in OutlinedFn function.

Definition at line 536 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CreateMemTemp(), CreateRuntimeFunction(), clang::CodeGen::CodeGenFunction::EmitCallOrInvoke(), EmitOpenMPUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), EmitThreadIDAddress(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getIntTypeForBitwidth(), GetOpenMPThreadID(), and clang::CodeGen::CodeGenFunction::InitTempAlloca().

llvm::Function * CGOpenMPRuntime::EmitOMPThreadPrivateVarDefinition ( const VarDecl VD,
llvm::Value VDAddr,
SourceLocation  Loc,
bool  PerformInit,
CodeGenFunction CGF = nullptr 
) [virtual]
void CGOpenMPRuntime::EmitOMPThreadPrivateVarInit ( CodeGenFunction CGF,
llvm::Value VDAddr,
llvm::Value Ctor,
llvm::Value CopyCtor,
llvm::Value Dtor,
SourceLocation  Loc 
)

Emits initialization code for the threadprivate variables.

Parameters:
VDAddrAddress of the global variable VD.
CtorPointer to a global init function for VD.
CopyCtorPointer to a global copy function for VD.
DtorPointer to a global destructor function for VD.
LocLocation of threadprivate declaration.

Definition at line 391 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, CreateRuntimeFunction(), EmitOpenMPUpdateLocation(), and clang::CodeGen::CodeGenFunction::EmitRuntimeCall().

Referenced by EmitOMPThreadPrivateVarDefinition().

llvm::Value * CGOpenMPRuntime::EmitOpenMPOutlinedFunction ( const OMPExecutableDirective D,
const VarDecl ThreadIDVar 
) [read, virtual]
llvm::Value * CGOpenMPRuntime::EmitOpenMPUpdateLocation ( CodeGenFunction CGF,
SourceLocation  Loc,
OpenMPLocationFlags  Flags = OMP_IDENT_KMPC 
)
llvm::Value * CGOpenMPRuntime::EmitThreadIDAddress ( CodeGenFunction CGF,
SourceLocation  Loc 
) [virtual]
void CGOpenMPRuntime::FunctionFinished ( CodeGenFunction CGF)

Cleans up references to the objects in finished function.

Definition at line 238 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::CurFn, and OpenMPLocThreadIDMap.

llvm::Value * CGOpenMPRuntime::GetCriticalRegionLock ( StringRef  CriticalName)

Returns corresponding lock object for the specified critical region name. If the lock object does not exist it is created, otherwise the reference to the existing copy is returned.

Parameters:
CriticalNameName of the critical region.

Definition at line 608 of file CGOpenMPRuntime.cpp.

References GetOrCreateInternalVariable(), and KmpCriticalNameTy.

StructorType clang::CodeGen::getFromCtorType ( CXXCtorType  T) [inline]
StructorType clang::CodeGen::getFromDtorType ( CXXDtorType  T) [inline]
llvm::Type * CGOpenMPRuntime::getIdentTyPointerTy ( )

Returns pointer to ident_t type.

Definition at line 244 of file CGOpenMPRuntime.cpp.

References IdentTy.

llvm::Type * CGOpenMPRuntime::getKmpc_MicroPointerTy ( )

Returns pointer to kmpc_micro type.

Definition at line 248 of file CGOpenMPRuntime.cpp.

References Kmpc_MicroTy.

Referenced by EmitOMPParallelCall().

llvm::Value * CGOpenMPRuntime::getOMPAddrOfThreadPrivate ( CodeGenFunction CGF,
const VarDecl VD,
llvm::Value VDAddr,
SourceLocation  Loc 
) [virtual]

Returns address of the threadprivate variable for the current thread.

Parameters:
VDThreadprivate variable.
VDAddrAddress of the global variable VD.
LocLocation of the reference to threadprivate var.
Returns:
Address of the threadprivate variable for the current thread.

Definition at line 377 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, CreateRuntimeFunction(), EmitOpenMPUpdateLocation(), clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), GetOpenMPThreadID(), and getOrCreateThreadPrivateCache().

llvm::Value * CGOpenMPRuntime::GetOpenMPThreadID ( CodeGenFunction CGF,
SourceLocation  Loc 
)
llvm::Constant * CGOpenMPRuntime::GetOrCreateInternalVariable ( llvm::Type *  Ty,
const llvm::Twine &  Name 
)

Gets (if variable with the given name already exist) or creates internal global variable with the specified Name. The created variable has linkage CommonLinkage by default and is initialized by null value.

Parameters:
TyType of the global variable. If it is exist already the type must be the same.
NameName of the variable.

Definition at line 587 of file CGOpenMPRuntime.cpp.

References InternalVars.

Referenced by GetCriticalRegionLock(), and getOrCreateThreadPrivateCache().

llvm::Constant * CGOpenMPRuntime::getOrCreateThreadPrivateCache ( const VarDecl VD)

If the specified mangled name is not in the module, create and return threadprivate cache object. This object is a pointer's worth of storage that's reserved for use by the OpenMP runtime.

Parameters:
VDThreadprivate variable.
Returns:
Cache variable for the specified threadprivate.

Definition at line 371 of file CGOpenMPRuntime.cpp.

References GetOrCreateInternalVariable().

Referenced by getOMPAddrOfThreadPrivate().

BlockFlags clang::CodeGen::operator| ( BlockLiteralFlags  l,
BlockLiteralFlags  r 
) [inline]

Definition at line 94 of file CGBlocks.h.

BlockFieldFlags clang::CodeGen::operator| ( BlockFieldFlag_t  l,
BlockFieldFlag_t  r 
) [inline]

Definition at line 139 of file CGBlocks.h.

CXXCtorType clang::CodeGen::toCXXCtorType ( StructorType  T) [inline]
CXXDtorType clang::CodeGen::toCXXDtorType ( StructorType  T) [inline]
virtual clang::CodeGen::~CGOpenMPRuntime ( ) [virtual]

Definition at line 234 of file CGOpenMPRuntime.h.


Variable Documentation

llvm::StructType* clang::CodeGen::IdentTy
llvm::StringMap<llvm::AssertingVH<llvm::Constant>, llvm::BumpPtrAllocator> clang::CodeGen::InternalVars

An ordered map of auto-generated variables to their unique names. It stores variables with the following names: 1) ".gomp_critical_user_" + <critical_section_name> + ".var" for "omp critical" directives; 2) <mangled_name_for_global_var> + ".cache." for cache for threadprivate variables.

Definition at line 174 of file CGOpenMPRuntime.h.

Referenced by GetOrCreateInternalVariable().

Definition at line 238 of file CGOpenMPRuntime.h.

llvm::FunctionType* clang::CodeGen::Kmpc_MicroTy

The type for a microtask which gets passed to __kmpc_fork_call(). Original representation is: typedef void (kmpc_micro)(kmp_int32 global_tid, kmp_int32 bound_tid,...);.

Definition at line 155 of file CGOpenMPRuntime.h.

Referenced by CGOpenMPRuntime(), and getKmpc_MicroPointerTy().

Type kmp_critical_name, originally defined as typedef kmp_int32 kmp_critical_name[8];.

Definition at line 167 of file CGOpenMPRuntime.h.

Referenced by CGOpenMPRuntime(), and GetCriticalRegionLock().

Definition at line 151 of file CGOpenMPRuntime.h.

Referenced by EmitOpenMPUpdateLocation().

Set of threadprivate variables with the generated initializer.

Definition at line 220 of file CGOpenMPRuntime.h.

Referenced by EmitOMPThreadPrivateVarDefinition().