]> granicus.if.org Git - clang/commitdiff
Removed superfluous code.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 15 May 2009 23:19:35 +0000 (23:19 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 15 May 2009 23:19:35 +0000 (23:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71909 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp

index 5154c66c6cba60c3288ab14eb3891755c55c04f1..1c2d37322cba2550b41a81b0f65099654772fe12 100644 (file)
@@ -85,17 +85,6 @@ static bool hasFunctionProto(Decl *d) {
 static unsigned getFunctionOrMethodNumArgs(Decl *d) {
   if (const FunctionType *FnTy = getFunctionType(d))
     return cast<FunctionProtoType>(FnTy)->getNumArgs();
-  else if (VarDecl *V = dyn_cast<VarDecl>(d)) {
-    QualType Ty = V->getType(); 
-    if (Ty->isBlockPointerType()) {
-      const FunctionType *FT = 
-        Ty->getAsBlockPointerType()->getPointeeType()->getAsFunctionType();
-      if (const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FT))
-        return Proto->getNumArgs();
-      
-    }
-    assert(false && "getFunctionOrMethodNumArgs - caused by block mishap");
-  }
   return cast<ObjCMethodDecl>(d)->param_size();
 }