[all-commits] [llvm/llvm-project] df330d: [TableGen] Enhance !range bang operator (#66489)

Wang Pengcheng via All-commits all-commits at lists.llvm.org
Tue Sep 26 21:07:49 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df330d749699f42751831f1b72fc7fd683f903c3
      https://github.com/llvm/llvm-project/commit/df330d749699f42751831f1b72fc7fd683f903c3
  Author: Wang Pengcheng <137158460+wangpc-pp at users.noreply.github.com>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M llvm/docs/TableGen/ProgRef.rst
    M llvm/include/llvm/TableGen/Record.h
    M llvm/lib/TableGen/Record.cpp
    M llvm/lib/TableGen/TGParser.cpp
    M llvm/test/TableGen/range-op-fail.td
    M llvm/test/TableGen/range-op.td

  Log Message:
  -----------
  [TableGen] Enhance !range bang operator (#66489)

We add a third argument `step` to `!range` bang operator to make it
with the same semantics as `range` in Python.

`step` can be negative. `step` is 1 by default and `step` can't be
0. If `start` < `end` and `step` is negative, or `start` > `end`
and `step` is positive, the result is an empty list.




More information about the All-commits mailing list