[cfe-commits] r64548 - /cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Sat Feb 14 09:59:06 PST 2009
I am sure you want the simplification to be equivalent to the original
(even though it
is not obvious to me right away :).
- Fariborz
On Feb 14, 2009, at 12:22 AM, Chris Lattner wrote:
> Author: lattner
> Date: Sat Feb 14 02:22:25 2009
> New Revision: 64548
>
> URL: http://llvm.org/viewvc/llvm-project?rev=64548&view=rev
> Log:
> simplify some code.
>
> Modified:
> cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=64548&r1=64547&r2=64548&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Sat Feb 14 02:22:25 2009
> @@ -264,14 +264,13 @@
> << 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<UnavailableAttr>())
> + Diag(ProtocolId[i].second, diag::warn_unavailable) <<
> + PDecl->getDeclName();
> + if (PDecl->getAttr<DeprecatedAttr>())
> + 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.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list