summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.h')
-rw-r--r--clang/lib/CodeGen/CGBlocks.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.h b/clang/lib/CodeGen/CGBlocks.h
index 3b9cc5053b0..24b0cc9e5b5 100644
--- a/clang/lib/CodeGen/CGBlocks.h
+++ b/clang/lib/CodeGen/CGBlocks.h
@@ -110,6 +110,7 @@ public:
class BlockFunction : public BlockBase {
CodeGenModule &CGM;
+ ASTContext &getContext() const;
public:
const llvm::Type *PtrToInt8Ty;
@@ -160,6 +161,14 @@ public:
llvm::Value *getBlockObjectDispose();
void BuildBlockRelease(const VarDecl &D, llvm::Value *DeclPtr);
+
+ bool BlockRequiresCopying(QualType Ty) {
+ if (Ty->isBlockPointerType())
+ return true;
+ if (getContext().isObjCNSObjectType(Ty))
+ return true;
+ return false;
+ }
};
} // end namespace CodeGen
OpenPOWER on IntegriCloud