[clang] [Clang] Fixes builtin_bswapg builtin for bool type (PR #179177)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 4 09:32:51 PST 2026


================
@@ -1048,7 +1048,7 @@ static bool interp__builtin_bswap(InterpState &S, CodePtr OpPC,
                                   const InterpFrame *Frame,
                                   const CallExpr *Call) {
   const APSInt &Val = popToAPSInt(S, Call->getArg(0));
-  if (Val.getBitWidth() == 8)
+  if (Val.getBitWidth() == 8 || Val.getBitWidth() == 1)
----------------
shafik wrote:

So what about bit widths between 2 and 7? Same goes for other lines? If these are not a problem and don't need to be checked we should have tests confirming this.

https://github.com/llvm/llvm-project/pull/179177


More information about the cfe-commits mailing list