Commit Graph

601 Commits

Author SHA1 Message Date
Dodji Seketeli
5ebc8bf5dd Update copyright notice for tests/test-diff2.cc
* tests/test-diff2.cc: Update copyright year.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-10 13:17:35 +02:00
Dodji Seketeli
d5c4009f23 Do not crash on function_decl_diff for fns that have no symbol
* src/abg-comparison.cc (function_decl_diff::report): If a
	function decl has no associated elf symbol, do not crash while
	trying to report about its elf symbol aliases.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-09 15:31:26 +02:00
Dodji Seketeli
4bed1e9b2c Avoid broken output for virtual member fns w/o symbols
* src/abg-comparison.cc (represent): When a virtual member
	function has no associated elf symbol, do not emit garbage in lieu
	of the linkage name.  Just emit no linkage name;
	* tests/data/test-abidiff/test-struct1-report.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-09 15:31:19 +02:00
Dodji Seketeli
ed57bfdf08 Sort added/removed/changed functions reported by the comparison engine
* src/abg-comparison.cc (struct function_comp, struct
	changed_function_ptr_comp): New comparison functors.
	(sort_string_function_ptr_map)
	(sort_string_changed_function_ptr_map): Define new static
	functions.
	(corpus_diff::report): Sort the added/removed/changed functions
	that are reported.
	* tests/data/test-diff-dwarf/test0-report.txt: Adjust.
	* tests/data/test-diff-filter/test01-report.txt: Adjust.
	* tests/data/test-diff-filter/test2-report.txt: Adjust.
	* tests/data/test-diff-filter/test9-report.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 18:15:10 +02:00
Dodji Seketeli
0161504b68 Mention virtual-ness of member function in their pretty representation
* include/abg-fwd.h (get_member_function_is_virtual): Declare new
	overload for pointers.
	* src/abg-ir.cc (get_member_function_is_virtual): Define it.
	(function_decl::get_pretty_representation): Print virtual-ness of
	the function_decl being pretty printed.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 12:30:54 +02:00
Dodji Seketeli
5ede56f5f8 Do not crash when reporting diffs about virtual member fns that have no symbol
* src/abg-comparison.cc (represent): If a virtual member function
	has no symbol do not crash.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 12:29:02 +02:00
Dodji Seketeli
b9d97f21c3 Fixup member functions which virtual-ness has just been set
* include/abg-ir.h (fixup_virtual_member_function): Declare new
	function.
	(class_decl): Declare fixup_virtual_member_function() as a member.
	* src/abg-ir.cc (set_member_function_is_virtual): Ensure that the
	member function that has seen its virtualness set is also put
	correctly put in the vector of virtual member functions of its
	class.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 12:17:48 +02:00
Dodji Seketeli
59a6b48609 Assert that only decls with elf symbols are part of comparison
* src/abg-corpus.cc (corpus::priv::build_public_decl_table): Assert
	that when read from DWARF, only decls with elf symbols are part of
	the public decls table.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 10:15:00 +02:00
Dodji Seketeli
d5977429c8 Emit all virtual member functions in group
* src/abg-writer.cc (write_class_decl): Emit virtual member
	functions contiguously.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 10:13:47 +02:00
Dodji Seketeli
0c4843bc5c Always emit vtable offset for virtual member function
* src/abg-writer.cc (write_voffset): Emit the vtable offset of
	virtual function even when the offset is zero.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 10:12:40 +02:00
Dodji Seketeli
6f50d38c23 Do not forget priv_->in_pub_sym_tab_ when copying decl_base
* src/abg-ir.cc (decl_base::decl_base(const decl_base& d)): Do
	not forget to copy priv_->in_pub_sym_tab_.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 10:10:45 +02:00
