[PATCH] D72690: [ARM,MVE] Use the new Tablegen `defvar` and `if` statements.

Simon Tatham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 02:43:09 PST 2020


simon_tatham created this revision.
simon_tatham added reviewers: MarkMurrayARM, miyuki.
Herald added subscribers: llvm-commits, cfe-commits, dmgreen, hiraditya, kristof.beyls.
Herald added projects: clang, LLVM.

This cleans up a lot of ugly `foreach` bodges that I've been using to
work around the lack of those two language features. Now they both
exist, I can make then all into something more legible!

In particular, in the common pattern in `ARMInstrMVE.td` where a
multiclass defines an `Instruction` instance plus one or more `Pat` that
select it, I've used a `defvar` to wrap `!cast<Instruction>(NAME)` so
that the patterns themselves become a little more legible.

Replacing a `foreach` with a `defvar` removes a level of block
structure, so several pieces of code have their indentation changed by
this patch. Best viewed with whitespace ignored.

NFC: the output of `llvm-tblgen -print-records` on the two affected
Tablegen sources is exactly identical before and after this change, so
there should be no effect at all on any of the other generated files.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72690

Files:
  clang/include/clang/Basic/arm_mve.td
  llvm/lib/Target/ARM/ARMInstrMVE.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72690.237902.patch
Type: text/x-patch
Size: 52086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200114/01636f76/attachment-0001.bin>


More information about the cfe-commits mailing list