From ed651fcdec170456f7460703edbd0ca5901f0026 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Thu, 15 Apr 2021 14:37:24 +0100 Subject: Add basic wrapper over gcc rich_location Adding rich location will improve our error message diagnostics, this is an initial building block to keep a wrapper over the GCC stuff we call. Addresses: #97 --- gcc/rust/rust-diagnostics.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/rust/rust-diagnostics.h') diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h index c67e3d4..d861267 100644 --- a/gcc/rust/rust-diagnostics.h +++ b/gcc/rust/rust-diagnostics.h @@ -48,6 +48,7 @@ // All other format specifiers are as defined by 'sprintf'. The final resulting // message is then sent to the back end via rust_be_error_at/rust_be_warning_at. +// simple location extern void rust_error_at (const Location, const char *fmt, ...) RUST_ATTRIBUTE_GCC_DIAG (2, 3); @@ -61,6 +62,11 @@ extern void rust_inform (const Location, const char *fmt, ...) RUST_ATTRIBUTE_GCC_DIAG (2, 3); +// rich locations +extern void +rust_error_at (const RichLocation, const char *fmt, ...) + RUST_ATTRIBUTE_GCC_DIAG (2, 3); + // These interfaces provide a way for the front end to ask for // the open/close quote characters it should use when formatting // diagnostics (warnings, errors). @@ -78,6 +84,8 @@ rust_close_quote (); extern void rust_be_error_at (const Location, const std::string &errmsg); extern void +rust_be_error_at (const RichLocation, const std::string &errmsg); +extern void rust_be_warning_at (const Location, int opt, const std::string &warningmsg); extern void rust_be_fatal_error (const Location, const std::string &errmsg); -- cgit v1.1