diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-20 18:43:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-20 18:43:26 +0000 |
commit | 89951a86b594513c2a013532ed45d197413b1087 (patch) | |
tree | 883acd05d33e09e7e1e87cbdf7d029ea5d522f44 /lib/Sema/SemaDeclAttr.cpp | |
parent | 69ab26a8623141f35e86817cfc6e0fbe7639a40f (diff) |
remove some more methods from objc decls, using the iterator
interfaces more consistently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 2ceea33d07..ce38edd7c5 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -67,21 +67,16 @@ static bool hasFunctionProto(Decl *d) { /// arguments. It is an error to call this on a K&R function (use /// hasFunctionProto first). static unsigned getFunctionOrMethodNumArgs(Decl *d) { - if (const FunctionType *FnTy = getFunctionType(d)) { - const FunctionTypeProto *proto = cast<FunctionTypeProto>(FnTy); - return proto->getNumArgs(); - } else { - return cast<ObjCMethodDecl>(d)->getNumParams(); - } + if (const FunctionType *FnTy = getFunctionType(d)) + return cast<FunctionTypeProto>(FnTy)->getNumArgs(); + return cast<ObjCMethodDecl>(d)->param_size(); } static QualType getFunctionOrMethodArgType(Decl *d, unsigned Idx) { - if (const FunctionType *FnTy = getFunctionType(d)) { - const FunctionTypeProto *proto = cast<FunctionTypeProto>(FnTy); - return proto->getArgType(Idx); - } else { - return cast<ObjCMethodDecl>(d)->getParamDecl(Idx)->getType(); - } + if (const FunctionType *FnTy = getFunctionType(d)) + return cast<FunctionTypeProto>(FnTy)->getArgType(Idx); + + return cast<ObjCMethodDecl>(d)->param_begin()[Idx]->getType(); } static bool isFunctionOrMethodVariadic(Decl *d) { |