summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-20 18:43:26 +0000
committerChris Lattner <sabre@nondot.org>2009-02-20 18:43:26 +0000
commita499715c83601ae105c317c1858fd91657d5e191 (patch)
tree537c35b979893da1ee759723efff12b99366f7e6 /clang/lib/Sema/SemaDeclObjC.cpp
parent87d5ca083b8b8b684d98f897a2157ac00087ef75 (diff)
downloadbcm5719-llvm-a499715c83601ae105c317c1858fd91657d5e191.tar.gz
bcm5719-llvm-a499715c83601ae105c317c1858fd91657d5e191.zip
remove some more methods from objc decls, using the iterator
interfaces more consistently. llvm-svn: 65138
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index b8906377671..65cd4b4e548 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -46,11 +46,10 @@ void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
PushOnScopeChains(MDecl->getCmdDecl(), FnBodyScope);
// Introduce all of the other parameters into this scope.
- for (unsigned i = 0, e = MDecl->getNumParams(); i != e; ++i) {
- ParmVarDecl *PDecl = MDecl->getParamDecl(i);
- if (PDecl->getIdentifier())
- PushOnScopeChains(PDecl, FnBodyScope);
- }
+ for (ObjCMethodDecl::param_iterator PI = MDecl->param_begin(),
+ E = MDecl->param_end(); PI != E; ++PI)
+ if ((*PI)->getIdentifier())
+ PushOnScopeChains(*PI, FnBodyScope);
}
Sema::DeclTy *Sema::
@@ -992,9 +991,15 @@ bool Sema::MatchTwoMethodDeclarations(const ObjCMethodDecl *Method,
if (Context.getTypeInfo(T1) != Context.getTypeInfo(T2))
return false;
}
- for (unsigned i = 0, e = Method->getNumParams(); i != e; ++i) {
- T1 = Context.getCanonicalType(Method->getParamDecl(i)->getType());
- T2 = Context.getCanonicalType(PrevMethod->getParamDecl(i)->getType());
+
+ ObjCMethodDecl::param_iterator ParamI = Method->param_begin(),
+ E = Method->param_end();
+ ObjCMethodDecl::param_iterator PrevI = PrevMethod->param_begin();
+
+ for (; ParamI != E; ++ParamI, ++PrevI) {
+ assert(PrevI != PrevMethod->param_end() && "Param mismatch");
+ T1 = Context.getCanonicalType((*ParamI)->getType());
+ T2 = Context.getCanonicalType((*PrevI)->getType());
if (T1 != T2) {
// The result types are different.
if (!matchBasedOnSizeAndAlignment)
@@ -1103,8 +1108,8 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property,
if (Context.getCanonicalType(SetterMethod->getResultType())
!= Context.VoidTy)
Diag(SetterMethod->getLocation(), diag::err_setter_type_void);
- if (SetterMethod->getNumParams() != 1 ||
- (SetterMethod->getParamDecl(0)->getType() != property->getType())) {
+ if (SetterMethod->param_size() != 1 ||
+ ((*SetterMethod->param_begin())->getType() != property->getType())) {
Diag(property->getLocation(),
diag::err_accessor_property_type_mismatch)
<< property->getDeclName()
OpenPOWER on IntegriCloud