]> granicus.if.org Git - clang/commitdiff
Fix <rdar://problem/5874697> Rewriter: method arguments with complex types not being...
authorSteve Naroff <snaroff@apple.com>
Fri, 18 Apr 2008 21:13:19 +0000 (21:13 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 18 Apr 2008 21:13:19 +0000 (21:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49925 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index ebab81fb734c7655397d13174660ea7fec15c927..f66658864b398d19a68572d037876a8b88ba828f 100644 (file)
@@ -720,12 +720,14 @@ void RewriteObjC::RewriteObjCMethodDecl(ObjCMethodDecl *OMD,
   for (unsigned i = 0; i < OMD->getNumParams(); i++) {
     ParmVarDecl *PDecl = OMD->getParamDecl(i);
     ResultStr += ", ";
-    if (PDecl->getType()->isObjCQualifiedIdType())
-      ResultStr += "id";
-    else
-      ResultStr += PDecl->getType().getAsString();
-    ResultStr += " ";
-    ResultStr += PDecl->getName();
+    if (PDecl->getType()->isObjCQualifiedIdType()) {
+      ResultStr += "id ";
+      ResultStr += PDecl->getName();
+    } else {
+      std::string Name = PDecl->getName();
+      PDecl->getType().getAsStringInternal(Name);
+      ResultStr += Name;
+    }
   }
   if (OMD->isVariadic())
     ResultStr += ", ...";