Add a getFunctionInfo that takes a BlockPointerType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68452 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index e3f824f..43db767 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -53,6 +53,19 @@
return getFunctionInfo(FTP->getResultType(), ArgTys);
}
+const
+CGFunctionInfo &CodeGenTypes::getFunctionInfo(const BlockPointerType *BPT) {
+ llvm::SmallVector<QualType, 16> ArgTys;
+ const FunctionProtoType *FTP =
+ BPT->getPointeeType()->getAsFunctionProtoType();
+
+ // Add the block pointer.
+ ArgTys.push_back(Context.getPointerType(Context.VoidTy));
+ for (unsigned i = 0, e = FTP->getNumArgs(); i != e; ++i)
+ ArgTys.push_back(FTP->getArgType(i));
+ return getFunctionInfo(FTP->getResultType(), ArgTys);
+}
+
const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) {
llvm::SmallVector<QualType, 16> ArgTys;
// Add the 'this' pointer.