Move selftest::test_diagnostic_context to its own header
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 2 Nov 2017 20:09:18 +0000 (20:09 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 2 Nov 2017 20:09:18 +0000 (20:09 +0000)
commitba7bfd9f049d00f41be1240adebf27e13bcac261
treeb67059978ac4433c1dd625a2b91b9cc71871a9f5
parent7c42a3675c791b2eafae4a352a7d8adbe510e027
Move selftest::test_diagnostic_context to its own header

It's useful to not rely on global_dc in selftests, so this patch
moves class selftest::test_diagnostic_context from
diagnostic-show-locus.c to a new header and source file.

gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Add selftest-diagnostic.o.
* diagnostic-show-locus.c: Include "selftest-diagnostic.h".
(class selftest::test_diagnostic_context): Move to...
* selftest-diagnostic.c: New file.
* selftest-diagnostic.h: New file.

From-SVN: r254354
gcc/ChangeLog
gcc/Makefile.in
gcc/diagnostic-show-locus.c
gcc/selftest-diagnostic.c [new file with mode: 0644]
gcc/selftest-diagnostic.h [new file with mode: 0644]