From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3bNSAXggKChMz8A7v1wtz77z4x.v7541utu1zt14B7DAvxFtAx.7Az@flex--gprocida.bounces.google.com> Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by sourceware.org (Postfix) with ESMTPS id 074CF385B835 for ; Sun, 29 Mar 2020 17:01:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 074CF385B835 Received: by mail-yb1-xb4a.google.com with SMTP id c133so1550581ybb.19 for ; Sun, 29 Mar 2020 10:01:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=yr6irPLcWW/g3+4ZjdIhxK+1EIYpXi0n9SR9Y2bUmSo=; b=i79axVaYc0Tr+Vf60tZ9SK/DKOidFq0t8G7vE4pWS8i0039B0wYunTDmbes2L33Bx0 nbqdHEJIA2cOxm81szzidZxwlTrNxEN04i/7pT/SXjSHx94vt3jDg33NBy+bLYKi0YnE ZuNbZjZ7aRBn07nvGS0wL3HybTBe0QT7K1DnXZ55MMR8UnUwOP78sAE263VgsgQ+7q2q uwW6En4raIQAsK6qjf5ku3hUGMnneYVJVRw3klOkASoD99km6FMaTd0Hm7Q+NFUNrLw2 rJRej47mmxOfVbX8kBh64Quaze7RreuA5GYZkfjdNkScqE6GaaTqnWKaiUM1MOUInirS wXqg== X-Gm-Message-State: ANhLgQ1r5v/7d6NLF1Ubc8pFkMG+UhqdhNaOKk9Gl15oLmCAN0VhTBHl +XSGxXEBtAEI7s1nYtn3TRqCs1xpPdz12cJbBOSCYHUQxyN8WgYrqZFNjZDj3fwpqrx1OXT6x4l HbeQ1aLQ3t3IXcloyo5/w8mt/S7jitTm/Ho6dLt72cwEWr51S/A/HfHwdRx3cws5gRxhK9gM= X-Google-Smtp-Source: ADFU+vvvT85fZHiPBVFBzjdjqUMEwQ/eeI4cb78rUj2p/wTIl0eEepBWMhuM0Zq3C0POMyw7iyJJj9FA4coXTw== X-Received: by 2002:a25:3387:: with SMTP id z129mr14159317ybz.339.1585501292103; Sun, 29 Mar 2020 10:01:32 -0700 (PDT) Date: Sun, 29 Mar 2020 18:01:19 +0100 Message-Id: <20200329170121.188147-1-gprocida@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog Subject: [PATCH 1/3] abidiff: Remove blank line after typedef changes. From: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com, maennich@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-34.1 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2020 17:01:36 -0000 This patch removes perhaps the last remaining cause of double blank lines in output. The state variable emit_nl was being set to true just after emitting a new line which resulted in a blank line after every local typedef change report. * include/abg-reporter.h (default_reporter::report_local_typedef_changes): Change return type to void. * src/abg-default-reporter.cc: (default_reporter::report_local_typedef_changes): Change return type to void, remove emit_nl state variable and logic. * tests/data/test-abidiff/test-PR18791-report0.txt: Remove blank lines. * tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt: Ditto. * tests/data/test-diff-suppr/test39-opaque-type-report-0.txt: Ditto. Signed-off-by: Giuliano Procida --- include/abg-reporter.h | 2 +- src/abg-default-reporter.cc | 18 +++--------------- .../data/test-abidiff/test-PR18791-report0.txt | 1 - .../test42-PR21296-clanggcc-report0.txt | 3 --- .../test39-opaque-type-report-0.txt | 1 - 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/include/abg-reporter.h b/include/abg-reporter.h index b1ae88d1..6254be6a 100644 --- a/include/abg-reporter.h +++ b/include/abg-reporter.h @@ -170,7 +170,7 @@ public: report(const enum_diff& d, ostream& out, const string& indent =3D "") const; =20 - bool + void report_local_typedef_changes(const typedef_diff &d, ostream& out, const string& indent) const; diff --git a/src/abg-default-reporter.cc b/src/abg-default-reporter.cc index d2ac4a58..ff7ed67e 100644 --- a/src/abg-default-reporter.cc +++ b/src/abg-default-reporter.cc @@ -183,18 +183,14 @@ default_reporter::report(const enum_diff& d, ostream&= out, /// @param out the output stream to report to. /// /// @param indent the white space string to use for indentation. -/// -/// @return true iff the caller needs to emit a newline to the output -/// stream before emitting anything else. -bool +void default_reporter::report_local_typedef_changes(const typedef_diff &d, ostream& out, const string& indent) const { if (!d.to_be_reported()) - return false; + return; =20 - bool emit_nl =3D false; typedef_decl_sptr f =3D d.first_typedef_decl(), s =3D d.second_typedef_d= ecl(); =20 maybe_report_diff_for_member(f, s, d.context(), out, indent); @@ -211,10 +207,7 @@ default_reporter::report_local_typedef_changes(const t= ypedef_diff &d, << s->get_qualified_name(); report_loc_info(s, *d.context(), out); out << "\n"; - emit_nl =3D true; } - - return emit_nl; } =20 /// Reports the difference between the two subjects of the diff in a @@ -235,7 +228,7 @@ default_reporter::report(const typedef_diff& d, =20 typedef_decl_sptr f =3D d.first_typedef_decl(), s =3D d.second_typedef_d= ecl(); =20 - bool emit_nl =3D report_local_typedef_changes(d, out, indent); + report_local_typedef_changes(d, out, indent); =20 diff_sptr dif =3D d.underlying_type_diff(); if (dif && dif->has_changes()) @@ -250,7 +243,6 @@ default_reporter::report(const typedef_diff& d, report_loc_info(dif->first_subject(), *d.context(), out); out << " changed:\n"; dif->report(out, indent + " "); - emit_nl =3D false; } else { @@ -274,14 +266,10 @@ default_reporter::report(const typedef_diff& d, dif->report(out, indent + " "); if (c & REDUNDANT_CATEGORY) dif->set_category(c | REDUNDANT_CATEGORY); - emit_nl =3D false; } } } =20 - if (emit_nl) - out << "\n"; - d.reported_once(true); } =20 diff --git a/tests/data/test-abidiff/test-PR18791-report0.txt b/tests/data/= test-abidiff/test-PR18791-report0.txt index 87322587..93faf599 100644 --- a/tests/data/test-abidiff/test-PR18791-report0.txt +++ b/tests/data/test-abidiff/test-PR18791-report0.txt @@ -74,7 +74,6 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added = variable return type changed: underlying type 'typedef std::list >::iterator' changed: typedef name changed from std::list >::iterator to std::__cxx11::list >::iterator - parameter 1 of type 'const sigc::slot_base&' has sub-type changes: in referenced type 'const sigc::slot_base': unqualified underlying type 'class sigc::slot_base' changed, as re= ported earlier diff --git a/tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt= b/tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt index ff9e2841..087cfd4e 100644 --- a/tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt +++ b/tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt @@ -43,7 +43,6 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added = variable 'function std::__add_c_ref::type std::__get_helper<0ul, STR&&>(= const std::_Tuple_impl<0ul, STR&&>&) {_ZSt12__get_helperILm0EO3STRJEENSt11_= _add_c_refIT0_E4typeERKSt11_Tuple_implIXT_EJS3_DpT1_EE}' now becomes 'funct= ion std::__add_c_ref::type std::__get_helper<0, STR &&>(const std::= _Tuple_impl<0, STR &&>&) {_ZSt12__get_helperILm0EO3STRJEENSt11__add_c_refIT= 0_E4typeERKSt11_Tuple_implIXT_EJS3_DpT1_EE}' return type changed: typedef name changed from std::__add_c_ref::type to std::__ad= d_c_ref::type - parameter 1 of type 'const std::_Tuple_impl<0ul, STR&&>&' changed: in referenced type 'const std::_Tuple_impl<0ul, STR&&>': 'const std::_Tuple_impl<0ul, STR&&>' changed to 'const std::_Tuple= _impl<0, STR &&>' @@ -52,7 +51,6 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added = variable 'function std::__add_c_ref::type std::get<0ul, STR&&>(const std= ::tuple&) {_ZSt3getILm0EJO3STREENSt11__add_c_refINSt13tuple_elementI= XT_ESt5tupleIJDpT0_EEE4typeEE4typeERKS7_}' now becomes 'function std::__add= _c_ref::type std::get<0, STR &&>(const std::tuple&) {_ZSt3g= etILm0EJO3STREENSt11__add_c_refINSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4t= ypeEE4typeERKS7_}' return type changed: typedef name changed from std::__add_c_ref::type to std::__ad= d_c_ref::type - parameter 1 of type 'const std::tuple&' changed: in referenced type 'const std::tuple': 'const std::tuple' changed to 'const std::tuple' @@ -63,7 +61,6 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added = variable in referenced type 'typedef std::remove_reference::type': typedef name changed from std::remove_reference::type to std= ::remove_reference::type =20 - [C] 'method void std::tuple::tuple(STR&&)' has some indirect= sub-type changes: Please note that the symbol of this function is _ZNSt5tupleIJO3STREEC2= IJS0_ESt9true_typeEEDpOT_ and it aliases symbol: _ZNSt5tupleIJO3STREEC1IJS0_ESt9true_typeEEDpOT= _ diff --git a/tests/data/test-diff-suppr/test39-opaque-type-report-0.txt b/t= ests/data/test-diff-suppr/test39-opaque-type-report-0.txt index 7993fc08..b87ba2ae 100644 --- a/tests/data/test-diff-suppr/test39-opaque-type-report-0.txt +++ b/tests/data/test-diff-suppr/test39-opaque-type-report-0.txt @@ -8,4 +8,3 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added va= riable in pointed to type 'typedef StructType' at test39-header-v1.h:2:1: typedef name changed from StructType to AnotherStructType at test3= 9-header-v1.h:2:1 =20 - --=20 2.26.0.rc2.310.g2932bb562d-goog