Dodji Seketeli
cbf1debeab Fix reading several clones of the same member function from DWARF
* include/abg-fwd.h (set_member_function_is_ctor)
	(set_member_function_is_dtor, set_member_function_is_const)
	(set_member_function_vtable_offset): Declare new functions.
	* include/abg-ir.h (class_decl::sort_virtual_mem_fns): Declare new
	member function.
	(mem_fn_context_rel::{vtable_offset, is_constructor is_destructor,
	is_const}): Add these setters.
	(set_member_function_is_ctor, set_member_function_is_dtor)
	(set_member_function_is_static, set_member_function_is_const)
	(set_member_function_vtable_offset)
	(set_member_function_is_virtual): Declare these new friend
	function to class class_decl::method_decl.
	* src/abg-dwarf-reader.cc (finish_member_function_reading): Split
	this out from build_class_type_and_add_to_ir.  Use the new setters
	for member functions properties introduced above.
	(build_class_type_and_add_to_ir): Factorize the creation of member
	function by using build_ir_node_from_die.  Once that function has
	created the member function in a rather generic way, use the new
	finish_member_function_reading to set the remaining specific
	properties for member functions.
	(build_function_decl): When called to read additional properties
	of a function_decl, allow this to read and update the elf symbol
	properties too.  This is useful for building a clone of a function
	that already has an elf symbol.
	(build_ir_node_from_die):  When building a function decl, consider
	the case of a DIE that has both DW_AT_specification and
	DW_AT_abstract_origin set.  That is, DW_AT_abstract_origin is set,
	and the origin has DW_AT_specification set.  This is basically a
	clone of a function that implements an interface (this happens for
	destructors, for instance).  In this case, really do the cloning
	of the interface implementation.  If the cloned function happens
	to be member function, use finish_member_function_reading to read
	the properties relevant to its method-ness.
	* src/abg-ir.cc (set_member_function_is_ctor)
	(set_member_function_is_dtor, set_member_function_is_const)
	(set_member_function_vtable_offset)
	(class_decl::sort_virtual_mem_fns): Define new functions.
	(sort_virtual_member_functions): Define new static function.
	(struct virtual_member_function_less_than): New functor.
	(class_decl::add_member_function): Keep virtual member functions
	vector sorted.
	* data/test-read-dwarf/test1.abi: Adjust.  Now, both the
	cdtor specification and all the clones that implements the
	different are emitted.
	* data/test-read-dwarf/test2.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-02 10:09:23 +02:00
Dodji Seketeli
5616233cf8 Do not crash when comparing functions that have no symbol
* src/abg-comparison.cc
	(class_diff::ensure_lookup_tables_populated): Just skip functions
	that have no ELF symbol.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-01 13:49:32 +02:00
