summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-05-18 17:39:25 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-05-18 17:39:25 +0000
commit28c433dcdaffb5f4129c6decc37757cf0b1a6c00 (patch)
treeba60852c75deb6862fcff4b303938fecd967c4e2 /clang/lib/Sema
parent70f924df8a8184161b130ba73049295831687e18 (diff)
downloadbcm5719-llvm-28c433dcdaffb5f4129c6decc37757cf0b1a6c00.tar.gz
bcm5719-llvm-28c433dcdaffb5f4129c6decc37757cf0b1a6c00.zip
Minor tweak to support format attribute on blocks. No change in functionality.
llvm-svn: 72020
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 1cdca22242b..2c2e4d3c0f1 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -24,7 +24,7 @@ using namespace clang;
// Helper functions
//===----------------------------------------------------------------------===//
-static const FunctionType *getFunctionType(Decl *d) {
+static const FunctionType *getFunctionType(Decl *d, bool blocksToo = true) {
QualType Ty;
if (ValueDecl *decl = dyn_cast<ValueDecl>(d))
Ty = decl->getType();
@@ -37,7 +37,7 @@ static const FunctionType *getFunctionType(Decl *d) {
if (Ty->isFunctionPointerType())
Ty = Ty->getAsPointerType()->getPointeeType();
- else if (Ty->isBlockPointerType())
+ else if (blocksToo && Ty->isBlockPointerType())
Ty = Ty->getAsBlockPointerType()->getPointeeType();
return Ty->getAsFunctionType();
@@ -50,7 +50,7 @@ static const FunctionType *getFunctionType(Decl *d) {
/// type (function or function-typed variable) or an Objective-C
/// method.
static bool isFunctionOrMethod(Decl *d) {
- return getFunctionType(d) || isa<ObjCMethodDecl>(d);
+ return getFunctionType(d, false) || isa<ObjCMethodDecl>(d);
}
/// isFunctionOrMethodOrBlock - Return true if the given decl has function
OpenPOWER on IntegriCloud