diff options
Diffstat (limited to 'lib/CodeGen/CGBlocks.h')
-rw-r--r-- | lib/CodeGen/CGBlocks.h | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h index f85701a..020638a 100644 --- a/lib/CodeGen/CGBlocks.h +++ b/lib/CodeGen/CGBlocks.h @@ -14,19 +14,18 @@ #ifndef CLANG_CODEGEN_CGBLOCKS_H #define CLANG_CODEGEN_CGBLOCKS_H +#include "CGBuilder.h" +#include "CGCall.h" +#include "CGValue.h" +#include "CodeGenFunction.h" #include "CodeGenTypes.h" -#include "clang/AST/Type.h" -#include "llvm/Module.h" -#include "clang/Basic/TargetInfo.h" #include "clang/AST/CharUnits.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" - -#include "CodeGenFunction.h" -#include "CGBuilder.h" -#include "CGCall.h" -#include "CGValue.h" +#include "clang/AST/Type.h" +#include "clang/Basic/TargetInfo.h" +#include "llvm/IR/Module.h" namespace llvm { class Module; @@ -69,11 +68,12 @@ enum BlockLiteralFlags { class BlockFlags { uint32_t flags; - BlockFlags(uint32_t flags) : flags(flags) {} public: + BlockFlags(uint32_t flags) : flags(flags) {} BlockFlags() : flags(0) {} BlockFlags(BlockLiteralFlags flag) : flags(flag) {} - + BlockFlags(BlockByrefFlags flag) : flags(flag) {} + uint32_t getBitMask() const { return flags; } bool empty() const { return flags == 0; } @@ -87,6 +87,9 @@ public: friend bool operator&(BlockFlags l, BlockFlags r) { return (l.flags & r.flags); } + bool operator==(BlockFlags r) { + return (flags == r.flags); + } }; inline BlockFlags operator|(BlockLiteralFlags l, BlockLiteralFlags r) { return BlockFlags(l) | BlockFlags(r); @@ -141,7 +144,7 @@ inline BlockFieldFlags operator|(BlockFieldFlag_t l, BlockFieldFlag_t r) { class CGBlockInfo { public: /// Name - The name of the block, kindof. - llvm::StringRef Name; + StringRef Name; /// The field index of 'this' within the block, if there is one. unsigned CXXThisIndex; @@ -208,6 +211,14 @@ public: const BlockExpr *BlockExpression; CharUnits BlockSize; CharUnits BlockAlign; + + // Offset of the gap caused by block header having a smaller + // alignment than the alignment of the block descriptor. This + // is the gap offset before the first capturued field. + CharUnits BlockHeaderForcedGapOffset; + // Gap size caused by aligning first field after block header. + // This could be zero if no forced alignment is required. + CharUnits BlockHeaderForcedGapSize; /// An instruction which dominates the full-expression that the /// block is inside. @@ -236,7 +247,7 @@ public: return BlockExpression; } - CGBlockInfo(const BlockDecl *blockDecl, llvm::StringRef Name); + CGBlockInfo(const BlockDecl *blockDecl, StringRef Name); }; } // end namespace CodeGen |