Dodji Seketeli
46dbc9ce41 Rename member_function_is_virtual to get_member_function_is_virtual
* include/abg-fwd.h (get_member_function_is_virtual): Renamed the
	declaration of member_function_is_virtual into this.
	* src/abg-ir.cc (get_member_function_is_virtual): Likewise for its
	definition.
	* include/abg-ir.h (class decl_base): Adjust the friend function
	member_function_is_virtual references.
	* src/abg-comp-filter.cc (has_virtual_mem_fn_change)
	(has_non_virtual_mem_fn_change): Adjust.
	* src/abg-comparison.cc (represent)
	(SKIP_MEM_FN_IF_VIRTUALITY_DISALLOWED, class_diff::report):
	Likewise.
	* src/abg-hash.cc (class_decl:#️⃣:operator()): Likewise.
	(function_decl::clone, class_decl::add_member_function): Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-30 18:16:03 +02:00
Dodji Seketeli
4e44ee383c Factorize a no-op deleter for shared pointer
* include/abg-sptr-utils.h (struct noop_deleter): Move this here
	from ...
	* src/abg-comparison.cc (struct noop_deleter): ... here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-30 18:04:14 +02:00
Dodji Seketeli
56ee6cdcc5 Link manuals from the main web page
* doc/website/mainpage.txt: Add a link to the manuals.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-30 17:53:35 +02:00
Dodji Seketeli
2f296a7846 Initial documentation for libabigail
* doc/manuals/Makefile: New file, generated by sphinx-quickstart.
	* doc/manuals/abidiff.rst: New manual for abidiff.
	* doc/manuals/abidw.rst: New manual for abidw.
	* doc/manuals/abilint.rst: New manual for abilint.
	* doc/manuals/conf.py: New configuration file generated by sphinx-quickstart.
	* doc/manuals/index.rst: The root of the this documentation.
	* doc/manuals/libabigail-overview.rst: The overview of libabigail.
	* doc/manuals/tools.rst: The root of the tools manuals.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-26 17:06:12 +02:00
Dodji Seketeli
e807eb86e6 Do not install the abisym program
* tools/Makefile.am: Do not install abisym.  It's really there
	just for testing purposes and is of almost no use for generic
	users.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-26 16:14:18 +02:00
Dodji Seketeli
d041c1f5dd Rename bi* tools to abi* tools
* tests/data/test-bidiff: Rename this directory to
	tests/data/test-abidiff.
	* tests/test-bidiff.cc: Renamed this to tests/test-abidiff.cc.
	* tools/biar.cc: Renamed to tools/abiar.cc
	* tools/bidiff.cc: Renamed to tools/abidiff.cc
	* tools/bidw.cc: Renamed to tools/abidw.cc
	* tools/bilint.cc: Renamed to tools/abilint.cc
	* tools/bisym.cc: Renamed to tools/abisym.cc
	* tests/test-alt-dwarf-file.cc: Renamed references to bidw* to abidw*.
	* tests/test-diff-filter.cc: Renamed references to bidiff to abidiff.
	* tests/test-lookup-syms.cc: Renamed references to bisym to abisym.
	* tools/Makefile.am: Adjust.
	* tests/Makefile.am: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-26 10:58:16 +02:00
Dodji Seketeli
a18fd928df Light cleanup in abg-corpus.cc
* src/abg-corpus.cc
	(symtab_build_visitor_type::regex_fns_suppress): use
	sptr_utils::build_sptr, rather than building the shared_ptr of
	regex_t by hand.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-19 12:31:01 +02:00
Dodji Seketeli
368d192deb Pimplify abigail::comparison::diff type
* include/abg-comparison.h (diff::{priv, sptr}): New types.
	(diff::priv_): New member.
	(diff::*): Remove all the other previous data members and
	transform the inline member function definition into declarations
	only.
	* src/abg-comparison.cc (class diff::priv): New private data type.
	(diff::*): Define the previous inline member functions as
	out-of-line here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-19 12:28:18 +02:00
Dodji Seketeli
6a3156b5d0 Rename shared_ptr<regex_t> into regex_t_sptr
* include/abg-sptr-utils.h (build_sptr()): Rename the return type
	from shared_ptr<regex_t> to regex_t_sptr.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-19 12:27:45 +02:00
Dodji Seketeli
2ed4525f93 Fix a comment in abg-comparison.h
* include/abg-comparison.h (class base_diff): Fix comment.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-19 12:26:25 +02:00
Dodji Seketeli
edd8a04291 Light style cleanup in tools/bidiff.cc
* tools/bidiff.cc (display_usage): Remove useless space before '&'.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-19 12:25:44 +02:00
Dodji Seketeli
c08108669b src/Makefile.am cleanup
* src/Makefile.am: Remove the unused 'headers' variable.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-19 12:23:33 +02:00
Dodji Seketeli
5bce089f23 Emit reports about not-yet categorized diff nodes
* include/abg-comparison.h (NO_CHANGE_CATEGORY): Better comment
	this enumerator.
	* src/abg-comparison.cc (diff::is_filtered_out): Not-yet
	categorized changes are not filtered out anymore.
	(distinct_diff::report): Avoid extraneous new line here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-16 15:14:35 +02:00
Dodji Seketeli
fde3436568 Better support for inline related diffs
* include/abg-comparison.h
	(diff_category::HARMLESS_SYMBOL_ALIAS_CHANGE_CATEORY): New
	enumerator.
	(diff_category::EVERYTHING_CATEGORY): Adjust.
	* include/abg-ir.h (elf_symbol::get_aliases_id_string)
	(elf_symbol::does_alias, elf_symbols_alias)
	(compute_aliases_for_elf_symbol): Declare new functions ...
	* src/abg-ir.cc (elf_symbol::get_aliases_id_string)
	(elf_symbol::does_alias, elf_symbols_alias)
	(compute_aliases_for_elf_symbol): ... and define them.
	(function_decl::operator==): Take in account elf symbol aliases.
	* src/abg-comp-filter.cc (function_name_changed_but_not_symbol):
	Define new static functions.
	(harmless_filter::visit): Categorize function name changes that
n	doesn't impact underlying elf symbols (or the fact that two
	symbols were aliases and are not anymore) as harmless.
	* src/abg-comparison.cc (function_decl_diff::report): Properly
	report function name changes, or symbol aliases changes for that
	matter.  Also report inline-ness declaration changes.
	* src/abg-dwarf-reader.cc (die_is_declared_inline): New static
	function.
	(build_function_decl): Use the above.
	* tools/bidiff.cc (set_diff_context_from_opts): Add
	abigail::comparison::HARMLESS_SYMBOL_ALIAS_CHANGE_CATEORY into the
	harmless change camp.
	* tests/data/test-diff-dwarf/test14-inline-report.txt: New test
	input.
	* tests/data/test-diff-dwarf/test14-inline-v0.o: Likewise.
	* tests/data/test-diff-dwarf/test14-inline-v1.o: Likewise.
	* tests/data/test-diff-dwarf/test14-inline-v0.cc: Source code for
	test input.
	* tests/data/test-diff-dwarf/test14-inline-v1.cc: Source code for
	test input.
	* tests/test-diff-dwarf.cc: Run this test harness over the new
	input above.
	* tests/data/test-diff-filter/test20-inline-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test20-inline-report-1.txt:
	Likewise.
	* tests/data/test-diff-filter/test20-inline-v0.o: New test input.
	* tests/data/test-diff-filter/test20-inline-v1.o: New test input.
	* tests/data/test-diff-filter/test20-inline-v0.cc: Source code for
	test input.
	* tests/data/test-diff-filter/test20-inline-v1.cc: Likewise.
	* tests/test-diff-filter.cc: Run this test harness over the new
	input above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-16 15:10:41 +02:00
