[PATCH] D114425: [clang] Add __builtin_bswap128

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 3 10:17:50 PST 2022


craig.topper added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:2930
+  }
+  [[fallthrough]];
   case Builtin::BI__builtin_bswap16:
----------------
craig.topper wrote:
> Quuxplusone wrote:
> > Re clang-format's complaint: I would either move `[[fallthrough]];` inside the curly braces, or (probably better) just eliminate the fallthrough by either duplicating line 2934 or else doing
> > ```
> >   case Builtin::BI__builtin_bswap64:
> >   case Builtin::BI__builtin_bswap128: {
> >     if (BuiltinIDIfNoAsmLabel == Builtin::BI__builtin_bswap128 && !Target.hasInt128Type())
> >       CGM.ErrorUnsupported(E, "__builtin_bswap128");
> >     return RValue::get(emitUnaryBuiltin(*this, E, Intrinsic::bswap));
> >   }
> > ```
> I believe we are still using `LLVM_FALLTHROUGH` rather than `[[fallthrough]]`
There's really no reason for the curly braces. There are no variables declared so you don't need a new scope. The code that it is being fallen into doesn't need them either.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114425/new/

https://reviews.llvm.org/D114425



More information about the cfe-commits mailing list