14 #ifndef LLVM_CLANG_LIB_CODEGEN_CGBLOCKS_H
15 #define LLVM_CLANG_LIB_CODEGEN_CGBLOCKS_H
28 #include "llvm/IR/Module.h"
78 bool empty()
const {
return flags == 0; }
88 return (l.flags & r.flags);
91 return (flags == r.flags);
122 bool empty()
const {
return flags == 0; }
136 return (l.flags & r.flags);
167 bool isIndex()
const {
return (Data & 1) != 0; }
194 v.Data = (index << 1) | 1;
201 v.Data =
reinterpret_cast<uintptr_t>(value);
260 assert(it !=
Captures.end() &&
"no entry for variable!");
Information about the layout of a __block variable.
CharUnits BlockHeaderForcedGapOffset
Capture & getCapture(const VarDecl *var)
CharUnits getOffset() const
C Language Family Type Representation.
BlockFlags operator|(BlockLiteralFlags l, BlockLiteralFlags r)
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
friend BlockFieldFlags operator|(BlockFieldFlags l, BlockFieldFlags r)
bool operator==(BlockFlags r)
BlockFlags(uint32_t flags)
uint32_t getBitMask() const
VarDecl - An instance of this class is created to represent a variable declaration or definition...
CGBlockInfo(const BlockDecl *blockDecl, StringRef Name)
Defines the clang::Expr interface and subclasses for C++ expressions.
bool HasCapturedVariableLayout
HasCapturedVariableLayout : True if block has captured variables and their layout meta-data has been ...
BlockFlags(BlockByrefFlags flag)
friend bool operator&(BlockFieldFlags l, BlockFieldFlags r)
const Capture & getCapture(const VarDecl *var) const
BlockFieldFlags(BlockFieldFlag_t flag)
CharUnits - This is an opaque type for sizes expressed in character units.
static Capture makeIndex(unsigned index, CharUnits offset)
bool HasCXXObject
HasCXXObject - True if the block's custom copy/dispose functions need to be run even in GC mode...
static Capture makeConstant(llvm::Value *value)
friend BlockFieldFlags & operator|=(BlockFieldFlags &l, BlockFieldFlags r)
StringRef Name
Name - The name of the block, kindof.
bool NeedsCopyDispose
True if the block needs a custom copy or dispose function.
const BlockExpr * BlockExpression
CGBlockInfo - Information to generate a block literal.
bool CanBeGlobal
CanBeGlobal - True if the block can be global, i.e.
BlockFlags(BlockLiteralFlags flag)
CGBlockInfo * NextBlockInfo
The next block in the block-info chain.
bool isSpecialPointer() const
Answers whether the flags indicate that this field is an object or block pointer that requires _Block...
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
unsigned getIndex() const
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
friend BlockFlags operator|(BlockFlags l, BlockFlags r)
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
EHScopeStack::stable_iterator getCleanup() const
bool UsesStret
UsesStret : True if the block uses an stret return.
const TemplateArgument * iterator
A saved depth on the scope stack.
llvm::StructType * StructureType
llvm::DenseMap< const VarDecl *, Capture > Captures
The mapping of allocated indexes within the block.
unsigned CXXThisIndex
The field index of 'this' within the block, if there is one.
const BlockDecl * getBlockDecl() const
llvm::Value * getConstant() const
friend BlockFlags & operator|=(BlockFlags &l, BlockFlags r)
friend bool operator&(BlockFlags l, BlockFlags r)
uint32_t getBitMask() const
const BlockDecl * getBlockDecl() const
CharUnits BlockHeaderForcedGapSize
Defines the clang::TargetInfo interface.
const BlockExpr * getBlockExpr() const
llvm::Instruction * DominatingIP
An instruction which dominates the full-expression that the block is inside.
void setCleanup(EHScopeStack::stable_iterator cleanup)