]> granicus.if.org Git - clang/commitdiff
Fixes a regression caused by implementing cstyle methods
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 9 Apr 2010 15:40:42 +0000 (15:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 9 Apr 2010 15:40:42 +0000 (15:40 +0000)
for objc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100865 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
lib/AST/ASTImporter.cpp
lib/Frontend/PCHReaderDecl.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaObjCProperty.cpp

index 388e9acb9196b74d20cf6c4d35497ed0a52d6a74..991330466a52d52dd505039a04cb0886f7abb494 100644 (file)
@@ -252,8 +252,10 @@ public:
     return ParamInfo.begin() + NumSelectorArgs; 
   }
 
-  void setMethodParams(ASTContext &C, ParmVarDecl *const *List, unsigned Num) {
+  void setMethodParams(ASTContext &C, ParmVarDecl *const *List, unsigned Num,
+                       unsigned numSelectorArgs) {
     ParamInfo.set(List, Num, C);
+    NumSelectorArgs = numSelectorArgs; 
   }
 
   // Iterator access to parameter types.
index 5dfb99ff088935a0c15af70a8dbfee831725b005..b13e7f91fc6e0fd03940b2abaa3438a63ea225c1 100644 (file)
@@ -2312,7 +2312,8 @@ Decl *ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) {
     ToMethod->addDecl(ToParams[I]);
   }
   ToMethod->setMethodParams(Importer.getToContext(), 
-                            ToParams.data(), ToParams.size());
+                            ToParams.data(), ToParams.size(),
+                            ToParams.size());
 
   ToMethod->setLexicalDeclContext(LexicalDC);
   Importer.Imported(D, ToMethod);
index 7f80760fbfd42814ab44033da03df72ac4b70736..8a11f11a6c4564df86c10f0955db14163bdd9c17 100644 (file)
@@ -221,7 +221,8 @@ void PCHDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) {
   Params.reserve(NumParams);
   for (unsigned I = 0; I != NumParams; ++I)
     Params.push_back(cast<ParmVarDecl>(Reader.GetDecl(Record[Idx++])));
-  MD->setMethodParams(*Reader.getContext(), Params.data(), NumParams);
+  MD->setMethodParams(*Reader.getContext(), Params.data(), NumParams,
+                      NumParams);
 }
 
 void PCHDeclReader::VisitObjCContainerDecl(ObjCContainerDecl *CD) {
index defda7d5dbf6ee2ef19cf8fae930703f377a365f..7e5e40c56262899572473230b2e075e9a5e43287 100644 (file)
@@ -1587,8 +1587,8 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration(
     Params.push_back(Param);
   }
   
-  ObjCMethod->setMethodParams(Context, Params.data(), Params.size());
-  ObjCMethod->setNumSelectorArgs(Sel.getNumArgs());
+  ObjCMethod->setMethodParams(Context, Params.data(), Params.size(),
+                              Sel.getNumArgs());
   ObjCMethod->setObjCDeclQualifier(
     CvtQTToAstBitMask(ReturnQT.getObjCDeclQualifier()));
   const ObjCMethodDecl *PrevMethod = 0;
index d5174a827e8c46bc36156d35803524a3656df265..3bf34665be45aecea365ae4e8431d44bc14ef219 100644 (file)
@@ -954,7 +954,7 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property,
                                                   /*TInfo=*/0,
                                                   VarDecl::None,
                                                   0);
-      SetterMethod->setMethodParams(Context, &Argument, 1);
+      SetterMethod->setMethodParams(Context, &Argument, 1, 1);
       CD->addDecl(SetterMethod);
     } else
       // A user declared setter will be synthesize when @synthesize of