[all-commits] [llvm/llvm-project] 44600b: [mlir][python] Improve sanitization of python name...

JoelWee via All-commits all-commits at lists.llvm.org
Thu Oct 12 00:54:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 44600bae893e126d91aee79e522749549caeec50
      https://github.com/llvm/llvm-project/commit/44600bae893e126d91aee79e522749549caeec50
  Author: JoelWee <32009741+JoelWee at users.noreply.github.com>
  Date:   2023-10-12 (Thu, 12 Oct 2023)

  Changed paths:
    M mlir/test/mlir-tblgen/op-python-bindings.td
    M mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

  Log Message:
  -----------
  [mlir][python] Improve sanitization of python names (#68801)

Follow up to 7d4cd47e242c28c450c1e2a1a9f4bd4b7b5a01ab, where I fixed
just the case of a dash. This fixes it for all possible types of
strings, which can include "-,." etc.

This modifies some code written in
27c6d55cae74125b6381a647533090a72930ecda

It also handles the case of a leading number which is not valid for
python names.

Ref:
- https://llvm.org/docs/TableGen/ProgRef.html#literals




More information about the All-commits mailing list