]> granicus.if.org Git - clang/commitdiff
Make sure RewriteObjCMethodDecl() does a block pointer rewrite.
authorSteve Naroff <snaroff@apple.com>
Thu, 30 Oct 2008 14:45:29 +0000 (14:45 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 30 Oct 2008 14:45:29 +0000 (14:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58430 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index b5efd4fac07bbfeb6f4ab505d7dc7524ad75c848..39f4f15ae9b1ec79b1bc983800e5b70ef6eee03a 100644 (file)
@@ -794,7 +794,12 @@ void RewriteObjC::RewriteObjCMethodDecl(ObjCMethodDecl *OMD,
       ResultStr += PDecl->getName();
     } else {
       std::string Name = PDecl->getName();
-      PDecl->getType().getAsStringInternal(Name);
+      if (isBlockPointerType(PDecl->getType())) {
+        // Make sure we convert "t (^)(...)" to "t (*)(...)".
+        const BlockPointerType *BPT = PDecl->getType()->getAsBlockPointerType();
+        Context->getPointerType(BPT->getPointeeType()).getAsStringInternal(Name);
+      } else
+        PDecl->getType().getAsStringInternal(Name);
       ResultStr += Name;
     }
   }