[PATCH] D53815: [TableGen] Better error checking for TIED_TO constraints.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 1 04:33:23 PDT 2018


simon_tatham updated this revision to Diff 172107.
simon_tatham added a comment.

`Name` is rewritten between creation of `LHSOp` and `RHSOp`, so you
can't just make both of them into StringRefs because `LHSOp` would be
invalidated by the change to `Name`.

But now you point it out, `Name` doesn't really need to exist, because
instead of extracting a substring from `CStr` and searching it using
`find_first_of`, you can just search `CStr` itself using
`find_first_of` with the optional start-position argument. Here's a
rewrite that removes `Name` completely and turns everything into
StringRef.

Also replaced the `auto` (after looking up what the type was myself :-).


Repository:
  rL LLVM

https://reviews.llvm.org/D53815

Files:
  test/TableGen/ConstraintChecking.inc
  test/TableGen/ConstraintChecking1.td
  test/TableGen/ConstraintChecking2.td
  test/TableGen/ConstraintChecking3.td
  test/TableGen/ConstraintChecking4.td
  test/TableGen/ConstraintChecking5.td
  test/TableGen/ConstraintChecking6.td
  test/TableGen/ConstraintChecking7.td
  utils/TableGen/CodeGenInstruction.cpp
  utils/TableGen/CodeGenInstruction.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53815.172107.patch
Type: text/x-patch
Size: 11797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181101/f53e6461/attachment.bin>


More information about the llvm-commits mailing list