[cfe-commits] r49319 - in /cfe/trunk: include/clang/AST/ASTContext.h lib/AST/ASTContext.cpp

Chris Lattner sabre at nondot.org
Sun Apr 6 22:55:38 PDT 2008


Author: lattner
Date: Mon Apr  7 00:55:38 2008
New Revision: 49319

URL: http://llvm.org/viewvc/llvm-project?rev=49319&view=rev
Log:
Remove a dead check for compatible builtin types

Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=49319&r1=49318&r2=49319&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Mon Apr  7 00:55:38 2008
@@ -332,7 +332,6 @@
   bool referenceTypesAreCompatible(QualType, QualType); // C++ 5.17p6
   bool functionTypesAreCompatible(QualType, QualType); // C99 6.7.5.3p15
   bool arrayTypesAreCompatible(QualType, QualType); // C99 6.7.5.2p6
-  bool builtinTypesAreCompatible(QualType, QualType);
   
   bool isObjCIdType(QualType T) const {
     if (!IdStructType) // ObjC isn't enabled

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=49319&r1=49318&r2=49319&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Mon Apr  7 00:55:38 2008
@@ -1435,13 +1435,6 @@
   ObjCConstantStringType = getObjCInterfaceType(Decl);
 }
 
-bool ASTContext::builtinTypesAreCompatible(QualType lhs, QualType rhs) {
-  const BuiltinType *lBuiltin = lhs->getAsBuiltinType();
-  const BuiltinType *rBuiltin = rhs->getAsBuiltinType();
-  
-  return lBuiltin->getKind() == rBuiltin->getKind();
-}
-
 /// areCompatObjCInterfaces - This routine is called when we are testing
 /// compatibility of two different [potentially qualified] ObjCInterfaceType's.
 static bool areCompatObjCInterfaces(const ObjCInterfaceType *LHS,
@@ -1704,13 +1697,14 @@
   case Type::Tagged: // handle structures, unions
     return tagTypesAreCompatible(LHS, RHS);
   case Type::Builtin:
-    return builtinTypesAreCompatible(LHS, RHS); 
+    // Only exactly equal builtin types are compatible, which is tested above.
+    return false;
+  case Type::Vector:
+    return areCompatVectorTypes(cast<VectorType>(LHS), cast<VectorType>(RHS));
   case Type::ObjCInterface:
     // The LHS must be a superclass of the RHS.
     return cast<ObjCInterfaceType>(LHS)->getDecl()->isSuperClassOf(
                                    cast<ObjCInterfaceType>(RHS)->getDecl());
-  case Type::Vector:
-    return areCompatVectorTypes(cast<VectorType>(LHS), cast<VectorType>(RHS));
   case Type::ObjCQualifiedInterface:
     return areCompatObjCQualInterfaces(cast<ObjCQualifiedInterfaceType>(LHS),
                                        cast<ObjCQualifiedInterfaceType>(RHS));





More information about the cfe-commits mailing list