]> granicus.if.org Git - clang/commitdiff
simplify this code to not bother stripping to canonical types, and
authorChris Lattner <sabre@nondot.org>
Sat, 11 Apr 2009 18:01:59 +0000 (18:01 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 11 Apr 2009 18:01:59 +0000 (18:01 +0000)
indent code properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68866 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclObjC.cpp

index 74a031643135a8ae4ad5b7360b4382745e4852a5..a73b440577b59a6a12344c2d287c9440365c4727 100644 (file)
@@ -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);
   }
 }