mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-19 07:40:46 +00:00
0fd7565d06
v2: More code simplification. Tests unchanged. There is distributed responsibility for horizontal and vertical whitespace in the reporting code with indent and new line control information being manipulated by and passed in and out of functions. Occasionally, this information is ignored or incorrect and the code tends to err on the side of more rather than fewer new lines. The outcome is that abidiff output sometimes contains extra blank lines which can be confusing. This patch eliminates some of the more obvious cases: - after data member deletions - in enumerator change lists - after "type size hasn't changed" - before listing impacted interfaces A lot of passing of "new line needed" booleans between functions has been eliminated in the process. The patch cleans up the reporting of data members. The code will either emit indentation, a short description and a new line or do nothing at all. The patch also removes some stray location reporting code for array diffs which would have produced some oddly placed output. I could not get this code to trigger as loc = decl->get_location() was never present on the array decls in question. * src/abg-default-reporter.cc (report): In the type_decl_diff, enum_diff, array_diff, class_diff, union_diff and var_diff overrides, simplify new line logic which no longer needs to be threaded through report_name_size_and_alignment_changes. In the distinct_diff override, simplify new line logic which no longer needs to be threaded through report_size_and_alignment_changes. In the enum_diff override, emit just one blank line after each enum. In the array_diff override, remove stray location reporting which doesn't appear to ever trigger; fix new line logic. In the class_or_union_diff override, simplify new line logic for deleted members; pass indentation to represent_data_member. * src/abg-leaf-reporter.cc (report): In the array_diff, class_diff, union_diff and var_diff overrides, simplify new line logic which no longer needs to be threaded through report_name_size_and_alignment_changes. In the distinct_diff override, simplify new line logic which no longer needs to be threaded through report_size_and_alignment_changes. In the array_diff override, remove stray location reporting which doesn't appear to ever trigger; fix new line handling. In the class_or_union_diff override, simplify new line logic for deleted members; pass indentation to represent_data_member. In the corpus_diff override, tabify source indentation. * src/abg-reporter-priv.cc (represent_data_member): Handle indentation; fix new line logic. (report_size_and_alignment_changes): Fix new line logic for "type size hasn't changed" message; simplify new line logic and replace local bool n with argument bool nl for clarity. (report_size_and_alignment_changes): Remove bool nl argument and associated code as it had become always false; take responsibility for emitting terminating new lines and change return type to void. (report_name_size_and_alignment_changes): Fix new line logic; remove bool nl argument and associated code as it had become always false; take responsibility for emitting terminating new lines and change return type to void. (maybe_report_interfaces_impacted_by_diff) In both overrides, remove new line prefix code and new_line_prefix argument. * src/abg-reporter-priv.h (represent_data_member): Add indent argument. (report_size_and_alignment_changes) Remove bool nl argument; change return type to void. (report_name_size_and_alignment_changes) Remove bool nl argument; change return type to void. (maybe_report_interfaces_impacted_by_diff) In both overrides, remove new_line_prefix argument. * tests/data/test-*/*report*.txt: Remove some blank lines. Signed-off-by: Giuliano Procida <gprocida@google.com>
16 lines
509 B
Plaintext
16 lines
509 B
Plaintext
variables defined in library 'libtest6-var-changed-libapp-v1.so'
|
|
have sub-types that are different from what application 'test6-var-changed-app' expects:
|
|
|
|
S0* bar:
|
|
in pointed to type 'struct S0':
|
|
type size changed from 32 to 64 (in bits)
|
|
1 data member insertion:
|
|
'char S0::m1', at offset 32 (in bits)
|
|
|
|
S1* foo:
|
|
in pointed to type 'struct S1':
|
|
type size changed from 64 to 32 (in bits)
|
|
1 data member deletion:
|
|
'unsigned char S1::m1', at offset 32 (in bits)
|
|
|