[flang] Add ENUM_CLASS to define enum class with ToString function.
authorTim Keith <tkeith@nvidia.com>
Fri, 23 Mar 2018 21:31:14 +0000 (14:31 -0700)
committerTim Keith <tkeith@nvidia.com>
Fri, 23 Mar 2018 21:41:48 +0000 (14:41 -0700)
commit9f755666fbc4e3f4d4d9643eccf352a3704678c4
tree4f69a66e18fa8626a6a4608e29d03b051d8fa66e
parent43ac92e6965cf7966d85e7e7d75e1007124502d5
[flang] Add ENUM_CLASS to define enum class with ToString function.

This replaces DEFINE_NESTED_ENUM_CLASS in parse-tree.h but works
similarly. "ENUM_CLASS(Foo, A, B, C)" defined enum class Foo with
enumerators A, B, C. It also defines an overloading of EnumToString
that converts enumerators to their string representation.

Change unparse.cc to adapt to this change.

Make use of ENUM_CLASS in attr.h and attr.cc.

Original-commit: flang-compiler/f18@c45b8f172a2559e22d1aaf12257b4e2558df8c6f
Reviewed-on: https://github.com/flang-compiler/f18/pull/31
flang/lib/parser/idioms.cc
flang/lib/parser/idioms.h
flang/lib/parser/parse-tree.h
flang/lib/parser/unparse.cc
flang/lib/semantics/attr.cc
flang/lib/semantics/attr.h