[cfe-commits] r68866 - /cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Chris Lattner
sabre at nondot.org
Sat Apr 11 11:01:59 PDT 2009
Author: lattner
Date: Sat Apr 11 13:01:59 2009
New Revision: 68866
URL: http://llvm.org/viewvc/llvm-project?rev=68866&view=rev
Log:
simplify this code to not bother stripping to canonical types, and
indent code properly
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=68866&r1=68865&r2=68866&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Sat Apr 11 13:01:59 2009
@@ -764,25 +764,22 @@
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);
}
}
More information about the cfe-commits
mailing list