<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git/libcc1/libcc1.cc, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/'/>
<entry>
<title>Update copyright years.</title>
<updated>2025-01-02T10:59:57+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2025-01-02T10:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=6441eb6dc020faae0672ea724dfdb38c6a9bf6a1'/>
<id>6441eb6dc020faae0672ea724dfdb38c6a9bf6a1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix PR libcc1/113977</title>
<updated>2024-02-29T15:50:06+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tom@tromey.com</email>
</author>
<published>2024-02-27T01:21:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=bc0e18a960f9dff3e740f4d0cb5b25b3f68d920a'/>
<id>bc0e18a960f9dff3e740f4d0cb5b25b3f68d920a</id>
<content type='text'>
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) &lt;GCC_C_FE_VERSION_2&gt;:
	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.



</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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) &lt;GCC_C_FE_VERSION_2&gt;:
	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.



</pre>
</div>
</content>
</entry>
<entry>
<title>Fix version negotiation in libcc1 plugins</title>
<updated>2024-02-29T15:50:06+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tom@tromey.com</email>
</author>
<published>2024-02-23T02:36:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=54137725cfb968803be0f5fa76906839d79a3067'/>
<id>54137725cfb968803be0f5fa76906839d79a3067</id>
<content type='text'>
This fixes version negotiation in the libcc1 plugins.  It's done in a
simple way: the version number from the context object is now passed
to base_gdb_plugin.

The idea behind this is that when the client (gdb) requests version N,
the plugin should respond with the newest version that it knows of
that is backward compatible to N.  That is, the connection can be
upgraded.  Note that the protocol does not change much, and no
backward incompatibilities have ever been needed.

The C plugin is also changed to advertise GCC_C_FE_VERSION_1.

The version negotiation approach should of course be documented, but I
did that in a subsequent patch, in order to only have one patch
touching the 'include' directory and thus needing a merge to
binutils-gdb.

libcc1

	* libcp1.cc (libcp1::libcp1): Use FE version number from context.
	* libcc1.cc (libcc1::libcc1): Use FE version number from context.
	(c_vtable): Use GCC_C_FE_VERSION_1.



</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes version negotiation in the libcc1 plugins.  It's done in a
simple way: the version number from the context object is now passed
to base_gdb_plugin.

The idea behind this is that when the client (gdb) requests version N,
the plugin should respond with the newest version that it knows of
that is backward compatible to N.  That is, the connection can be
upgraded.  Note that the protocol does not change much, and no
backward incompatibilities have ever been needed.

The C plugin is also changed to advertise GCC_C_FE_VERSION_1.

The version negotiation approach should of course be documented, but I
did that in a subsequent patch, in order to only have one patch
touching the 'include' directory and thus needing a merge to
binutils-gdb.

libcc1

	* libcp1.cc (libcp1::libcp1): Use FE version number from context.
	* libcc1.cc (libcc1::libcc1): Use FE version number from context.
	(c_vtable): Use GCC_C_FE_VERSION_1.



</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2024-01-03T11:19:35+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2024-01-03T11:19:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=a945c346f57ba40fc80c14ac59be0d43624e559d'/>
<id>a945c346f57ba40fc80c14ac59be0d43624e559d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2023-01-16T10:52:17+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2023-01-16T10:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c'/>
<id>83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2022-01-03T09:42:10+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2022-01-03T09:42:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=7adcbafe45f8001b698967defe682687b52c0007'/>
<id>7adcbafe45f8001b698967defe682687b52c0007</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libcc1: use variadic templates for callbacks</title>
<updated>2021-05-05T06:06:18+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tom@tromey.com</email>
</author>
<published>2021-05-04T21:26:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=8fdffa48c57f13b90556bc179150d24efdeeeef5'/>
<id>8fdffa48c57f13b90556bc179150d24efdeeeef5</id>
<content type='text'>
This patch completes the transition of libcc1 from the use of separate
template functions for different arities to the use of variadic
functions.  This is how I had wanted it to work from the very
beginning, and is possible now with C++11.

