diff options
author | CohenArthur <arthur.cohen@epita.fr> | 2021-06-01 20:01:09 +0200 |
---|---|---|
committer | CohenArthur <arthur.cohen@epita.fr> | 2021-06-03 18:33:51 +0200 |
commit | 51cbf184f3bddec37011ed2970d0aff943d98ce0 (patch) | |
tree | 6dd9819095114d4efc2bfc2864846a1f0e342093 | |
parent | 324dfb828cec09f7638b48b6e25e4007b45b9cbc (diff) | |
download | gcc-51cbf184f3bddec37011ed2970d0aff943d98ce0.zip gcc-51cbf184f3bddec37011ed2970d0aff943d98ce0.tar.gz gcc-51cbf184f3bddec37011ed2970d0aff943d98ce0.tar.bz2 |
rust_debug: Expose function in header and add inline overloaded alternative
Co-authored-by: tschwinge <thomas@schwinge.name>
-rw-r--r-- | gcc/rust/rust-diagnostics.cc | 5 | ||||
-rw-r--r-- | gcc/rust/rust-diagnostics.h | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/rust/rust-diagnostics.cc b/gcc/rust/rust-diagnostics.cc index 8ec7857..27ce54e 100644 --- a/gcc/rust/rust-diagnostics.cc +++ b/gcc/rust/rust-diagnostics.cc @@ -197,11 +197,6 @@ rust_error_at (const RichLocation location, const char *fmt, ...) va_end (ap); } -// rust_debug uses normal printf formatting, not GCC diagnostic formatting. - -void -rust_debug (const Location location, const char *fmt, ...) ATTRIBUTE_PRINTF_2; - void rust_debug (const Location location, const char *fmt, ...) { diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h index 81f558a..cd9b13e 100644 --- a/gcc/rust/rust-diagnostics.h +++ b/gcc/rust/rust-diagnostics.h @@ -124,4 +124,15 @@ struct Error }; } // namespace Rust +// rust_debug uses normal printf formatting, not GCC diagnostic formatting. +void +rust_debug (const Location location, const char *fmt, ...) ATTRIBUTE_PRINTF_2; + +template <typename... Args> +inline void +rust_debug (const char *fmt, Args... args) +{ + rust_debug (Location (), fmt, args...); +} + #endif // !defined(RUST_DIAGNOSTICS_H) |