d: Build TYPE_DECLs for non-numeric enum types.
authorIain Buclaw <ibuclaw@gdcproject.org>
Sat, 12 Sep 2020 14:26:58 +0000 (16:26 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sat, 12 Sep 2020 19:34:38 +0000 (21:34 +0200)
commite4011c13c1f8d51f00af61bcb8189bcbe45823b7
tree613e7276d4ebf04ef64d1546cff0fdded9d58bd1
parent49482217e0ade3fe92ea050c01f5f7a6ddc31e95
d: Build TYPE_DECLs for non-numeric enum types.

This is done so that the DWARF pass will emit a DW_TAG_typedef where the
member type of an enum can't be represented in an ENUMERAL_TYPE.

gcc/d/ChangeLog:

* d-builtins.cc (d_build_d_type_nodes): Call build_ctype() on all
basic front-end types.
* decl.cc (DeclVisitor::visit (EnumDeclaration *)): Always add decl to
current binding level.
(build_type_decl): Build TYPE_DECL as a typedef if not for an enum or
record type.
* types.cc (TypeVisitor::visit (TypeEnum *)): Set underlying type for
ENUMERAL_TYPEs.  Build TYPE_DECL for non-numeric enums.
gcc/d/d-builtins.cc
gcc/d/decl.cc
gcc/d/types.cc