aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-07-06 20:48:48 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-07-06 20:48:48 +0000
commit7263feeb367ab55af7e9a6fd701148b1b8264dba (patch)
tree2c55204894f19e17eaa9d48e6b9aa1d8aa509b89 /lib
parent24c9db6f367a6143be953b1b9a910aab2141fdff (diff)
Some code cleanup of r134522
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134529 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaType.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index ae1ccf9886..f9cf630420 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -3212,21 +3212,14 @@ static bool handleObjCOwnershipTypeAttr(TypeProcessingState &state,
// objc_arc_weak_reference_unavailable
if (lifetime == Qualifiers::OCL_Weak) {
QualType T = type;
- if (T->isReferenceType()) {
- T = T->getAs<ReferenceType>()->getPointeeType();
- }
while (const PointerType *ptr = T->getAs<PointerType>())
T = ptr->getPointeeType();
if (const ObjCObjectPointerType *ObjT = T->getAs<ObjCObjectPointerType>()) {
ObjCInterfaceDecl *Class = ObjT->getInterfaceDecl();
- while (Class) {
- if (Class->hasAttr<ArcWeakrefUnavailableAttr>()) {
+ if (Class->isArcWeakrefUnavailable()) {
S.Diag(attr.getLoc(), diag::err_arc_unsupported_weak_class);
S.Diag(ObjT->getInterfaceDecl()->getLocation(),
diag::note_class_declared);
- break;
- }
- Class = Class->getSuperClass();
}
}
}