]> granicus.if.org Git - clang/commitdiff
Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead...
authorSteve Naroff <snaroff@apple.com>
Wed, 7 Nov 2007 18:07:59 +0000 (18:07 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 7 Nov 2007 18:07:59 +0000 (18:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43827 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTContext.h

index 854fc3fe43fc808cd8151aa75b40b3a32bf1a938..773fe23c55ae3a46cf274183e96a8a254cadde61 100644 (file)
@@ -283,11 +283,13 @@ public:
   bool interfaceTypesAreCompatible(QualType, QualType);
   bool objcTypesAreCompatible(QualType, QualType);
   bool isObjcIdType(QualType T) const {
-    assert(IdStructType && "isObjcIdType used before 'id' type is built");
+    if (!IdStructType) // ObjC isn't enabled
+      return false;
     return T->getAsStructureType() == IdStructType;
   }
   bool isObjcClassType(QualType T) const {
-    assert(ClassStructType && "isObjcClassType used before 'Class' type is built");
+    if (!ClassStructType) // ObjC isn't enabled
+      return false;
     return T->getAsStructureType() == ClassStructType;
   }
   bool isObjcSelType(QualType T) const {