Implements the enum_case attribute in the C++ backend to support emitting enum values with a case other than SHOUTY_CASE. Currently only the original SHOUTY_CASE and the new kCamelCase cases are supported, but adding a new case should be trivial.
Additionally, the implementation was designed to make it simple for a name attribute to be added for enum values (other IR nodes should be unaffected, it would be neither simpler nor harder to implement after this commit for other nodes).
Tests were added for case conversions, header generation, and a cc_test. All tests pass both in bazel test and python -m unittest.
A small change was made to the front-end, as some attribute handling functions were hoisted into compiler/util for reuse in the backend.
Implements the
enum_case
attribute in the C++ backend to support emitting enum values with a case other than SHOUTY_CASE. Currently only the original SHOUTY_CASE and the new kCamelCase cases are supported, but adding a new case should be trivial.Additionally, the implementation was designed to make it simple for a
name
attribute to be added for enum values (other IR nodes should be unaffected, it would be neither simpler nor harder to implement after this commit for other nodes).Tests were added for case conversions, header generation, and a cc_test. All tests pass both in
bazel test
andpython -m unittest
.A small change was made to the front-end, as some attribute handling functions were hoisted into
compiler/util
for reuse in the backend.