From 7320f9c9adf099a5fd673dbf38b8a400792e4827 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 14 Feb 2009 08:22:25 +0000 Subject: [PATCH] simplify some code. llvm-svn: 64548 --- clang/lib/Sema/SemaDeclObjC.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 1e87a6f8195b..95a6faed1aeb 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -264,14 +264,13 @@ Sema::FindProtocolDeclaration(bool WarnOnDeclarations, << ProtocolId[i].first; continue; } - for (const Attr *attr = PDecl->getAttrs(); attr; attr = attr->getNext()) { - if (attr->getKind() == Attr::Unavailable) - Diag(ProtocolId[i].second, diag::warn_unavailable) << - PDecl->getDeclName(); - if (attr->getKind() == Attr::Deprecated) - Diag(ProtocolId[i].second, diag::warn_deprecated) << - PDecl->getDeclName(); - } + + if (PDecl->getAttr()) + Diag(ProtocolId[i].second, diag::warn_unavailable) << + PDecl->getDeclName(); + if (PDecl->getAttr()) + Diag(ProtocolId[i].second, diag::warn_deprecated) << + PDecl->getDeclName(); // If this is a forward declaration and we are supposed to warn in this // case, do it.