summaryrefslogtreecommitdiffstats
path: root/clang/Sema/Sema.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Sema/Sema.cpp')
-rw-r--r--clang/Sema/Sema.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/Sema/Sema.cpp b/clang/Sema/Sema.cpp
index bca3ec508bf..8f340db14e0 100644
--- a/clang/Sema/Sema.cpp
+++ b/clang/Sema/Sema.cpp
@@ -26,6 +26,20 @@ bool Sema::isBuiltinObjcType(TypedefDecl *TD) {
strcmp(typeName, "SEL") == 0 || strcmp(typeName, "Protocol") == 0;
}
+bool Sema::isObjcObjectPointerType(QualType type) const {
+ if (!type->isPointerType() && !type->isObjcQualifiedIdType())
+ return false;
+ if (type == Context.getObjcIdType() || type == Context.getObjcClassType() ||
+ type->isObjcQualifiedIdType())
+ return true;
+
+ while (type->isPointerType()) {
+ PointerType *pointerType = static_cast<PointerType*>(type.getTypePtr());
+ type = pointerType->getPointeeType();
+ }
+ return (type->isObjcInterfaceType() || type->isObjcQualifiedIdType());
+}
+
void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
TUScope = S;
if (PP.getLangOptions().ObjC1) {
OpenPOWER on IntegriCloud