[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:
ArrayRefParameter<"uint8_t"> still print glyphs, can you fix that too?
`printStrippedAttrOrType(ArrayRef<T>)` needs `T` to have a print method, so arrays go through `operator<<(AsmPrinterT&, ArrayRef<ElementT>)`, then `interleaveComma(types, p)`, then the generic `operator<<(AsmPrinterT&, const T&)`, then `raw_ostream`. The parser reads integers, so `[65]` prints as `[A]`.
https://github.com/llvm/llvm-project/pull/225680
More information about the Mlir-commits
mailing list