clang 20.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
clang::CodeGen::CGBlockInfo Class Reference

CGBlockInfo - Information to generate a block literal. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGBlocks.h"

Classes

class  Capture
 

Public Member Functions

void buildCaptureMap ()
 
const CapturegetCapture (const VarDecl *var) const
 
CapturegetCapture (const VarDecl *var)
 
const BlockDeclgetBlockDecl () const
 
const BlockExprgetBlockExpr () const
 
 CGBlockInfo (const BlockDecl *blockDecl, StringRef Name)
 

Public Attributes

StringRef Name
 Name - The name of the block, kindof.
 
unsigned CXXThisIndex
 The field index of 'this' within the block, if there is one.
 
bool CanBeGlobal: 1
 CanBeGlobal - True if the block can be global, i.e.
 
bool NeedsCopyDispose: 1
 True if the block has captures that would necessitate custom copy or dispose helper functions if the block were escaping.
 
bool NoEscape: 1
 Indicates whether the block is non-escaping.
 
bool HasCXXObject: 1
 HasCXXObject - True if the block's custom copy/dispose functions need to be run even in GC mode.
 
bool UsesStret: 1
 UsesStret : True if the block uses an stret return.
 
bool HasCapturedVariableLayout: 1
 HasCapturedVariableLayout : True if block has captured variables and their layout meta-data has been generated.
 
bool CapturesNonExternalType: 1
 Indicates whether an object of a non-external C++ class is captured.
 
llvm::DenseMap< const VarDecl *, Capture * > Captures
 Mapping from variables to pointers to captures in SortedCaptures.
 
llvm::SmallVector< Capture, 4 > SortedCaptures
 The block's captures. Non-constant captures are sorted by their offsets.
 
RawAddress LocalAddress
 
llvm::StructType * StructureType
 
const BlockDeclBlock
 
const BlockExprBlockExpression
 
CharUnits BlockSize
 
CharUnits BlockAlign
 
CharUnits CXXThisOffset
 
CharUnits BlockHeaderForcedGapOffset
 
CharUnits BlockHeaderForcedGapSize
 

Detailed Description

CGBlockInfo - Information to generate a block literal.

Definition at line 156 of file CGBlocks.h.

Constructor & Destructor Documentation

◆ CGBlockInfo()

CGBlockInfo::CGBlockInfo ( const BlockDecl blockDecl,
StringRef  Name 
)

Definition at line 35 of file CGBlocks.cpp.

Member Function Documentation

◆ buildCaptureMap()

void clang::CodeGen::CGBlockInfo::buildCaptureMap ( )
inline

Definition at line 291 of file CGBlocks.h.

References clang::C, Captures, and SortedCaptures.

Referenced by computeBlockInfo().

◆ getBlockDecl()

const BlockDecl * clang::CodeGen::CGBlockInfo::getBlockDecl ( ) const
inline

◆ getBlockExpr()

const BlockExpr * clang::CodeGen::CGBlockInfo::getBlockExpr ( ) const
inline

◆ getCapture() [1/2]

Capture & clang::CodeGen::CGBlockInfo::getCapture ( const VarDecl var)
inline

Definition at line 299 of file CGBlocks.h.

References Captures.

◆ getCapture() [2/2]

const Capture & clang::CodeGen::CGBlockInfo::getCapture ( const VarDecl var) const
inline

Member Data Documentation

◆ Block

const BlockDecl* clang::CodeGen::CGBlockInfo::Block

Definition at line 277 of file CGBlocks.h.

Referenced by getBlockDecl(), and getBlockExpr().

◆ BlockAlign

CharUnits clang::CodeGen::CGBlockInfo::BlockAlign

◆ BlockExpression

const BlockExpr* clang::CodeGen::CGBlockInfo::BlockExpression

◆ BlockHeaderForcedGapOffset

CharUnits clang::CodeGen::CGBlockInfo::BlockHeaderForcedGapOffset

