]> granicus.if.org Git - clang/commitdiff
Refactor.
authorMike Stump <mrs@apple.com>
Wed, 21 Oct 2009 18:23:01 +0000 (18:23 +0000)
committerMike Stump <mrs@apple.com>
Wed, 21 Oct 2009 18:23:01 +0000 (18:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84769 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGBlocks.h

index 692a7a6bc5794d25d2ac1559f74d33ba618fe3d9..b3bbce66ea3890af5ec8852316741f0044bdbea2 100644 (file)
@@ -418,10 +418,6 @@ const llvm::Type *BlockModule::getGenericExtendedBlockLiteralType() {
   return GenericExtendedBlockLiteralType;
 }
 
-bool BlockFunction::BlockRequiresCopying(QualType Ty) {
-  return CGM.BlockRequiresCopying(Ty);
-}
-
 RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr* E) {
   const BlockPointerType *BPT =
     E->getCallee()->getType()->getAs<BlockPointerType>();
index 48807af2094bf66635e173bfc9b248fa0ab0bdc3..3ab4efb71bee94cf05d0e0a70d254a81b1da7759 100644 (file)
@@ -115,15 +115,8 @@ public:
     PtrToInt8Ty = llvm::Type::getInt8PtrTy(M.getContext());
   }
 
-  bool BlockRequiresCopying(QualType Ty) {
-    if (Ty->isBlockPointerType())
-      return true;
-    if (getContext().isObjCNSObjectType(Ty))
-      return true;
-    if (Ty->isObjCObjectPointerType())
-      return true;
-    return false;
-  }
+  bool BlockRequiresCopying(QualType Ty)
+    { return getContext().BlockRequiresCopying(Ty); }
 };
 
 class BlockFunction : public BlockBase {
@@ -224,7 +217,8 @@ public:
   llvm::Value *getBlockObjectDispose();
   void BuildBlockRelease(llvm::Value *DeclPtr, int flag = BLOCK_FIELD_IS_BYREF);
 
-  bool BlockRequiresCopying(QualType Ty);
+  bool BlockRequiresCopying(QualType Ty)
+    { return getContext().BlockRequiresCopying(Ty); }
 };
 
 }  // end namespace CodeGen