[Mlir-commits] [mlir] [mlir][python] Improve sanitization of python names (PR #68801)

Maksim Levental llvmlistbot at llvm.org
Wed Oct 11 09:20:03 PDT 2023


================
@@ -616,6 +616,15 @@ def VariadicRegionOp : TestOp<"variadic_region"> {
 // CHECK: def variadic_region(num_variadic, *, loc=None, ip=None)
 // CHECK:   return _get_op_result_or_op_results(VariadicRegionOp(num_variadic=num_variadic, loc=loc, ip=ip))
 
+// CHECK: @_ods_cext.register_operation(_Dialect)
+// CHECK: class WithSpecialCharactersOp(_ods_ir.OpView):
+// CHECK-LABEL: OPERATION_NAME = "test.123with- special.characters"
+def WithSpecialCharactersOp : TestOp<"123with- special.characters"> {
+}
+
+// CHECK: def _123with__special_characters(*, loc=None, ip=None)
----------------
makslevental wrote:

I can't see it right this moment but how come the `-` gets turned into two underscores? And is there a way to just have it be one?

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


More information about the Mlir-commits mailing list