llvm-project/mlir/unittests/TableGen
Alex Zinenko fdc496a3d3 [mlir] EnumsGen: dissociate string form of integer enum from C++ symbol name
Summary:
In some cases, one may want to use different names for C++ symbol of an
enumerand from its string representation. In particular, in the LLVM dialect
for, e.g., Linkage, we would like to preserve the same enumerand names as LLVM
API and the same textual IR form as LLVM IR, yet the two are different
(CamelCase vs snake_case with additional limitations on not being a C++
keyword).

Modify EnumAttrCaseInfo in OpBase.td to include both the integer value and its
string representation. By default, this representation is the same as C++
symbol name. Introduce new IntStrAttrCaseBase that allows one to use different
names. Exercise it for LLVM Dialect Linkage attribute. Other attributes will
follow as separate changes.

Differential Revision: https://reviews.llvm.org/D73362
2020-01-30 17:04:00 +01:00
..
CMakeLists.txt Add missing link dependency to MLIRTableGenTests 2019-08-31 09:50:33 -07:00
EnumsGenTest.cpp [mlir] EnumsGen: dissociate string form of integer enum from C++ symbol name 2020-01-30 17:04:00 +01:00
FormatTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
StructsGenTest.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
enums.td [mlir] EnumsGen: dissociate string form of integer enum from C++ symbol name 2020-01-30 17:04:00 +01:00
structs.td Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00