* src/abg-comparison.cc
(class_diff::ensure_lookup_tables_populated): Use the virtual
member functions here, not the member functions in general.
(compute_diff): Consider virtual member functions only, not
non-virtual ones.
* src/abg-ir.cc (class_decl::operator==): Do not compare
non-virtual member functions. Only compare virtual member
functions.
* tests/data/test-bidiff/test-struct1-report.txt: New test input.
* tests/data/test-diff-dwarf/test0-report.txt: New test input.
* tests/data/test-diff-filter/test0-report.txt: New test input.
* tests/data/test-diff-filter/test01-report.txt: New test input.
* tests/data/test-diff-filter/test10-report.txt: New test input.
* tests/data/test-diff-filter/test11-report.txt: New test input.
* tests/data/test-diff-filter/test2-report.txt: New test input.
* tests/data/test-diff-filter/test9-report.txt: New test input.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc
(function_decl_diff::ensure_lookup_tables_populated): A parm
change is valid only when the added parm has a different name from
the removed parm. Both have the same index, of course. In that
case, do not try to remove the corresponding parm sub-type change.
* tests/data/test-bidiff/test-enum0-report.txt: Adjust.
* tests/data/test-bidiff/test-enum1-report.txt: Adjust.
* tests/data/test-bidiff/test-qual-type0-report.txt: Adjust.
* tests/data/test-bidiff/test-struct0-report.txt: Adjust.
* tests/data/test-diff-dwarf/test0-report.txt: Adjust.
* tests/data/test-diff-dwarf/test1-report.txt: Adjust.
* tests/data/test-diff-filter/test0-report.txt: Adjust.
* tests/data/test-diff-filter/test01-report.txt: Adjust.
* tests/data/test-diff-filter/test1-report.txt: Adjust.
* tests/data/test-diff-filter/test2-report.txt: Adjust.
* tests/data/test-diff-filter/test3-report.txt: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.h (compute_diff): For class_decl_sptr, do not
compare member types and member class templates. This adds a lots
of noise that is not necessarily useful for now.
* tests/data/test-bidiff/test-qual-type0-report.txt: Update tests.
* 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>
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:#️⃣: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>