summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-04-06 18:05:26 +0000
committerAnders Carlsson <andersca@mac.com>2009-04-06 18:05:26 +0000
commit6f811f149b5c3a85cd6b1ce8e657573f2f79148f (patch)
tree2c7d6e40478cd915e6662f6ddc228c3eb0a3db0d /clang
parent2266e244b59045616a48013fe0282b275586072e (diff)
downloadbcm5719-llvm-6f811f149b5c3a85cd6b1ce8e657573f2f79148f.tar.gz
bcm5719-llvm-6f811f149b5c3a85cd6b1ce8e657573f2f79148f.zip
Add a getFunctionInfo that takes a BlockPointerType.
llvm-svn: 68452
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp13
-rw-r--r--clang/lib/CodeGen/CodeGenTypes.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index e3f824fc742..43db767158e 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -53,6 +53,19 @@ CGFunctionInfo &CodeGenTypes::getFunctionInfo(const FunctionProtoType *FTP) {
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.
diff --git a/clang/lib/CodeGen/CodeGenTypes.h b/clang/lib/CodeGen/CodeGenTypes.h
index 33417e5f01b..b09531f5ca3 100644
--- a/clang/lib/CodeGen/CodeGenTypes.h
+++ b/clang/lib/CodeGen/CodeGenTypes.h
@@ -172,11 +172,14 @@ public:
const CGFunctionInfo &getFunctionInfo(const FunctionNoProtoType *FTNP);
const CGFunctionInfo &getFunctionInfo(const FunctionProtoType *FTP);
+ const CGFunctionInfo &getFunctionInfo(const BlockPointerType *BPT);
const CGFunctionInfo &getFunctionInfo(const FunctionDecl *FD);
const CGFunctionInfo &getFunctionInfo(const CXXMethodDecl *MD);
const CGFunctionInfo &getFunctionInfo(const ObjCMethodDecl *MD);
+//private:
const CGFunctionInfo &getFunctionInfo(QualType ResTy,
const CallArgList &Args);
+public:
const CGFunctionInfo &getFunctionInfo(QualType ResTy,
const FunctionArgList &Args);
OpenPOWER on IntegriCloud