From: Chris Lattner Date: Sat, 11 Apr 2009 18:01:59 +0000 (+0000) Subject: simplify this code to not bother stripping to canonical types, and X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5272b7f6ac343bbfc1638ed414fe474d763b3f88;p=clang 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 --- 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); } }