diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-03 16:45:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 16:45:42 +0000 |
commit | 432c5f9c650f81500007a51480ae13bfc68f77b1 (patch) | |
tree | 8c3b13195bc095b723148da6e6c040839aa3c6ef /gcc/rust/rust-lang.cc | |
parent | 4414e8a4c21779f4e7a236532f696cf32cb2e1f3 (diff) | |
parent | 665df329a2ad60580ab593f6cbd646aa55927a37 (diff) | |
download | gcc-432c5f9c650f81500007a51480ae13bfc68f77b1.zip gcc-432c5f9c650f81500007a51480ae13bfc68f77b1.tar.gz gcc-432c5f9c650f81500007a51480ae13bfc68f77b1.tar.bz2 |
Merge #466
466: Expose rust debug and use it r=tschwinge a=CohenArthur
Fixes #464
@philberty I've checked and rust_debug does output on stderr correctly :)
This PR exposes the rust_debug prototype and replaces debug printfs (`fprintf (stderr, ...)`) with calls to rust_debug. This also removes the extra newlines that were added at the end of the fprintf format strings, since calling rust_debug already adds one. Without this, the tests fail due to blank lines in the output.
I have used a template to overload the rust_debug function and pass variadic arguments to the complete version. While the code looks cleaner than using `va_args`, it's also heavier C++. I'm open to changing it and definitely not attached to this implementation.
Most of the PR was made using sed and then clang-format
Co-authored-by: CohenArthur <arthur.cohen@epita.fr>
Diffstat (limited to 'gcc/rust/rust-lang.cc')
-rw-r--r-- | gcc/rust/rust-lang.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc index a6fd48a..4b139ef 100644 --- a/gcc/rust/rust-lang.cc +++ b/gcc/rust/rust-lang.cc @@ -31,6 +31,7 @@ #include "convert.h" #include "langhooks.h" #include "langhooks-def.h" +#include "rust-diagnostics.h" #include <mpfr.h> // note: header files must be in this order or else forward declarations don't @@ -165,7 +166,7 @@ grs_langhook_init_options_struct (struct gcc_options * /* opts */) static void grs_langhook_parse_file (void) { - fprintf (stderr, "Preparing to parse files. \n"); + rust_debug ("Preparing to parse files. "); session.parse_files (num_in_fnames, in_fnames); } |