[PATCH] D47514: [Target][NFC] Simplify `AssemblerPredicate`.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 30 00:19:07 PDT 2018


courbet created this revision.
courbet added reviewers: dsanders, echristo, stoklund.
Herald added subscribers: atanasyan, mgrang, edward-jones, zzheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, asb, arichardson, sdardis.

`AssemblerPredicate` details are currently leaking in `Predicate`.
TableGen objects can derive from multiple classes, and tablegen supports
querying for the exact type, so there is no need for this boolean.

Also add a check that `SubtargetFeatureInfo` records have the right
type (`Predicate`) to be used in the class (so that creating a
SubtargetFeatureInfo guarantees that calls to member functions are
valid: for example `mustRecomputePerFunction()` accesses field
`RecomputePerFunction`, that only exists if the def is a Predicate).

The above check caught one such case in Mips, which is also fixed by
this change.


Repository:
  rL LLVM

https://reviews.llvm.org/D47514

Files:
  include/llvm/Target/Target.td
  lib/Target/Mips/MipsInstrInfo.td
  lib/Target/Mips/MipsSubtarget.h
  utils/TableGen/AsmWriterEmitter.cpp
  utils/TableGen/FixedLenDecoderEmitter.cpp
  utils/TableGen/RISCVCompressInstEmitter.cpp
  utils/TableGen/SubtargetFeatureInfo.cpp
  utils/TableGen/SubtargetFeatureInfo.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47514.149051.patch
Type: text/x-patch
Size: 8543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180530/9ebb83b6/attachment.bin>


More information about the llvm-commits mailing list