[Mlir-commits] [mlir] [MLIR] Print (u)int8_t args as numbers and properly support char args (PR #225680)
Henrich Lauko
llvmlistbot at llvm.org
Tue Oct 6 09:53:08 PDT 2026
================
@@ -37,6 +37,13 @@ attributes {
attr_14 = #test.simple_enum<"+">,
// CHECK: #test.simple_enum<"dash-separated-sentence">
attr_15 = #test.simple_enum<"dash-separated-sentence">,
+ // CHECK: #test.attr_with_int8_params<200, -100>
+ attr_16 = #test.attr_with_int8_params<200, -100>,
+ // Test that chars use the correct overload and print as supposed to.
+ // CHECK: #test.attr_with_char_param<A>
+ attr_17 = #test.attr_with_char_param<A>,
+ // CHECK: #test.attr_with_char_param<"\0A">
+ attr_18 = #test.attr_with_char_param<"\0A">,
// Test that ArrayRefParameter in non-last struct position is wrapped in
----------------
xlauko wrote:
General fix for all cases maybe belongs in the generic `operator<<(AsmPrinterT&, const T&)` route `int8_t/uint8_t` to `printInteger` there. That covers scalars, `ArrayRef` elements and handwritten `printer << x` code in one place. Only `std::optional` would still need its own handling. The scalar `printStrippedAttrOrType` overloads would then be redundant. Handwritten printers would see a behavior change, but printing an `int8_t` as a glyph is almost never what anyone wants?
https://github.com/llvm/llvm-project/pull/225680
More information about the Mlir-commits
mailing list