[PATCH] D99883: [TableGen] Make behavior of list slice suffix consistent across all values

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 5 07:03:30 PDT 2021


Paul-C-Anagnostopoulos created this revision.
Paul-C-Anagnostopoulos added reviewers: lattner, madhur13490, dblaikie, craig.topper.
Herald added a subscriber: hiraditya.
Paul-C-Anagnostopoulos requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The list slice suffix with a single index is supposed to produce the specified list element. For example:

  [0, 1, 2, 3, 4, 5] [3] => 3

This works fine except when the list is a literal (as above) or a defvar, in which case it currently produces a list of the single element:

  [0, 1, 2, 3, 4, 5] [3] => [3]

This revision fixes this bug so that everything is consistent. I can find no TableGen files that depend on the inconsistency. I wrote a more comprehensive test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99883

Files:
  llvm/lib/TableGen/Record.cpp
  llvm/test/TableGen/ListSlices.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99883.335244.patch
Type: text/x-patch
Size: 3692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210405/357e043d/attachment.bin>


More information about the llvm-commits mailing list