From 1703a30dec2695e7a5f1b81c633ac4c63479d9dd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Nov 2022 12:04:38 +0200 Subject: Allow passing fail diag record to diag_buffer::close() --- libbuild2/cc/compile-rule.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index 7ccaeb4..f0854a7 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -4624,16 +4624,13 @@ namespace build2 diag_record dr; if (bad_error) - dr << error << "expected error exit status from " + dr << fail << "expected error exit status from " << x_lang << " compiler"; if (dbuf.is_open ()) - dbuf.close (move (dr)); + dbuf.close (move (dr)); // Throws if error. } - if (bad_error) - throw failed (); - // Ignore expected successes (we are done). // if (!restart && psrc) @@ -4731,10 +4728,9 @@ namespace build2 // example, because we have removed all the partially // preprocessed source files). // - bool f (force_gen_skip && *force_gen_skip == skip_count); { diag_record dr; - if (f) + if (force_gen_skip && *force_gen_skip == skip_count) { dr << fail << "inconsistent " << x_lang << " compiler behavior" << @@ -4749,12 +4745,9 @@ namespace build2 } if (dbuf.is_open ()) - dbuf.close (move (dr)); + dbuf.close (move (dr)); // Throws if error. } - if (f) - throw failed (); - restart = true; force_gen = true; force_gen_skip = skip_count; -- cgit v1.1