Dodji Seketeli
ba487a2cd9 Better support for enum diffs
* include/abg-comparison.h (changed_enumerator_type): New typedef.
	(diff_category::{HARMLESS_ENUM_CHANGE_CATEGORY}): New enumerator.
	* src/abg-comp-filter.cc (has_type_size_change)
	(has_enumerator_insertion, has_enumerator_removal_or_change)
	(has_harmful_enum_change): New functions.
	(harmless_filter::visit): Categorize enumerator insertions that
	don't change the size of the type into HARMLESS_ENUM_CHANGE_CATEGORY.
	(harmful_filter::visit): Categorize enumerator removal or any enum
	change that changes the size of the type into
	SIZE_OR_OFFSET_CHANGE_CATEGORY.
	* src/abg-comparison.cc (enumerator_value_comp)
	(changed_enumerator_comp): New types.
	(sort_enumerators, sort_changed_enumerators): New static
	functions.
	(enum_diff::report): Sort enum related reports by the value of the
	enumerators.
	* src/abg-dwarf-reader.cc (build_enum_type): Name anonymous enums
	as __anonymous_enum__.
 	* tools/bidiff.cc (set_diff_context_from_opts): Add
	abigail::comparison::HARMLESS_ENUM_CHANGE_CATEGORY into the harmless
	stuff camp.
	* tests/data/test-diff-dwarf/test15-enum-report.txt: New test
	input.
	* tests/data/test-diff-dwarf/test15-enum-v1.o: Likewise.
	* tests/data/test-diff-dwarf/test15-enum-v0.o: Likewise.
	* tests/data/test-diff-dwarf/test15-enum-v0.cc: Source code for
	test input.
	* tests/data/test-diff-dwarf/test15-enum-v1.cc: Likewise.

	* tests/data/test-diff-filter/test19-enum-report-0.txt: New test input.
	* tests/data/test-diff-filter/test19-enum-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test19-enum-v0.o: Likewise.
	* tests/data/test-diff-filter/test19-enum-v1.o: Likewise.
	* tests/data/test-diff-filter/test19-enum-v0.cc: Source code for
	test input.
	* tests/data/test-diff-filter/test19-enum-v1.cc: Likewise.
	* tests/test-diff-dwarf.cc: Run this test harness on the new test
	inputs above.
	* tests/test-diff-filter.cc: Likewise.
	* tests/Makefile.am: Add the new files above to the source distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-16 14:02:27 +02:00
