From: Chris Lattner Date: Sat, 14 Feb 2009 08:22:25 +0000 (+0000) Subject: simplify some code. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45ce5c38dd347564bea942c5be3b53dd4a6240c7;p=clang simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64548 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 1e87a6f819..95a6faed1a 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/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.