Go to file
Pierre-Marie de Rodat f76f096ec7 DWARF: add DW_AT_encoding attributes for DW_TAG_enumeration_type DIEs
Currently, the DWARF description does not specify the signedness of the
representation of enumeration types.  This is a problem in some
contexts where DWARF consumers need to determine if value X is greater
than value Y.

For instance in Ada:

    type Enum_Type is ( A, B, C, D);
    for Enum_Type use (-1, 0, 1, 2);

    type Rec_Type (E : Enum_Type) is record
       when A .. B => null;
       when others => B : Booleann;
    end record;

The above can be described in DWARF the following way:

    DW_TAG_enumeration_type(Enum_Type)
    | DW_AT_byte_size: 1
      DW_TAG_enumerator(A)
      | DW_AT_const_value: -1
      DW_TAG_enumerator(B)
      | DW_AT_const_value: 0
      DW_TAG_enumerator(C)
      | DW_AT_const_value: 1
      DW_TAG_enumerator(D)
      | DW_AT_const_value: 2

    DW_TAG_structure_type(Rec_Type)
      DW_TAG_member(E)
      | DW_AT_type: <Enum_Type>
      DW_TAG_variant_part
      | DW_AT_discr: <E>
        DW_TAG_variant
        | DW_AT_discr_list: DW_DSC_range 0x7f 0
        DW_TAG_variant
        | DW_TAG_member(b)

DWARF consumers need to know that enumerators (A, B, C and D) are signed
in order to determine the set of E values for which Rec_Type has a B
field.  In practice, they need to know how to interpret the 0x7f LEB128
number above (-1, not 127).

When in non-strict DWARF mode, this patch adds a DW_AT_encoding
attribute to generated DW_TAG_enumeration_type DIEs to make this
signedness explicit.

gcc/

	* dwarf2out.c (gen_enumeration_type_die): When
	-gno-strict-dwarf, add a DW_AT_encoding attribute.

From-SVN: r244015
2017-01-03 08:54:57 +00:00
config
contrib update-copyright.py (TestsuiteFilter): Skip params/README. 2017-01-01 12:50:10 +01:00
fixincludes
gcc DWARF: add DW_AT_encoding attributes for DW_TAG_enumeration_type DIEs 2017-01-03 08:54:57 +00:00
gnattools
gotools
include
INSTALL
intl
libada Update copyright years. 2017-01-01 13:07:43 +01:00
libatomic Update copyright years. 2017-01-01 13:07:43 +01:00
libbacktrace Update copyright years. 2017-01-01 13:07:43 +01:00
libcc1
libcilkrts
libcpp Update copyright years. 2017-01-01 13:07:43 +01:00
libdecnumber Update copyright years. 2017-01-01 13:07:43 +01:00
libffi
libgcc Update copyright years. 2017-01-01 13:07:43 +01:00
libgfortran PR 78534 Change character length from int to size_t 2017-01-03 09:04:01 +02:00
libgo
libgomp Update copyright years. 2017-01-01 13:07:43 +01:00
libiberty
libitm Update copyright years. 2017-01-01 13:07:43 +01:00
libmpx libtool-version: New version. 2016-12-27 15:35:19 +00:00
libobjc Update copyright years. 2017-01-01 13:07:43 +01:00
liboffloadmic
libquadmath gcc.c (process_command): Update copyright notice dates. 2017-01-01 12:31:28 +01:00
libsanitizer
libssp
libstdc++-v3 faq.xml: Update address of C++ ABI link. 2017-01-02 00:33:17 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ChangeLog * config.sub: Import latest version. 2016-12-29 22:04:53 +11:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub * config.sub: Import latest version. 2016-12-29 22:04:53 +11:00
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS (Write After Approval): Add myself. 2016-12-26 10:28:02 +00:00
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
README
symlink-tree
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.