aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.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
commit89951a86b594513c2a013532ed45d197413b1087 (patch)
tree883acd05d33e09e7e1e87cbdf7d029ea5d522f44 /lib/Sema/SemaType.cpp
parent69ab26a8623141f35e86817cfc6e0fbe7639a40f (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/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 02ba807758..252cd2d533 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -662,7 +662,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip) {
/// ObjCGetTypeForMethodDefinition - Builds the type for a method definition
/// declarator
QualType Sema::ObjCGetTypeForMethodDefinition(DeclTy *D) {
- ObjCMethodDecl *MDecl = dyn_cast<ObjCMethodDecl>(static_cast<Decl *>(D));
+ ObjCMethodDecl *MDecl = cast<ObjCMethodDecl>(static_cast<Decl *>(D));
QualType T = MDecl->getResultType();
llvm::SmallVector<QualType, 16> ArgTys;
@@ -671,14 +671,13 @@ QualType Sema::ObjCGetTypeForMethodDefinition(DeclTy *D) {
QualType selfTy = Context.getObjCInterfaceType(MDecl->getClassInterface());
selfTy = Context.getPointerType(selfTy);
ArgTys.push_back(selfTy);
- }
- else
+ } else
ArgTys.push_back(Context.getObjCIdType());
ArgTys.push_back(Context.getObjCSelType());
- for (int i = 0, e = MDecl->getNumParams(); i != e; ++i) {
- ParmVarDecl *PDecl = MDecl->getParamDecl(i);
- QualType ArgTy = PDecl->getType();
+ for (ObjCMethodDecl::param_iterator PI = MDecl->param_begin(),
+ E = MDecl->param_end(); PI != E; ++PI) {
+ QualType ArgTy = (*PI)->getType();
assert(!ArgTy.isNull() && "Couldn't parse type?");
// Perform the default function/array conversion (C99 6.7.5.3p[7,8]).
// This matches the conversion that is done in