================
@@ -1277,6 +1277,21 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl
&gd, unsigned builtinID,
return RValue::get(cir::ByteSwapOp::create(builder, loc, arg));
}
+ case Builtin::BI__builtin_bswapg: {
+ mlir::Value arg = emitScalarExpr(e->getArg(0));
+ // A bool or any single-byte integer byte-swaps to itself; cir.byte_swap
+ // only accepts an unsigned integer whose width is a multiple of 16 bits.
+ auto argTy = mlir::dyn_cast<cir::IntType>(arg.getType());
----------------
andykaylor wrote:
```suggestion
auto argTy = mlir::cast<cir::IntType>(arg.getType());
```
This has to be an integer type, right?
https://github.com/llvm/llvm-project/pull/203618
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits