mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-15 14:34:38 +00:00
9cf76b1175
This function is used to determine whether or not type differences are "local" and is primarily used in --leaf-changes-only mode. The logic has some issues which are addressed by this patch: - Any number of points-to (*) and refers-to (& and &&) components are peeled off the types being compared, rather than checking these match in number and kind. - This peeling is done with peel_typedef_pointer_or_reference_type which also peels any number of CV qualifiers (OK) and array-of ([N]) type components (not OK). - The function sets a state variable (was_indirect_type) to modify the behaviour of downstream comparisons, but this cannot be passed through recursive calls. The effect of the indirect_type flag is to switch to comparisons by name: identically named structs don't get introspected. Arguably, a more useful behaviour for --leaf-changes-only mode would be to treat any change to a named type as non-local, except in the context of the definition of that type itself. This would be a more significant change in behaviour. * include/abg-fwd.h (types_have_similar_structure): In both overloads, add an indirect_type argument, defaulting to false. * src/abg-ir.cc (reference_type_def constructor): Tabify. (types_have_similar_structure): In both overloads, add an indirect_type argument and update documentation text. In the type_base_sptr overload, pass indirect_type in the tail call. In the type_base* overload, replace was_indirect_type with indirect_type; peel CV qualifiers and typedefs without testing as the peel function does this; replace the indiscriminate peeling of qualifier/pointer/reference/array type components with code that checks the same pointer/reference/array type component is used on each side and makes recursive calls with indirect_type set to true; pass the indirect_type argument recursively when comparing other subtypes; move the typeid check earlier, document its purpose and remove unneccessary checks after later dynamic casts; remove an always-true conditional; add a TODO for comparing array types more accurately. * tests/data/Makefile.am: Add new test case files. * tests/data/test-abidiff-exit/test-leaf-peeling-v0.cc: New test case. * tests/data/test-abidiff-exit/test-leaf-peeling-v1.cc: Ditto. * tests/data/test-abidiff-exit/test-leaf-peeling-report.txt: Ditto. * tests/test-abidiff-exit.cc: Run new test case. Signed-off-by: Giuliano Procida <gprocida@google.com> |
||
---|---|---|
.. | ||
data | ||
lib | ||
.gitignore | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestdefaultsupprspy3.sh.in | ||
runtestfedabipkgdiff.py.in | ||
runtestfedabipkgdiffpy3.sh.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-annotate.cc | ||
test-core-diff.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-ini.cc | ||
test-ir-walker.cc | ||
test-kmi-whitelist.cc | ||
test-lookup-syms.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-tools-utils.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
test-write-read-archive.cc | ||
update-test-output.py |