diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-07 05:55:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-07 05:55:38 +0000 |
commit | 3cc4c0c3058a788689b8fc73c0ac139544435c97 (patch) | |
tree | 5398160105a82ed4854cfab000f4f952b97c7add | |
parent | 6e26f5db807a75713dbf6e34cf93da6fffe18cc3 (diff) |
Remove a dead check for compatible builtin types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49319 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/ASTContext.h | 1 | ||||
-rw-r--r-- | lib/AST/ASTContext.cpp | 14 |
2 files changed, 4 insertions, 11 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 25c8e39b77..faae136817 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -332,7 +332,6 @@ public: 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 diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index c7d9340401..355308a40c 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1435,13 +1435,6 @@ void ASTContext::setObjCConstantStringInterface(ObjCInterfaceDecl *Decl) { 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 @@ bool ASTContext::typesAreCompatible(QualType LHS_NC, QualType RHS_NC) { 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)); |