mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-28 08:02:08 +00:00
86d68e2885
If an operation defines an optional attribute (OptionalAttr or UnitAttr), transformations may wish to remove these attributes while maintaining invariants established by the operation. Currently, the only way to do this is by calling `Operation::removeAttr("attrName")`, which requires developers to know the exact name of the attribute used by table-gen. Furthermore, if the attribute name changes, this won't be detected at compile time. Instead, `removeAttr` would return an empty attribute and no errors would be raised, unless the caller checks for the returned value. This patch adds table gen support for generating `remove<AttrName>Attr` methods for OptionalAttributes defined by operations. Implementation choice: to preserve camelCase for the method's name, the first character of an attribute called `myAttr` is changed to upper case in order to preserve the coding style, so the final method would be called `removeMyAttr`. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D93903 |
||
---|---|---|
.. | ||
cmake/modules | ||
docs | ||
examples | ||
include | ||
integration_test | ||
lib | ||
test | ||
tools | ||
unittests | ||
utils | ||
.clang-format | ||
.clang-tidy | ||
CMakeLists.txt | ||
LICENSE.TXT | ||
README.md |
Multi-Level Intermediate Representation
See https://mlir.llvm.org/ for more information.