Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84769 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h
index 48807af..3ab4efb 100644
--- a/lib/CodeGen/CGBlocks.h
+++ b/lib/CodeGen/CGBlocks.h
@@ -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