aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-10-21 18:23:01 +0000
committerMike Stump <mrs@apple.com>2009-10-21 18:23:01 +0000
commitbf5fd788b0069e6da159ad95e9d0c4315eb266b6 (patch)
tree80c463f301750d505080cdbac82b3295fa2ce81e
parentaf7b44d847d3e44c43346d508b2e55a6254b6e9d (diff)
Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84769 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGBlocks.cpp4
-rw-r--r--lib/CodeGen/CGBlocks.h14
2 files changed, 4 insertions, 14 deletions
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<BlockPointerType>();
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