[cfe-commits] [PATCH] Implicit fall-through between switch labels

Alexander Kornienko alexfh at google.com
Fri Apr 27 06:08:29 PDT 2012


Hi Jordy,

On Fri, Apr 27, 2012 at 4:22 AM, Jordy Rose <jediknil at belkadan.com> wrote:

> Oh, and...
>
> > +#include <set>
>
> This seems unused now.
>
> > +    static const AttributedStmt *AsFallThroughAttr(const Stmt *S) {
> > +      if (const AttributedStmt *AS =
> dyn_cast_or_null<AttributedStmt>(S)) {
> > +        for (AttrVec::const_iterator It = AS->getAttrs().begin(),
> > +                                     End = AS->getAttrs().end();
> > +                                     It != End; ++It) {
> > +          if (isa<FallThroughAttr>(*It))
> > +            return AS;
> > +        }
> > +      }
> > +      return 0;
> > +    }
>
> The inner for-loop can be replaced with
> hasSpecificAttr<FallThroughAttr>(AS->getAttrs());.


Thanks for noting! Fixed. Will post in the next patch.

--
Best regards,
Alexander Kornienko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120427/21a19fa5/attachment.html>


More information about the cfe-commits mailing list