I had thought that variadic callbacks required C++17, but it turns out
that the approach taken here is basically equivalent to std::apply --
just a bit wordier.

libcc1

	* rpc.hh (argument_wrapper) &lt;get&gt;: Replace cast operator.
	(argument_wrapper&lt;T *&gt;) &lt;get&gt;: Likewise.
	(unmarshall): Add std::tuple overloads.
	(callback): Remove.
	(class invoker): New.
	* libcp1plugin.cc (plugin_init): Update.
	* libcp1.cc (libcp1::add_callbacks): Update.
	* libcc1plugin.cc (plugin_init): Update.
	* libcc1.cc (libcc1::add_callbacks): Update.
	* connection.cc (cc1_plugin::connection::do_wait): Update.



</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch completes the transition of libcc1 from the use of separate
template functions for different arities to the use of variadic
functions.  This is how I had wanted it to work from the very
beginning, and is possible now with C++11.

I had thought that variadic callbacks required C++17, but it turns out
that the approach taken here is basically equivalent to std::apply --
just a bit wordier.

libcc1

	* rpc.hh (argument_wrapper) &lt;get&gt;: Replace cast operator.
	(argument_wrapper&lt;T *&gt;) &lt;get&gt;: Likewise.
	(unmarshall): Add std::tuple overloads.
	(callback): Remove.
	(class invoker): New.
	* libcp1plugin.cc (plugin_init): Update.
	* libcp1.cc (libcp1::add_callbacks): Update.
	* libcc1plugin.cc (plugin_init): Update.
	* libcc1.cc (libcc1::add_callbacks): Update.
	* connection.cc (cc1_plugin::connection::do_wait): Update.



</pre>
</div>
</content>
</entry>
<entry>
<title>libcc1: share the GCC interface code</title>
<updated>2021-05-05T06:06:18+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tom@tromey.com</email>
</author>
<published>2021-05-04T21:26:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=a8deb8323b98fbf4c4779de4b326de72ba22469b'/>
<id>a8deb8323b98fbf4c4779de4b326de72ba22469b</id>
<content type='text'>
Both the C and C++ side of the GDB plugin in libcc1 share a lot of
code relating to the base GCC interface.  It was all copy-and-pasted,
but is essentially identical between the two.  This is by design, as
the base GCC API is intended to be shared.

This patch merges the implementations into base_gdb_plugin, which was
introduced earlier for this purpose.

libcc1

	* libcp1.cc (libcp1): Change parameters.  Update.
	(libcp1_set_verbose, libcp1_set_arguments)
	(libcp1_set_triplet_regexp, libcp1_set_driver_filename)
	(libcp1_set_source_file, libcp1_set_print_callback, fork_exec)
	(libcp1_compile, libcp1_destroy, vtable): Remove.
	(libcp1::add_callbacks): New method, extracted from
	libcp1_compile.
	(gcc_c_fe_context): Update.
	* libcc1.cc (libcc1): Change parameters.  Update.
	(libcc1_set_verbose, libcc1_set_arguments)
	(libcc1_set_triplet_regexp, libcc1_set_driver_filename)
	(libcc1_set_source_file, libcc1_set_print_callback, fork_exec)
	(libcc1_compile, libcc1_destroy, vtable): Remove.
	(libcc1::add_callbacks): New method, extracted from
	libcc1_compile.
	(gcc_c_fe_context): Update.
	* gdbctx.hh (base_gdb_plugin): Change parameters.
	(~base_gdb_plugin): New.
	&lt;add_callbacks&gt;: New virtual method.
	&lt;plugin_name, fe_version, compiler_name, vtable&gt;: New members.
	(get_self, do_set_verbose, do_set_arguments)
	(do_set_triplet_regexp, do_set_driver_filename)
	(do_set_arguments_v0, do_set_source_file, do_set_print_callback)
	(fork_exec, do_compile, do_compile_v0, do_destroy): New methods.



