diff options
author | Markus Böck <markus.bock+llvm@nextsilicon.com> | 2023-08-10 09:56:59 +0200 |
---|---|---|
committer | Markus Böck <markus.bock+llvm@nextsilicon.com> | 2023-08-10 12:38:54 +0200 |
commit | f3b1361f35fcbd2b551f224bebc4068d7de8c3d2 (patch) | |
tree | 8e2ea24d94d2312a97b1aa98064390a121f59e47 /libcxx/src/algorithm.cpp | |
parent | 5b29f86b42bab223ed8b9f2738802138aade74e0 (diff) | |
download | llvm-f3b1361f35fcbd2b551f224bebc4068d7de8c3d2.zip llvm-f3b1361f35fcbd2b551f224bebc4068d7de8c3d2.tar.gz llvm-f3b1361f35fcbd2b551f224bebc4068d7de8c3d2.tar.bz2 |
[mlir] Generate constructor in generic adaptors allowing construction from an op instance
In essentially all occurrences of adaptor constructions in the codebase, an instance of the op is available and only a different value range is being used. Nevertheless, one had to perform the ritual of calling and pass `getAttrDictionary()`, `getProperties` and `getRegions` manually.
This patch changes that by teaching TableGen to generate a new constructor in the adaptor that is constructable using `GenericAdaptor(valueRange, op)`. The (discardable) attr dictionary, properties and the regions are then taken directly from the passed op, with only the value range being taken from the first parameter.
This simplifies a lot of code and also guarantees that all the various getters of the adaptor work in all scenarios.
Differential Revision: https://reviews.llvm.org/D157516
Diffstat (limited to 'libcxx/src/algorithm.cpp')
0 files changed, 0 insertions, 0 deletions