diff options
author | David Malcolm <dmalcolm@redhat.com> | 2022-07-21 18:35:01 -0400 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-08-29 10:28:13 +0200 |
commit | 05f1f87274a4ed13c0ab84de77d4253776b46637 (patch) | |
tree | 2b498c2b8ef5c7225191aa78a15ea916472862a2 | |
parent | 64c7a90934f03630356c76d7aa9ba6978ee4e9e6 (diff) | |
download | gcc-05f1f87274a4ed13c0ab84de77d4253776b46637.zip gcc-05f1f87274a4ed13c0ab84de77d4253776b46637.tar.gz gcc-05f1f87274a4ed13c0ab84de77d4253776b46637.tar.bz2 |
diagnostics: add error_meta
-rw-r--r-- | gcc/diagnostic-core.h | 3 | ||||
-rw-r--r-- | gcc/diagnostic.cc | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/diagnostic-core.h b/gcc/diagnostic-core.h index 286954a..ff74994 100644 --- a/gcc/diagnostic-core.h +++ b/gcc/diagnostic-core.h @@ -92,6 +92,9 @@ extern void error_n (location_t, unsigned HOST_WIDE_INT, const char *, extern void error_at (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); extern void error_at (rich_location *, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); +extern void error_meta (rich_location *, const diagnostic_metadata &, + const char *, ...) + ATTRIBUTE_GCC_DIAG(3,4); extern void fatal_error (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3) ATTRIBUTE_NORETURN; /* Pass one of the OPT_W* from options.h as the second parameter. */ diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index 22f7b0b..0461b32 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -2050,6 +2050,21 @@ error_at (rich_location *richloc, const char *gmsgid, ...) va_end (ap); } +/* Same as above, but with metadata. */ + +void +error_meta (rich_location *richloc, const diagnostic_metadata &metadata, + const char *gmsgid, ...) +{ + gcc_assert (richloc); + + auto_diagnostic_group d; + va_list ap; + va_start (ap, gmsgid); + diagnostic_impl (richloc, &metadata, -1, gmsgid, &ap, DK_ERROR); + va_end (ap); +} + /* "Sorry, not implemented." Use for a language feature which is required by the relevant specification but not implemented by GCC. An object file will not be produced. */ |