</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both the C and C++ side of the GDB plugin in libcc1 share a lot of
code relating to the base GCC interface.  It was all copy-and-pasted,
but is essentially identical between the two.  This is by design, as
the base GCC API is intended to be shared.

This patch merges the implementations into base_gdb_plugin, which was
introduced earlier for this purpose.

libcc1

	* libcp1.cc (libcp1): Change parameters.  Update.
	(libcp1_set_verbose, libcp1_set_arguments)
	(libcp1_set_triplet_regexp, libcp1_set_driver_filename)
	(libcp1_set_source_file, libcp1_set_print_callback, fork_exec)
	(libcp1_compile, libcp1_destroy, vtable): Remove.
	(libcp1::add_callbacks): New method, extracted from
	libcp1_compile.
	(gcc_c_fe_context): Update.
	* libcc1.cc (libcc1): Change parameters.  Update.
	(libcc1_set_verbose, libcc1_set_arguments)
	(libcc1_set_triplet_regexp, libcc1_set_driver_filename)
	(libcc1_set_source_file, libcc1_set_print_callback, fork_exec)
	(libcc1_compile, libcc1_destroy, vtable): Remove.
	(libcc1::add_callbacks): New method, extracted from
	libcc1_compile.
	(gcc_c_fe_context): Update.
	* gdbctx.hh (base_gdb_plugin): Change parameters.
	(~base_gdb_plugin): New.
	&lt;add_callbacks&gt;: New virtual method.
	&lt;plugin_name, fe_version, compiler_name, vtable&gt;: New members.
	(get_self, do_set_verbose, do_set_arguments)
	(do_set_triplet_regexp, do_set_driver_filename)
	(do_set_arguments_v0, do_set_source_file, do_set_print_callback)
	(fork_exec, do_compile, do_compile_v0, do_destroy): New methods.



</pre>
</div>
</content>
</entry>
<entry>
<title>libcc1: share GDB plugin code</title>
<updated>2021-05-05T06:06:17+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tom@tromey.com</email>
</author>
<published>2021-05-04T21:26:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=1a51cb299070920280d4d38c6a59788c0c621658'/>
<id>1a51cb299070920280d4d38c6a59788c0c621658</id>
<content type='text'>
The two GDB plugins in libcc1 share a fair amount of code.  This was
done by copy-and-paste, though in reality the underlying code is
nearly identical.

libcc1

	* libcp1.cc (struct libcp1): Derive from base_gdb_plugin.  Remove
	shared code.
	(class libcp1_connection): Remove.
	(rpc): Remove.
	(libcp1_set_verbose, libcp1_compile): Update.
	(cp_call_binding_oracle, cp_call_symbol_address)
	(cp_call_enter_scope, cp_call_leave_scope): Update.
	* libcc1.cc (struct libcc1): Derive from base_gdb_plugin.  Remove
	shared code.
	(class libcc1_connection): Remove.
	(c_call_binding_oracle, c_call_symbol_address): Update.
	(rpc): Remove.
	(libcc1_set_verbose, libcc1_compile): Update.
	* gdbctx.hh: New file.



</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The two GDB plugins in libcc1 share a fair amount of code.  This was
done by copy-and-paste, though in reality the underlying code is
nearly identical.

libcc1

	* libcp1.cc (struct libcp1): Derive from base_gdb_plugin.  Remove
	shared code.
	(class libcp1_connection): Remove.
	(rpc): Remove.
	(libcp1_set_verbose, libcp1_compile): Update.
	(cp_call_binding_oracle, cp_call_symbol_address)
	(cp_call_enter_scope, cp_call_leave_scope): Update.
	* libcc1.cc (struct libcc1): Derive from base_gdb_plugin.  Remove
	shared code.
	(class libcc1_connection): Remove.
	(c_call_binding_oracle, c_call_symbol_address): Update.
	(rpc): Remove.
	(libcc1_set_verbose, libcc1_compile): Update.
	* gdbctx.hh: New file.



