[cfe-commits] r39441 - /cfe/cfe/trunk/AST/Type.cpp

Steve Naroff snaroff at apple.com
Wed Jul 11 09:44:26 PDT 2007


Author: snaroff
Date: Wed Jul 11 11:44:26 2007
New Revision: 39441

URL: http://llvm.org/viewvc/llvm-project?rev=39441&view=rev
Log:
Bug #:
Submitted by:
Reviewed by:
Removed a couple superflous checks from typesAreCompatible. Moved the
spec references up to a comment.

Modified:
    cfe/cfe/trunk/AST/Type.cpp

Modified: cfe/cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Type.cpp?rev=39441&r1=39440&r2=39441&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Type.cpp (original)
+++ cfe/cfe/trunk/AST/Type.cpp Wed Jul 11 11:44:26 2007
@@ -155,6 +155,10 @@
   return true;
 }
 
+/// typesAreCompatible - C99 6.7.3p9: For two qualified types to be compatible, 
+/// both shall have the identically qualified version of a compatible type.
+/// C99 6.2.7p1: Two types have compatible types if their types are the 
+/// same. See 6.7.[2,3,5] for additional rules.
 bool Type::typesAreCompatible(QualType lhs, QualType rhs) {
   QualType lcanon = lhs.getCanonicalType();
   QualType rcanon = rhs.getCanonicalType();
@@ -178,15 +182,6 @@
     case Type::Tagged: // handle structures, unions
       return tagTypesAreCompatible(lcanon, rcanon);
     case Type::Builtin:
-      // C99 6.7.3p9: For two qualified types to be compatible, both shall 
-      // have the identically qualified version of a compatible type.
-      if (lhs.getQualifiers() != rhs.getQualifiers())
-        return false;
-        
-      // C99 6.2.7p1: Two types have compatible types if their types are the 
-      // same. See 6.7.[2,3,5] for additional rules.
-      if (lcanon.getTypePtr() == rcanon.getTypePtr())
-        return true;
       return false; 
     default:
       assert(0 && "unexpected type");





More information about the cfe-commits mailing list