diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-17 16:53:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 16:53:30 +0000 |
commit | 498758a1c238a539b364ac2c632742a9b64ab4a5 (patch) | |
tree | 0928f7368779b2589237d6d77b464caa1b61beef /gcc/rust/rust-diagnostics.h | |
parent | f958d1717745ad66a19c346c0e4b0bba1c813e7b (diff) | |
parent | 5b8de2be3ac5250d07dad6b54b729e6e8c4da9be (diff) | |
download | gcc-498758a1c238a539b364ac2c632742a9b64ab4a5.zip gcc-498758a1c238a539b364ac2c632742a9b64ab4a5.tar.gz gcc-498758a1c238a539b364ac2c632742a9b64ab4a5.tar.bz2 |
Merge #374
374: Add basic wrapper over gcc rich_location r=philberty a=philberty
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
Fixes: #327
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/rust-diagnostics.h')
-rw-r--r-- | gcc/rust/rust-diagnostics.h | 8 |
1 files changed, 8 insertions, 0 deletions
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); |