]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add pub-sub.{h,cc}
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 9 Jan 2026 20:54:15 +0000 (15:54 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 9 Jan 2026 20:54:15 +0000 (15:54 -0500)
commitb34dad6d185a2d1b332e07ce307938bd7a0d68d3
tree96d32bc3716196e5627b2a7272c16b34c435814e
parent1d54992fcf4156a46c5695145a1ce32962ee4874
Add pub-sub.{h,cc}

This patch introduces a publish/subscribe mechanism, allowing for
loosely-coupled senders and receivers, with strongly-typed messages
passing between them.  For example, a GCC subsystem could publish
messages about events, and a plugin could subscribe to them.

An example can be seen in the selftests.

gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Add pub-sub.o.
* pub-sub.cc: New file.
* pub-sub.h: New file.
* selftest-run-tests.cc (selftest::run_tests): Call
selftest::pub_sub_cc_tests.
* selftest.h (selftest::pub_sub_cc_tests): New decl.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/Makefile.in
gcc/pub-sub.cc [new file with mode: 0644]
gcc/pub-sub.h [new file with mode: 0644]
gcc/selftest-run-tests.cc
gcc/selftest.h