[cfe-commits] r84769 - in /cfe/trunk/lib/CodeGen: CGBlocks.cpp CGBlocks.h

Mike Stump mrs at apple.com
Wed Oct 21 11:23:01 PDT 2009


Author: mrs
Date: Wed Oct 21 13:23:01 2009
New Revision: 84769

URL: http://llvm.org/viewvc/llvm-project?rev=84769&view=rev
Log:
Refactor.

Modified:
    cfe/trunk/lib/CodeGen/CGBlocks.cpp
    cfe/trunk/lib/CodeGen/CGBlocks.h

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=84769&r1=84768&r2=84769&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Wed Oct 21 13:23:01 2009
@@ -418,10 +418,6 @@
   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>();

Modified: cfe/trunk/lib/CodeGen/CGBlocks.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.h?rev=84769&r1=84768&r2=84769&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.h (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.h Wed Oct 21 13:23:01 2009
@@ -115,15 +115,8 @@
     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 @@
   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





More information about the cfe-commits mailing list