From: Mike Stump Date: Wed, 21 Oct 2009 18:23:01 +0000 (+0000) Subject: Refactor. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf5fd788b0069e6da159ad95e9d0c4315eb266b6;p=clang Refactor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84769 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 692a7a6bc5..b3bbce66ea 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -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(); diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h index 48807af209..3ab4efb71b 100644 --- a/lib/CodeGen/CGBlocks.h +++ b/lib/CodeGen/CGBlocks.h @@ -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