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

Jordy Rose jediknil at belkadan.com
Thu Apr 26 19:22:58 PDT 2012


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());.



More information about the cfe-commits mailing list