diff options
author | Tom Tromey <tom@tromey.com> | 2021-06-18 13:13:01 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-06-18 13:47:51 -0600 |
commit | 231de190d1c8666748eb1c346d22c73946aba743 (patch) | |
tree | af6862493d16f88c204951bbe2b4e785a6dd715a /gcc/rust | |
parent | e200b89c0f62df1b1dd76c75ccfb90ea82fbb7e5 (diff) | |
download | gcc-231de190d1c8666748eb1c346d22c73946aba743.zip gcc-231de190d1c8666748eb1c346d22c73946aba743.tar.gz gcc-231de190d1c8666748eb1c346d22c73946aba743.tar.bz2 |
Use correct DWARF encoding for i8 and u8 types
Currently, the i8 and u8 types use the DWARF character encoding, like:
<1><113>: Abbrev Number: 3 (DW_TAG_base_type)
<114> DW_AT_byte_size : 1
<115> DW_AT_encoding : 8 (unsigned char)
<116> DW_AT_name : u8
This happens because gccrs uses signed_char_type_node and
unsigned_char_type_node for i8 and u8, respectively.
This patch fixes this problem by arranging to use a custom integer
type instead. Another option is to clear TYPE_STRING_FLAG on these
types, but it was unclear to me whether this would impact other parts
of GCC.
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/rust-gcc.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index ed89c94..e6c8858 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -1,5 +1,5 @@ // rust-gcc.cc -- Rust frontend to gcc IR. -// Copyright (C) 2011-2020 Free Software Foundation, Inc. +// Copyright (C) 2011-2021 Free Software Foundation, Inc. // Contributed by Ian Lance Taylor, Google. // forked from gccgo @@ -867,8 +867,6 @@ Gcc_backend::integer_type (bool is_unsigned, int bits) { if (bits == INT_TYPE_SIZE) type = unsigned_type_node; - else if (bits == CHAR_TYPE_SIZE) - type = unsigned_char_type_node; else if (bits == SHORT_TYPE_SIZE) type = short_unsigned_type_node; else if (bits == LONG_TYPE_SIZE) @@ -882,8 +880,6 @@ Gcc_backend::integer_type (bool is_unsigned, int bits) { if (bits == INT_TYPE_SIZE) type = integer_type_node; - else if (bits == CHAR_TYPE_SIZE) - type = signed_char_type_node; else if (bits == SHORT_TYPE_SIZE) type = short_integer_type_node; else if (bits == LONG_TYPE_SIZE) |