diff options
author | Steve Naroff <snaroff@apple.com> | 2007-11-07 18:07:59 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2007-11-07 18:07:59 +0000 |
commit | 45ecd5daa36385b7e0b2f657357805e01f5d8cbf (patch) | |
tree | d340c92c046e0b0f9b43258bca8c05db84b2d28b | |
parent | 89079eac7d6e3091b74b477a4a5ff0cdaf35496c (diff) |
Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead, return false if the declarations aren't in scope. This was a hold over from when 'id' and 'Class' were initialized lazily.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43827 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/ASTContext.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 854fc3fe43..773fe23c55 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -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 { |