diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-11 18:01:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-11 18:01:59 +0000 |
commit | 5272b7f6ac343bbfc1638ed414fe474d763b3f88 (patch) | |
tree | df238f494d4e505e92d0aae7025b9819e6ef4c32 | |
parent | 140fb26e747a1ba728287f02d585d0bb65d5d0da (diff) |
simplify this code to not bother stripping to canonical types, and
indent code properly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68866 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 74a0316431..a73b440577 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -764,25 +764,22 @@ void Sema::WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method, void Sema::WarnConflictingTypedMethods(ObjCMethodDecl *ImpMethodDecl, ObjCMethodDecl *IntfMethodDecl) { bool err = false; - QualType ImpMethodQType = - Context.getCanonicalType(ImpMethodDecl->getResultType()); - QualType IntfMethodQType = - Context.getCanonicalType(IntfMethodDecl->getResultType()); - if (!Context.typesAreCompatible(IntfMethodQType, ImpMethodQType)) + if (!Context.typesAreCompatible(IntfMethodDecl->getResultType(), + ImpMethodDecl->getResultType())) err = true; - else for (ObjCMethodDecl::param_iterator IM=ImpMethodDecl->param_begin(), - IF=IntfMethodDecl->param_begin(), - EM=ImpMethodDecl->param_end(); IM!=EM; ++IM, IF++) { - ImpMethodQType = Context.getCanonicalType((*IM)->getType()); - IntfMethodQType = Context.getCanonicalType((*IF)->getType()); - if (!Context.typesAreCompatible(IntfMethodQType, ImpMethodQType)) { - err = true; - break; + else + for (ObjCMethodDecl::param_iterator IM=ImpMethodDecl->param_begin(), + IF = IntfMethodDecl->param_begin(), EM = ImpMethodDecl->param_end(); + IM != EM; ++IM, ++IF) { + if (!Context.typesAreCompatible((*IF)->getType(), (*IM)->getType())) { + err = true; + break; + } } - } + if (err) { Diag(ImpMethodDecl->getLocation(), diag::warn_conflicting_types) - << ImpMethodDecl->getDeclName(); + << ImpMethodDecl->getDeclName(); Diag(IntfMethodDecl->getLocation(), diag::note_previous_definition); } } |