</pre>
</div>
</content>
</entry>
<entry>
<title>libcc1: unify compiler handling</title>
<updated>2021-05-05T06:06:17+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tom@tromey.com</email>
</author>
<published>2021-05-04T21:26:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=1d9c9726013d006ec91f95423aa16457dfe2a2f9'/>
<id>1d9c9726013d006ec91f95423aa16457dfe2a2f9</id>
<content type='text'>
Both libcc1 plugins have nearly identical copies of code to find the
underlying compiler.  This seemed wasteful to me, so this patch
unifies the copies.

Two minor API changes were needed.

First, the old code used a back-link from the compiler object to the
plugin object to check the 'verbose' setting.  This patch adds a
'verbose' setting directly to the compiler object instead.

Second, the 'find' method implicitly knew which compiler base name
("gcc" or "g++") to use.  This patch makes this a parameter that is
passed in by the plugin.

libcc1

	* libcp1.cc (compiler, compiler_triplet_regexp)
	(compiler_driver_filename): Remove.
	(libcp1::libcp1): Update.
	(make_regexp, libcp1::compiler::find)
	(libcp1::compiler_triplet_regexp::find)
	(libcp1::compiler_driver_filename::find): Remove.
	(libcp1_set_verbose, libcp1_set_arguments)
	(libcp1_set_triplet_regexp, libcp1_set_driver_filename): Update.
	* libcc1.cc (compiler, compiler_triplet_regexp)
	(compiler_driver_filename): Remove.
	(libcc1::libcc1): Update.
	(make_regexp, libcc1::compiler::find)
	(libcc1::compiler_triplet_regexp::find)
	(libcc1::compiler_driver_filename::find): Remove.
	(libcc1_set_verbose, libcc1_set_arguments)
	(libcc1_set_triplet_regexp, libcc1_set_driver_filename): Update.
	* compiler.cc: New file.
	* compiler.hh: New file.
	* Makefile.in: Rebuild.
	* Makefile.am (libcc1_la_SOURCES): Add compiler.hh, compiler.cc.


</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both libcc1 plugins have nearly identical copies of code to find the
underlying compiler.  This seemed wasteful to me, so this patch
unifies the copies.

Two minor API changes were needed.

First, the old code used a back-link from the compiler object to the
plugin object to check the 'verbose' setting.  This patch adds a
'verbose' setting directly to the compiler object instead.

Second, the 'find' method implicitly knew which compiler base name
("gcc" or "g++") to use.  This patch makes this a parameter that is
passed in by the plugin.

libcc1

	* libcp1.cc (compiler, compiler_triplet_regexp)
	(compiler_driver_filename): Remove.
	(libcp1::libcp1): Update.
	(make_regexp, libcp1::compiler::find)
	(libcp1::compiler_triplet_regexp::find)
	(libcp1::compiler_driver_filename::find): Remove.
	(libcp1_set_verbose, libcp1_set_arguments)
	(libcp1_set_triplet_regexp, libcp1_set_driver_filename): Update.
	* libcc1.cc (compiler, compiler_triplet_regexp)
	(compiler_driver_filename): Remove.
	(libcc1::libcc1): Update.
	(make_regexp, libcc1::compiler::find)
	(libcc1::compiler_triplet_regexp::find)
	(libcc1::compiler_driver_filename::find): Remove.
	(libcc1_set_verbose, libcc1_set_arguments)
	(libcc1_set_triplet_regexp, libcc1_set_driver_filename): Update.
	* compiler.cc: New file.
	* compiler.hh: New file.
	* Makefile.in: Rebuild.
	* Makefile.am (libcc1_la_SOURCES): Add compiler.hh, compiler.cc.


</pre>
</div>
</content>
</entry>
</feed>
