13#ifndef LLVM_CLANG_LIB_CODEGEN_CGBLOCKS_H
14#define LLVM_CLANG_LIB_CODEGEN_CGBLOCKS_H
67 bool empty()
const {
return flags == 0; }
77 return (l.flags & r.flags);
80 return (flags == r.flags);
102class BlockFieldFlags {
111 bool empty()
const {
return flags == 0; }
117 friend BlockFieldFlags
operator|(BlockFieldFlags l, BlockFieldFlags r) {
120 friend BlockFieldFlags &
operator|=(BlockFieldFlags &l, BlockFieldFlags r) {
124 friend bool operator&(BlockFieldFlags l, BlockFieldFlags r) {
125 return (l.flags & r.flags);
128 return flags ==
Other.flags;
176 bool isIndex()
const {
return (Data & 1) != 0; }
198 return reinterpret_cast<llvm::Value*
>(Data);
211 v.Data = (
index << 1) | 1;
213 v.FieldType = FieldType;
225 v.Data =
reinterpret_cast<uintptr_t>(value);
270 llvm::DenseMap<const VarDecl *, Capture *>
Captures;
302 assert(it !=
Captures.end() &&
"no entry for variable!");
Defines the clang::Expr interface and subclasses for C++ expressions.
C Language Family Type Representation.
A class which contains all the information about a particular captured value.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
Get the raw integer representation of this quantity.
static constexpr CharUnits fromQuantity(QuantityType Quantity)
Construct a CharUnits quantity from a raw integer type.
Information about the layout of a __block variable.
friend BlockFieldFlags & operator|=(BlockFieldFlags &l, BlockFieldFlags r)
uint32_t getBitMask() const
bool operator==(BlockFieldFlags Other) const
BlockFieldFlags(BlockFieldFlag_t flag)
friend bool operator&(BlockFieldFlags l, BlockFieldFlags r)
bool isSpecialPointer() const
Answers whether the flags indicate that this field is an object or block pointer that requires _Block...
friend BlockFieldFlags operator|(BlockFieldFlags l, BlockFieldFlags r)
friend BlockFlags & operator|=(BlockFlags &l, BlockFlags r)
friend BlockFlags operator|(BlockFlags l, BlockFlags r)
friend bool operator&(BlockFlags l, BlockFlags r)
BlockFlags(BlockLiteralFlags flag)
BlockFlags(BlockByrefFlags flag)
bool operator==(BlockFlags r)
BlockFlags(uint32_t flags)
uint32_t getBitMask() const
const BlockDecl::Capture * Cap
BlockFieldFlags DisposeFlags
static Capture makeIndex(unsigned index, CharUnits offset, QualType FieldType, BlockCaptureEntityKind CopyKind, BlockFieldFlags CopyFlags, BlockCaptureEntityKind DisposeKind, BlockFieldFlags DisposeFlags, const BlockDecl::Capture *Cap)
BlockCaptureEntityKind CopyKind
bool isConstantOrTrivial() const
QualType fieldType() const
EHScopeStack::stable_iterator getCleanup() const
BlockFieldFlags CopyFlags
BlockCaptureEntityKind DisposeKind
llvm::Value * getConstant() const
unsigned getIndex() const
void setCleanup(EHScopeStack::stable_iterator cleanup)
static Capture makeConstant(llvm::Value *value, const BlockDecl::Capture *Cap)
CharUnits getOffset() const
CGBlockInfo - Information to generate a block literal.
CGBlockInfo(const BlockDecl *blockDecl, StringRef Name)
StringRef Name
Name - The name of the block, kindof.
llvm::DenseMap< const VarDecl *, Capture * > Captures
Mapping from variables to pointers to captures in SortedCaptures.
unsigned CXXThisIndex
The field index of 'this' within the block, if there is one.
const BlockDecl * getBlockDecl() const
llvm::StructType * StructureType
CharUnits BlockHeaderForcedGapOffset
bool UsesStret
UsesStret : True if the block uses an stret return.
const BlockExpr * BlockExpression
const BlockExpr * getBlockExpr() const
bool HasCapturedVariableLayout
HasCapturedVariableLayout : True if block has captured variables and their layout meta-data has been ...
bool CapturesNonExternalType
Indicates whether an object of a non-external C++ class is captured.
bool NeedsCopyDispose
True if the block has captures that would necessitate custom copy or dispose helper functions if the ...
bool CanBeGlobal
CanBeGlobal - True if the block can be global, i.e.
bool HasCXXObject
HasCXXObject - True if the block's custom copy/dispose functions need to be run even in GC mode.
CharUnits BlockHeaderForcedGapSize
Capture & getCapture(const VarDecl *var)
const Capture & getCapture(const VarDecl *var) const
llvm::SmallVector< Capture, 4 > SortedCaptures
The block's captures. Non-constant captures are sorted by their offsets.
bool NoEscape
Indicates whether the block is non-escaping.
A saved depth on the scope stack.
An abstract representation of an aligned address.
A (possibly-)qualified type.
Represents a variable declaration or definition.
Defines the clang::TargetInfo interface.
@ BLOCK_HAS_EXTENDED_LAYOUT
@ BLOCK_BYREF_CURRENT_MAX
@ BLOCK_BYREF_LAYOUT_MASK
@ BLOCK_BYREF_LAYOUT_WEAK
@ BLOCK_BYREF_LAYOUT_STRONG
@ BLOCK_BYREF_LAYOUT_EXTENDED
@ BLOCK_BYREF_LAYOUT_NON_OBJECT
@ BLOCK_BYREF_HAS_COPY_DISPOSE
@ BLOCK_BYREF_LAYOUT_UNRETAINED
BlockCaptureEntityKind
Represents a type of copy/destroy operation that should be performed for an entity that's captured by...
@ AddressDiscriminatedPointerAuth
BlockFlags operator|(BlockLiteralFlags l, BlockLiteralFlags r)
const internal::VariadicDynCastAllOfMatcher< Decl, BlockDecl > blockDecl
Matches block declarations.
Top level wrappers for InstallAPI frontend operations.
Diagnostic wrappers for TextAPI types for error reporting.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...