aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 8e6aa23618..114c9ac7df 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -470,6 +470,24 @@ bool Type::isIntegralOrEnumerationType() const {
return false;
}
+bool Type::isLegacyObjCIdType(ASTContext &Ctx) const {
+ if (const PointerType *PTTo = getAs<PointerType>()) {
+ QualType PointeeTy = PTTo->getPointeeType();
+ if (const RecordType *RTy = PointeeTy->getAs<RecordType>())
+ return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_object");
+ }
+ return false;
+}
+
+bool Type::isLegacyObjCClassType(ASTContext &Ctx) const {
+ if (const PointerType *PTTo = getAs<PointerType>()) {
+ QualType PointeeTy = PTTo->getPointeeType();
+ if (const RecordType *RTy = PointeeTy->getAs<RecordType>())
+ return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_class");
+ }
+ return false;
+}
+
bool Type::isEnumeralType() const {
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
return TT->getDecl()->isEnum();