libcc1: share basic context code
authorTom Tromey <tom@tromey.com>
Tue, 4 May 2021 21:26:58 +0000 (15:26 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 5 May 2021 06:06:17 +0000 (00:06 -0600)
commit0624823260f953050447a909da87f031488dba13
tree0bfb6977bc5cc58a57f2d2df6f5dea9c0f477e82
parent0ed83e1d03b4864b5f50b6a8735ed8e3a3635193
libcc1: share basic context code

Both plugins in libcc1 share a fair amount of boilerplate.  They both
share error-emission code, context management code, and tree GC code.
This patch unifies these two bodies of code, avoiding needless
duplication.

libcc1

* libcc1plugin.cc: Move code to context.cc.
* libcp1plugin.cc: Move code to context.cc.
* context.hh: New file.
* context.cc: New file.
* Makefile.in: Rebuild.
* Makefile.am (AM_CPPFLAGS): Add more gcc flags.
(CPPFLAGS_FOR_C, CPPFLAGS_FOR_CXX): Update.
(libcc1plugin_la_SOURCES): Add context.hh, context.cc.
(libcp1plugin_la_SOURCES): Likewise.
libcc1/Makefile.am
libcc1/Makefile.in
libcc1/context.cc [new file with mode: 0644]
libcc1/context.hh [new file with mode: 0644]
libcc1/libcc1plugin.cc
libcc1/libcp1plugin.cc