libabigail/tests/data/test-bidiff/test-struct1-report.txt

34 lines
1.0 KiB
Plaintext
Raw Normal View History

Support looking through decl-only classes and update diff reports accordingly * include/abg-comparison.h (class diff_context): New class. (class diff::{ctxt_, reported_once_, currently_reporting_}): New data members. (diff::diff): Initialize the new data members above. (diff::{context, currently_reporting, reported_once}): New accessors. (compute_diff, var_diff::var_diff, pointer_diff::pointer_diff) (reference_diff::reference_diff, qualified_type_diff) (enum_diff:enum_diff, class_diff::class_diff) (scope_diff::scope_diff, function_decl_diff::function_decl_diff) (type_decl_diff::type_decl_diff, typedef_diff::typedef_diff) (translation_unit_diff::translation_unit_diff, corpus_diff::corpus_diff): Take an additional pointer to diff_context. * abg-comparison.cc (diff_context::{has_diff_for, has_diff_for_types, add_diff}): New methods. (try_to_diff, compute_diff_for_types, compute_diff_for_decls) (represent): Take an additional pointer to diff_context in argument. In the later function, do not re-report a diff if it has already been reported, or if it's being reported already. (var_diff::var_diff, pointer_diff::pointer_diff) (reference_diff::reference_diff) (qualified_type_diff::qualified_type_diff, enum_diff::enum_diff) (class_diff::class_diff, scope_diff::scope_diff) (function_decl_diff::function_decl_diff, type_decl::type_decl) (typedef_diff::typedef_diff) (translation_unit_diff::translation_unit_diff) (corpus_diff::corpus_diff): Take an additional pointer to diff_context in argument. ({pointer_diff, qualified_type_diff, reference_type_diff}::report): do not re-report a diff about the underlying type if it has already been reported, or if it's being reported already. (enum_diff::report): Fix this to properly use the populated lookup tables. (compute_diff): take an additional pointer to diff_context in argument. For the var_decl, pointer_diff reference_type_diff, qualified_type_diff enum_diff, scope_diff, function_decl_diff, type_decl_diff and typedef_diff overloads, do not re-build a diff object, if one exits already. Otherwise, record the new diff object created so that it can be re-used later. (enum_diff::ensure_lookup_tables_populated): Fix logic to avoid one loop. (class_decl::priv::{deleted_member_functions_, inserted_member_functions_, changed_member_function_}): New members to support reporting about member functions changes. (class_decl::{lookup_tables_empty, clear_lookup_tables, length): Update for the new additions above. (class_decl::ensure_lookup_tables_populated): Likewise. Fix to properly use the lookup tables and also avoid a going through several loops to compute the changed members. (class_decl::report): Flip a switch to make the beginning and end of the reporting, in the context. Also, do not try to report again, if we were already reporting this diff. Fix quite some spots to properly use the lookup tables. (scope_diff::ensure_lookup_tables_populated): Skip decl-only classes during comparison. Fix some thinkos. Fix logic to avoid a loop. (scope_diff::report): Adjust to pass a context to compute_diff_for_types. (function_decl_diff::ensure_lookup_tables_populated): Fix logic to avoid a loop. (function_decl_diff::report): Adjust call to compute_diff_for_types to pass the context. (typedef::report): Avoid re-reporting the diff of the underlying types, if we are already reporting it. (corpus_diff::priv::ensure_lookup_tables_populated): Use the pretty representation of the function rather than its name to key the maps of deleted and added functions. Fix logic to avoid going through an additional loop for the changed functions. (corpus_diff::report): Add a title for removed/added/changed functions. Fix indentation for added/removed/changed functions. * include/abg-ir.h (class_decl::comparison_started_): New member * src/abg-dwarf-reader.cc (is_public_decl): Style fix. (is_declaration_only_): New static function. (build_class_type_and_add_to_ir): Create decl-only classes (IR) for classes flagged as declaration-only in the DWARF. * src/abg-hash.cc (class_decl::hash::operator()): Do not forget to include the "is_declaration_only" flag into the hashing. * src/abg-ir.cc (class_decl::operator==): Look through decl-only classes to get their definitions and compare the definitions instead. Avoid comparing member types and fns if the comparison of this type has already started. * src/abg-reader.cc (build_class_decl): Set the definition of a declaration, when we see it. * tests/data/test-bidiff/test-qual-type0-report.txt: Update. * tests/data/test-bidiff/test-struct0-report.txt: Likewise. * tests/data/test-bidiff/test-struct1-report.txt: Likewise. signed-off-by: Dodji Seketeli <dodji@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-02-07 17:52:45 +00:00
5 changed types:
'const s0' changed:
in unqualified underlying type 'class s0':
size changed from 192 to 256 bits
1 data member deletion:
'char s0::m1', at offset 96 (in bits)
2 data member changes:
'unsigned int s0::m2' offset changed from 128 to 192
type of 'int s0::m0' changed:
name changed from 'int' to 'char'
size changed from 32 to 8 bits
alignment changed from 32 to 8 bits
1 data member insertion:
'double s0::m01', at offset 128 (in bits)
1 member function insertion:
'method int s0::foo(int, char) const', virtual at voffset 2/2
Support looking through decl-only classes and update diff reports accordingly * include/abg-comparison.h (class diff_context): New class. (class diff::{ctxt_, reported_once_, currently_reporting_}): New data members. (diff::diff): Initialize the new data members above. (diff::{context, currently_reporting, reported_once}): New accessors. (compute_diff, var_diff::var_diff, pointer_diff::pointer_diff) (reference_diff::reference_diff, qualified_type_diff) (enum_diff:enum_diff, class_diff::class_diff) (scope_diff::scope_diff, function_decl_diff::function_decl_diff) (type_decl_diff::type_decl_diff, typedef_diff::typedef_diff) (translation_unit_diff::translation_unit_diff, corpus_diff::corpus_diff): Take an additional pointer to diff_context. * abg-comparison.cc (diff_context::{has_diff_for, has_diff_for_types, add_diff}): New methods. (try_to_diff, compute_diff_for_types, compute_diff_for_decls) (represent): Take an additional pointer to diff_context in argument. In the later function, do not re-report a diff if it has already been reported, or if it's being reported already. (var_diff::var_diff, pointer_diff::pointer_diff) (reference_diff::reference_diff) (qualified_type_diff::qualified_type_diff, enum_diff::enum_diff) (class_diff::class_diff, scope_diff::scope_diff) (function_decl_diff::function_decl_diff, type_decl::type_decl) (typedef_diff::typedef_diff) (translation_unit_diff::translation_unit_diff) (corpus_diff::corpus_diff): Take an additional pointer to diff_context in argument. ({pointer_diff, qualified_type_diff, reference_type_diff}::report): do not re-report a diff about the underlying type if it has already been reported, or if it's being reported already. (enum_diff::report): Fix this to properly use the populated lookup tables. (compute_diff): take an additional pointer to diff_context in argument. For the var_decl, pointer_diff reference_type_diff, qualified_type_diff enum_diff, scope_diff, function_decl_diff, type_decl_diff and typedef_diff overloads, do not re-build a diff object, if one exits already. Otherwise, record the new diff object created so that it can be re-used later. (enum_diff::ensure_lookup_tables_populated): Fix logic to avoid one loop. (class_decl::priv::{deleted_member_functions_, inserted_member_functions_, changed_member_function_}): New members to support reporting about member functions changes. (class_decl::{lookup_tables_empty, clear_lookup_tables, length): Update for the new additions above. (class_decl::ensure_lookup_tables_populated): Likewise. Fix to properly use the lookup tables and also avoid a going through several loops to compute the changed members. (class_decl::report): Flip a switch to make the beginning and end of the reporting, in the context. Also, do not try to report again, if we were already reporting this diff. Fix quite some spots to properly use the lookup tables. (scope_diff::ensure_lookup_tables_populated): Skip decl-only classes during comparison. Fix some thinkos. Fix logic to avoid a loop. (scope_diff::report): Adjust to pass a context to compute_diff_for_types. (function_decl_diff::ensure_lookup_tables_populated): Fix logic to avoid a loop. (function_decl_diff::report): Adjust call to compute_diff_for_types to pass the context. (typedef::report): Avoid re-reporting the diff of the underlying types, if we are already reporting it. (corpus_diff::priv::ensure_lookup_tables_populated): Use the pretty representation of the function rather than its name to key the maps of deleted and added functions. Fix logic to avoid going through an additional loop for the changed functions. (corpus_diff::report): Add a title for removed/added/changed functions. Fix indentation for added/removed/changed functions. * include/abg-ir.h (class_decl::comparison_started_): New member * src/abg-dwarf-reader.cc (is_public_decl): Style fix. (is_declaration_only_): New static function. (build_class_type_and_add_to_ir): Create decl-only classes (IR) for classes flagged as declaration-only in the DWARF. * src/abg-hash.cc (class_decl::hash::operator()): Do not forget to include the "is_declaration_only" flag into the hashing. * src/abg-ir.cc (class_decl::operator==): Look through decl-only classes to get their definitions and compare the definitions instead. Avoid comparing member types and fns if the comparison of this type has already started. * src/abg-reader.cc (build_class_decl): Set the definition of a declaration, when we see it. * tests/data/test-bidiff/test-qual-type0-report.txt: Update. * tests/data/test-bidiff/test-struct0-report.txt: Likewise. * tests/data/test-bidiff/test-struct1-report.txt: Likewise. signed-off-by: Dodji Seketeli <dodji@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-02-07 17:52:45 +00:00
's0*' changed:
pointed to type 'class s0' changed, as reported earlier
'class s0' changed:
details were reported earlier
's0&' changed:
referenced type 'class s0' changed, as reported earlier
'const s0*' changed:
in pointed to type 'const s0':
unqualified underlying type class s0 changed, as reported earlier
'function int bar(s0&)' was removed
'function int baz(s0&)' was added