Definition at line 286 of file CGBlocks.h.

Referenced by computeBlockInfo().

◆ BlockHeaderForcedGapSize

CharUnits clang::CodeGen::CGBlockInfo::BlockHeaderForcedGapSize

Definition at line 289 of file CGBlocks.h.

Referenced by computeBlockInfo().

◆ BlockSize

CharUnits clang::CodeGen::CGBlockInfo::BlockSize

◆ CanBeGlobal

bool clang::CodeGen::CGBlockInfo::CanBeGlobal

CanBeGlobal - True if the block can be global, i.e.

it has no non-constant captures.

Definition at line 242 of file CGBlocks.h.

Referenced by buildGlobalBlock(), and computeBlockInfo().

◆ Captures

llvm::DenseMap<const VarDecl *, Capture *> clang::CodeGen::CGBlockInfo::Captures

Mapping from variables to pointers to captures in SortedCaptures.

Definition at line 269 of file CGBlocks.h.

Referenced by buildCaptureMap(), and getCapture().

◆ CapturesNonExternalType

bool clang::CodeGen::CGBlockInfo::CapturesNonExternalType

Indicates whether an object of a non-external C++ class is captured.

This bit is used to determine the linkage of the block copy/destroy helper functions.

Definition at line 266 of file CGBlocks.h.

Referenced by computeBlockInfo().

◆ CXXThisIndex

unsigned clang::CodeGen::CGBlockInfo::CXXThisIndex

The field index of 'this' within the block, if there is one.

Definition at line 162 of file CGBlocks.h.

Referenced by clang::CodeGen::CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable().

◆ CXXThisOffset

CharUnits clang::CodeGen::CGBlockInfo::CXXThisOffset

Definition at line 281 of file CGBlocks.h.

◆ HasCapturedVariableLayout

bool clang::CodeGen::CGBlockInfo::HasCapturedVariableLayout

HasCapturedVariableLayout : True if block has captured variables and their layout meta-data has been generated.

Definition at line 261 of file CGBlocks.h.

Referenced by computeBlockInfo().

◆ HasCXXObject

bool clang::CodeGen::CGBlockInfo::HasCXXObject

HasCXXObject - True if the block's custom copy/dispose functions need to be run even in GC mode.

Definition at line 253 of file CGBlocks.h.

Referenced by computeBlockInfo().

◆ LocalAddress

RawAddress clang::CodeGen::CGBlockInfo::LocalAddress

Definition at line 275 of file CGBlocks.h.

◆ Name

StringRef clang::CodeGen::CGBlockInfo::Name

Name - The name of the block, kindof.

Definition at line 159 of file CGBlocks.h.

◆ NeedsCopyDispose

bool clang::CodeGen::CGBlockInfo::NeedsCopyDispose

True if the block has captures that would necessitate custom copy or dispose helper functions if the block were escaping.

Definition at line 246 of file CGBlocks.h.

Referenced by addBlockLayout(), buildBlockDescriptor(), and getBlockDescriptorName().

◆ NoEscape

bool clang::CodeGen::CGBlockInfo::NoEscape

Indicates whether the block is non-escaping.

Definition at line 249 of file CGBlocks.h.

Referenced by addBlockLayout(), and computeBlockInfo().

◆ SortedCaptures

llvm::SmallVector<Capture, 4> clang::CodeGen::CGBlockInfo::SortedCaptures

The block's captures. Non-constant captures are sorted by their offsets.

Definition at line 272 of file CGBlocks.h.

Referenced by buildCaptureMap(), computeBlockInfo(), and getBlockDescriptorName().

◆ StructureType

llvm::StructType* clang::CodeGen::CGBlockInfo::StructureType

◆ UsesStret

bool clang::CodeGen::CGBlockInfo::UsesStret
mutable

UsesStret : True if the block uses an stret return.

Mutable because it gets set later in the block-creation process.

Definition at line 257 of file CGBlocks.h.

Referenced by buildGlobalBlock().


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