[cfe-commits] r72020 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Fariborz Jahanian fjahanian at apple.com
Mon May 18 10:39:26 PDT 2009


Author: fjahanian
Date: Mon May 18 12:39:25 2009
New Revision: 72020

URL: http://llvm.org/viewvc/llvm-project?rev=72020&view=rev
Log:
Minor tweak to support format attribute on blocks. No change in functionality.

Modified:
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=72020&r1=72019&r2=72020&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon May 18 12:39:25 2009
@@ -24,7 +24,7 @@
 //  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 @@
   
   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 @@
 /// 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





More information about the cfe-commits mailing list