Dodji Seketeli
41cfd5a82b Add constness to elf_symbol::operator==
* include/abg-ir.h (elf_symbol::operator==): Add a const to the
	declaration ...
	* src/abg-ir.cc (elf_symbol::operator==): ... and to the definition.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-16 11:21:47 +02:00
Dodji Seketeli
474b1c0e77 Misc style cleanups
* src/abg-comparison.cc (ChangedDataMemberComp): Rename this to
	changed_data_member_comp
	(sort_changed_data_members): Adjust.
	(DataMemberComp): Rename this to data_member_comp.
	(sort_data_members): Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-15 12:48:52 +02:00
Dodji Seketeli
85dd6d116b Constify some function parameters in abg-comp-filter.cc
* src/abg-comp-filter.cc (type_size_changed): Now take const
          parameters.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-15 12:44:24 +02:00
Jan Engelhardt
650c77bb7e Add .gitignore files.
* .gitignore: Add new file.
	* m4/.gitignore: Likewise.
	* tools/.gitignore: Likewise.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:05:01 +02:00
Jan Engelhardt
4e32504064 Place -L/-l flags into *_LIBADD/*_LDADD
* src/Makefile.am: -L and -l ought to be in LIBADD/LDADD because
	that is the only place guaranteed to be in the right spot.  So add
	Them to libabigail_la_LIBADD.
	* tools/Makefile.am: Likewise.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:04:59 +02:00
Jan Engelhardt
f505d05b3c Add libelf to libabigail.la's linker line
* configure.ac: Check for the existence of libelf at configure
	time by looking at the presence of the elf_end symbol.  Add the
	libelf to the link command line.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:04:57 +02:00
Jan Engelhardt
b24a8127cb Drop hardcoded substitutions
* doc/Makefile.am: Do not use @docdir@.  It's indeed replaced at
	configure time. But there is no need for this limitation with
	automake, as $(docdir) is available and replaceable anytime.
	* src/Makefile.am: Likewise for @DEPS_LIBS@ and @DEPS_CFLAGS@.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:04:56 +02:00
Jan Engelhardt
1708e39fe7 Replace indirect variable assignments
* configure.ac(DEVEL_CFLAGS, DEVEL_CXXFLAGS):  Remove these
	useless variables.
	(CFLAGS, CXXFLAGS): Set these variables directly.
	* include/Makefile.am (pkginclude_HEADERS): Use this predefined
	variable.
	(publicheaders_DATA, publicheadersdir): Remove these.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:04:54 +02:00
Jan Engelhardt
e66eda9fe7 Remove empty and autogenerated files from git repository
* ChangeLog: Remove this empty file for now.  It'll be added back
	right before the first release by automatic generation from the
	commit logs.
	* INSTALL: Remove this empty file for now.
	* NEWS: Remove this empty file for now.  It'll be added back right
	before the first release.
	* configure.ac (AM_INIT_AUTOMAKE): As the mandatory but empty
	files above are being removed for now, let's put in the 'foreign'
	mode of automake for the moment.  We'll likely remove it at
	release time.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:04:48 +02:00
Jan Engelhardt
aa7fc67119 Set automake options globally
* configure.ac(AM_INIT_AUTOMAKE): Set the subdir-object option
	here ..
	* src/Makefile.am: ... not here.
	* tests/Makefile.am: Likewise.
	* tools/Makefile.am: Likewise.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:04:45 +02:00
Jan Engelhardt
0b1224faf1 Stash some autogenerated tools in build-aux/
* configure.ac: Reduce the pollution in the top-level directory a
	bit.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2014-09-12 11:04:42 +02:00
Dodji Seketeli
5f9a3bf4dd Fix memory leaks due to cycles in types ownership
* include/abg-fwd.h (std::tr1::weak_ptr): Inject this type in the
	abigail namespace.
	* include/abg-ir.h: Write a memory management guideline for the IR
	artifacts.
	(Type_base_wptr, function_type_wptr)
	(class_decl_wptr): New typedefs.
	(translation_unit::get_canonical_function_type): Declare new
	member function.
	(qualified_type_def::underlying_type_)
	(reference_type_def::pointed_to_type_)
	(typedef_decl::underlying_type_, function_decl::parameter::type_)
	(function_type::return_type_, method_type::class_type_)
	(non_type_tparameter::type_, type_composition::type_): Make this a
	weak pointer.
	(qualified_type_def::get_pointed_to_type)
	(reference_type_def::get_pointed_to_type)
	(array_type::get_element_type, typedef_decl::get_underlying_type)
	(var_decl::get_type, function_decl::parameter::get_type)
	(function_type::get_return_type, method_type::get_class_type)
	(non_type_tparameter::get_type)
	(type_composition::get_composed_type): Adjust to make this return
	a shared pointer initialized with the content of the weak pointer.
	(function_decl::function_decl, method_decl::method_decl): Remove
	the overload that doesn't take a type.  This is because now,
	function types need to be registered to their containing
	translation unit.
	(struct function_type::hash): Declare here.
	* src/abg-hash.cc (struct function_type::hash): Declare this in
	abg-ir.h and just define the methods here.
	* src/abg-ir.cc (fn_type_ptr_map): New typedef.
	(translation_unit::priv::canonical_types_): Remove this unused
	member.
	(translation_unit::priv::canonical_function_types_): New member.
	(translation_unit::get_canonical_function_type): Define this
	function.
	(array_type_def::priv::element_type_, var_decl::priv::type_)
	(function_decl::priv::type_): Make this a weak pointer.
	(qualified_type_def::get_underlying_type)
	(pointer_type_def::get_pointed_to_type)
	(reference_type_def::get_pointed_to_type)
	(array_type_def::get_element_type)
	(typedef_decl::get_underlying_type, var_decl::get_type)
	(function_decl::get_type): Adjust to make this return a shared
	pointer initialized with the content of the weak pointer.
	(qualified_type_def::build_name)
	(pointer_type_def::get_qualified_name)
	(reference_type_def::get_qualified_name): Adjust.
	(method_type::set_class_type): Cleanup the logic.
	(function_decl::priv::priv): Remove the overload that takes a bare
	pointer to a type.  This should not be used now that we need the
	function type to registered with the translation unit.
	(function_decl::function_decl): Remove the overload that doesn't
	take a type.  This is because now, function types need to be
	registered to their containing translation unit.
	* src/abg-dwarf-reader.cc (build_function_decl): Register the
	function type within its translation type and use its canonical
	version.  This complies with the new memory management rules.
	* src/abg-reader.cc (build_function_decl): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-10 18:08:41 +02:00
Dodji Seketeli
bcbb58d53a Compare class names when comparing methods
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-10 18:08:41 +02:00
Dodji Seketeli
8f6ef2e763 Slight white space fix
* src/abg-hash.cc (method_type:#️⃣:operator()(const
	method_type&)): White space fix.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-10 18:08:41 +02:00
Dodji Seketeli
a2f1adb617 Update copyright notice
* include/abg-ir.h: Update year of copyright notice.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-10 17:19:36 +02:00
Ondrej Oprala
bdac9d6631 Unite help output for tools
* tools/biar.cc (std::ostream): Add a using directive.
	(display_usage): Make it take a string reference and an ostream
	as parameters. Use the ostream argument as an output stream
	instead of a hard-coded cout.
	Prettify output.
	(main): Call display_usage with new parameters.
	* tools/bidiff.cc (display_usage): Declare it static.
	Prettify output.
	* tools/bidw.cc (display_usage): Prettify output.
	* tools/bilint.cc (display_usage): Declare it static.
	Prettify output.
	* tools/bisym.cc (std::cerr): Add a using directive.
	(prog_name): Rename progname into this.
	(display_usage): Rename show_help into this.
	Add an ostream as a parameter. Use the ostream argument
	as output stream insted of a hard-coded cout.

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-09 18:14:35 +02:00
Dodji Seketeli
b7030c5511 Adjust copyright year
* tests/test-diff-dwarf.cc: Adjust year in copyright notice.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-03 09:59:03 +02:00
Dodji Seketeli
d38b2216a4 Sort reported changed data members by increasing offset
* include/abg-comparison.h (changed_type_or_decl_vector): New
	typedef.
	* include/abg-fwd.h (is_data_member): Change the overload that
	takes a decl_base_sptr to make it return the real var_decl_sptr
	rather than just a bool.
	* src/abg-comparison.cc (ChangedDataMemberComp, DataMemberComp):
	New comparison functors.
	(sort_changed_data_members, sort_data_members): Sorting functions
	for changed data members and data members.
	(class_diff::report): Sort reports for deleted, inserted and
	change data members by the increasing value of the offsets of said
	data members.
	* src/abg-ir.cc (is_data_member): Change the overload that takes a
	decl_base_sptr to make it return the real var_decl_sptr rather
	than just a bool.
	* tests/data/test-bidiff/test-struct1-report.txt: Adjust.
	* tests/data/test-diff-dwarf/test13-report.txt: New test input.
	* tests/data/test-diff-dwarf/test13-v0.cc: Source code for new
	test input.
	* tests/data/test-diff-dwarf/test13-v0.o: New test input.
	* tests/data/test-diff-dwarf/test13-v1.cc: Source code for new
	test input.
	* tests/data/test-diff-dwarf/test13-v1.o: New test input.
	* tests/Makefile.am: Add the new test inputs above to the source
	distribution.
	* tests/test-diff-dwarf.cc: Run this test harness on the new test
	input.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-03 09:59:03 +02:00
Dodji Seketeli
b75a020fb1 Do not filter out diff nodes that are only in NOT_REDUNDANT_CATEGORY
* src/abg-comparison.cc (diff::is_filtered_out): If a diff not is
	only in the NOT_REDUNDANT_CATEGORY category consider it as not
	being filtered.
	* tests/data/test-diff-filter/test18-report.txt: New test input.
	* tests/data/test-diff-filter/test18-v0.cc: Source code for new
	test input.
	* tests/data/test-diff-filter/test18-v0.o: New test input.
	* tests/data/test-diff-filter/test18-v1.cc: Source code for new
	test input.
	* tests/data/test-diff-filter/test18-v1.o: New test input.
	* tests/Makefile.am: Add the new test inputs to the source distribution.
	* tests/test-diff-filter.cc: Run this test harness on the new test
	input above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-03 09:59:03 +02:00
Dodji Seketeli
9936b7852b White space cleanup
* src/abg-ir.cc (get_data_member_offset): Remove useless
	horizontal white space.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-03 09:59:03 +02:00
Dodji Seketeli
8d41a18cf7 Add some comments in the comparison engine
* src/abg-comparison.cc: Add a comment for the file.
	(struct class_diff::priv::{subtype_changed_dm_,changed_dm_}): Add
	comment for these data members.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-03 09:59:03 +02:00
Dodji Seketeli
8aa76764ec Remove useless new line from comparison engine's report
* src/abg-comparison.cc (class_diff::report):  Do not emit new
	lines after reporting about inserted data members.
	* tests/data/test-bidiff/test-qual-type0-report.txt: Adjust.
	* tests/data/test-bidiff/test-struct0-report.txt: Adjust.
	* tests/data/test-bidiff/test-struct1-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-dwarf/test3-report.txt: Adjust.
	* tests/data/test-diff-dwarf/test7-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/test11-report.txt: Adjust.
	* tests/data/test-diff-filter/test14-0-report.txt: Adjust.
	* tests/data/test-diff-filter/test14-1-report.txt: Adjust.
	* tests/data/test-diff-filter/test15-0-report.txt: Adjust.
	* tests/data/test-diff-filter/test15-1-report.txt: Adjust.
	* tests/data/test-diff-filter/test16-report.txt: Adjust.
	* tests/data/test-diff-filter/test17-0-report.txt: Adjust.
	* tests/data/test-diff-filter/test17-1-report.txt: Adjust.
	* tests/data/test-diff-filter/test2-report.txt: Adjust.
	* tests/data/test-diff-filter/test3-report.txt: Adjust.
	* tests/data/test-diff-filter/test9-report.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-09-03 09:59:03 +02:00