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 | a9d0ffe57ebd29da49ab722a25d37f58a0c91dc8 (patch) | |
tree | e2739899d0776004bb3afc6765eb502b3b7fbbc7 /clang/lib | |
parent | aae4349df9ac74d2e5b70117002dcda56254d3ea (diff) | |
download | bcm5719-llvm-a9d0ffe57ebd29da49ab722a25d37f58a0c91dc8.tar.gz bcm5719-llvm-a9d0ffe57ebd29da49ab722a25d37f58a0c91dc8.zip |
simplify this code to not bother stripping to canonical types, and
indent code properly
llvm-svn: 68866
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 74a03164313..a73b440577b 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/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); } } |