diff options
author | Tom Tromey <tom@tromey.com> | 2024-02-26 18:21:03 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-02-29 08:50:06 -0700 |
commit | bc0e18a960f9dff3e740f4d0cb5b25b3f68d920a (patch) | |
tree | 172401564fb0380b8dfc80a9c78b7353b40b53f8 /libcc1/libcc1.cc | |
parent | 54137725cfb968803be0f5fa76906839d79a3067 (diff) | |
download | gcc-bc0e18a960f9dff3e740f4d0cb5b25b3f68d920a.zip gcc-bc0e18a960f9dff3e740f4d0cb5b25b3f68d920a.tar.gz gcc-bc0e18a960f9dff3e740f4d0cb5b25b3f68d920a.tar.bz2 |
Fix PR libcc1/113977
PR libcc1/113977 points out a case where a simple expression is
rejected with a compiler error message. The bug here is that gdb does
not inform the plugin of the correct alignment -- in fact, there is no
way to do that.
This patch adds a new method to allow the alignment to be set, and
bumps the C front end protocol version.
It also includes some updates to various comments in 'include', done
here to simplify the merge to binutils-gdb.
include
* gcc-cp-interface.h (gcc_cp_fe_context_function): Update
comment.
* gcc-c-interface.h (enum gcc_c_api_version) <GCC_C_FE_VERSION_2>:
New constant.
(gcc_c_fe_context_function): Update comment.
* gcc-c-fe.def (finish_record_with_alignment): New method.
Update documentation.
libcc1
PR libcc1/113977
* libcc1plugin.cc (plugin_finish_record_or_union): New function.
(plugin_finish_record_or_union): Rewrite.
(plugin_init): Use GCC_C_FE_VERSION_2.
* libcc1.cc (c_vtable): Use GCC_C_FE_VERSION_2.
(gcc_c_fe_context): Check for GCC_C_FE_VERSION_2.
Diffstat (limited to 'libcc1/libcc1.cc')
-rw-r--r-- | libcc1/libcc1.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libcc1/libcc1.cc b/libcc1/libcc1.cc index 992181e..1c570f3 100644 --- a/libcc1/libcc1.cc +++ b/libcc1/libcc1.cc @@ -108,7 +108,7 @@ set_callbacks (struct gcc_c_context *s, static const struct gcc_c_fe_vtable c_vtable = { - GCC_C_FE_VERSION_1, + GCC_C_FE_VERSION_2, set_callbacks, #define GCC_METHOD0(R, N) \ @@ -165,7 +165,8 @@ gcc_c_fe_context (enum gcc_base_api_version base_version, enum gcc_c_api_version c_version) { if ((base_version != GCC_FE_VERSION_0 && base_version != GCC_FE_VERSION_1) - || (c_version != GCC_C_FE_VERSION_0 && c_version != GCC_C_FE_VERSION_1)) + || (c_version != GCC_C_FE_VERSION_0 && c_version != GCC_C_FE_VERSION_1 + && c_version != GCC_C_FE_VERSION_2)) return NULL; return new libcc1 (&c_vtable); |