Commit Graph

23 Commits

Author SHA1 Message Date
Dodji Seketeli
a21e0a3442 Fix inheritance of operator== on decl_base and type_base
* include/abg-ir.h (*lots of descendants of decl_base, type_decl)
	(template_decl, class_decl::member_base): Replace the previous classical
	*::operator==(*&) with an overload of decl_base::operator==(const
	decl_base&), type_base::operator==(const type_base),
	template_decl::operator==(const template_decl&) or
	class_decl::member_base::operator==(const
	class_decl::member_base&).  This makes the descendant operator be
	the one called when a comparison involves references the parent
	class.
	* src/abg-ir.cc: Write the implementation of the above.  Remove
	the useless static_casts from the previous operator== code.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:23:50 +01:00
Dodji Seketeli
5f2b66d22e On going misc white spaces and style fixes
* include/abg-ir.h: Add author.  Remove many useless white
	spaces.  Add missing end-of-class comments.  Move function
	declaration comments from here to their definition point.
	* include/abg-fwd.h: Remove useless indentation.  Also move
	doxygen comments to *definition* points in src/abg-ir.cc.
	* src/abg-ir.cc: Remove many useless white spaces.  Move comments
	from declaration points to here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:23:12 +01:00
Dodji Seketeli
6e590b2a45 Initial un-debugged implementation of scope diffing
* include/abg-comparison.h (class scope_diff): New type.
	(compute_diff(scope_decl_sptr, scope_decl_sptr, scope_diff)): New
	declaration.
	(report_changes): New declaration.
	* src/abg-comparison.cc (struct scope_diff::priv): Define.
	(scope_diff::{clear_lookup_tables, lookup_tables_empty,
	ensure_lookup_tables_populated, scope_diff, member_changes,
	deleted_member_at, inserted_member_at, changed_types,
	changed_decls}): Define these new member functions.
	(compute_diff): Define.
	* include/abg-ir.h (decl_base_sptr): New typedef.
	(operator==(decl_base_sptr, decl_base_sptr)): Declare new
	operator.
	* src/abg-ir.cc (operator==(decl_base_sptr, decl_base_sptr)):
	Define.
	(scope_decl::{operator==, traverse}): Adjust for using vectors to
	store scope members now, rather than lists.
	(scope_decl::{declarations, scopes}): Make these types be vector.
	This makes the members of a scopes be vector, rather than lists.
	This enables them to be diffed.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:22:45 +01:00
Dodji Seketeli
63587eca30 Misc white space, style and comments cleanup
* include/abg-ir.h (class scope_decl): Add end of class comment.
	(class type_base): Add a _sptr typedef and end of class comment.
	* src/abg-ir.cc (operator==(class_decl_sptr, class_decl_sptr)):
	Fix comment.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:21:53 +01:00
Dodji Seketeli
eb6339835f Un-debugged initial implementation of class diffing.
* include/abg-ir.h (decl_base::get_qualified_name): New
	declaration.
	(class_decl::{base_specs, member_types, data_members,
	member_functions, member_function_templates,
	member_class_templates}): Make all these containers be vectors,
	rather than list.  This makes these containers (like
	class_decl::base_specs, class_decl::member_types, etc) be suitable
	to be used by the core diffing algorithms to diff their content.
	(operator==(class_decl_sptr, class_decl_sptr))
	(operator==(class_decl::member_type_sptr, class_decl::member_type_sptr))
	(operator==(class_decl::base_spec_sptr,
	            class_decl::base_spec_sptr))
	(operator==(class_decl::data_member_sptr,
	            class_decl::data_member_sptr))
	(operator==(class_decl::member_function_sptr,
	            class_decl::member_function_sptr))
	(operator==(class_decl::member_function_template_sptr,
	            class_decl::member_function_template_sptr))
	(operator==(class_decl::member_class_template_sptr,
		    class_decl::member_class_template_sptr)): Declare
	these new equality operators.  These are to be used by the core
	diffing algorithms when comparing two vectors of shared pointers
	of members of class_decls.
	* src/abg-ir.cc (decl_base::get_qualified_name): Define.
	(class_decl::class_decl, class_decl::operator==(class_decl&)): Adjust for the
	containers type change to a vector.
	(operator==(class_decl_sptr, class_decl_sptr))
	(operator==(class_decl::member_type_sptr, class_decl::member_type_sptr))
	(operator==(class_decl::base_spec_sptr,
	            class_decl::base_spec_sptr))
	(operator==(class_decl::data_member_sptr,
	            class_decl::data_member_sptr))
	(operator==(class_decl::member_function_sptr,
	            class_decl::member_function_sptr))
	(operator==(class_decl::member_function_template_sptr,
	            class_decl::member_function_template_sptr))
	(operator==(class_decl::member_class_template_sptr,
		    class_decl::member_class_template_sptr)): Define
	these.
	* include/abg-comparison.h (diff::scope_): Remove
	(diff::{first_scope_, second_scope_}): New members.
	(class_decl_diff::class_decl_diff): Pass the new scopes to this
	constructor.
	(class_decl_diff::{first_class_decl, second_class_decl})
	(report_changes): New declarations.
	* src/abg-comparison.cc (class_decl_diff::class_decl_diff): Update
	as per the declaration.
	(class_decl_diff::{first_class_decl, second_class_decl}): Define
	as per the declaration.
	(compute_diff): Initial implementation for this.
	(report_changes): Define.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:21:37 +01:00
Dodji Seketeli
b92e29a396 Misc white space, style and comment fixes
* include/abg-ir.h: Lots of useless white space removals and
	comments adding.
	(class class_decl::member_base): Fix comment.
	* src/abg-hash.cc: Lots of useless white space removals too.
	* src/abg-ir.cc: Remove useless white space too.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:20:28 +01:00
Dodji Seketeli
628911ee5f Prepare node visitors to be usable on things other than IR nodes
* include/abg-fwd.h (node_visitor_base): Renamed ir_node_visitor
	into this.
	* include/abg-traverse.h (struct node_visitor_base): New base for
	the visitors.
	(struct traversable_base): Update comments.
	(traversable_base::traverse): Change this into non-pure virtual.
	Make it take a reference to node_visitor_base, rather than a
	reference to ir_node_visitor.
	* src/abg-traverse.cc (traversable_base::traverse): New empty
	default implementation.
	* include/abg-ir.h: Make ir_node_visitor inherit from new
	node_visitor_base.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:19:12 +01:00
Dodji Seketeli
23d69b405c Renamed data members from m_something to something_
* src/abg-ir.{cc,h}: Renamed data members from m_something to
	something_ and update their usage.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:18:26 +01:00
Dodji Seketeli
0b8a16ef39 Define translation_unit{_sptr,s} types in abigail::
* include/abg-corpus.h (abigail::corpus::{translation_unit_sptr,
	translation_units):  Do not define these typedefs here.  Rather)
	(define them ...
	* include/abg-ir.h
	(abigail::{translation_units,translation_unit_sptr): ... here.
	This is because a translation unit can be manipulated
	independently from an abi corpus.
	* src/abg-corpus.cc (corpus::get_translation_units): Adjust return
	type to comply with the change above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-29 16:45:55 +02:00
Dodji Seketeli
e90467e69b Misc white space cleanups
* include/abg-corpus.h: Cleanup white spaces.
	* include/abg-fwd.h: Likewise.
	* include/abg-ir.h: Likewise.
	* include/abg-libxml-utils.h: Likewise.
	* src/abg-config.cc: Likewise.
	* src/abg-ir.cc: Likewise.
	* src/abg-reader.cc: Likewise.
	* src/abg-writer.cc: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 16:20:40 +02:00
Dodji Seketeli
6d5f7c1223 Move location, location_manager & translation_unit back into abg-ir.h
* include/abg-corpus.h: Move location location_manager,
	translation_unit from here ...
	* include/abg-ir.h: ... to here.  The reason being that these are
	really constructs of the Internal Representation of the ABI/API of
	a translation unit.  What is left in abg-corpus is really
	exclusively related to an ABI Corpus, which I see more as a
	"packaging" construct that abstracts the bundling of several
	translation units together.  Also, I fixed some comments about the
	location/location_manger types; now a location is made specific to
	a translation unit; to an abi corpus.  A location of a given
	translation unit has to be decoded by the location manager of that
	same translation unit.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:21:26 +02:00
Benjamin Kosnik
6684ad97ad Separate out bits from the ir header.
* include/abg-irfwd.h: Move to...
	* include/abg-fwd.h: ...this.

	* include/abg-ir.h (traverse_base): Move to...
	* include/abg-traverse.h: ...here. New.

	* include/abg-ir.h (location, location_manager, translation_unit):
	Move to...
	* include/abg-corpus.h: ...here.

	* include/Makefile.am: Adjust.
	* include/Makefile.in: Regenerate.
2013-08-14 15:07:19 +02:00
Benjamin Kosnik
9258b41534 Template naming compression.
* include/abg-ir.h: Template naming compressions.
	(class_template_decl): To class_tdecl.
	(function_template_decl): To function_tdecl.
	(template_type_parameter): To type_tparameter.
	(template_non_type_parameter): To non_type_tparameter.
	(template_template_parameter): To template_tparameter.
	(tmpl_parm_type_composition): To type_composition.
	* include/abg-irfwd.h: Same.
	* src/abg-hash.cc: Same.
	* src/abg-ir.cc: Same.
	* src/abg-reader.cc: Same.
2013-08-14 15:07:19 +02:00
Benjamin Kosnik
c06c007abc Move class_decl nested types out-of-line.
* include/abg-ir.h (class_decl): Move nested types out of line.
2013-08-14 15:07:19 +02:00
Benjamin Kosnik
ea59f3c426 Rename class_decl::method to class_decl::method_base.
* include/abg-ir.h (class_decl::member): To member_base.
	* src/abg-hash.cc: Same.
	* src/abg-ir.cc: Same.
	* src/abg-writer.cc: Same.
2013-08-14 15:07:19 +02:00
Benjamin Kosnik
373a74044a Nest hashers.
* include/abg-ir.h: Nest all hashers.
	* include/abg-irfwd.h (abigail): Don't inject std::tr1::hash.
	Remove hasher forward declarations.
	* include/abg-hash.h: Tweak.
	* src/abg-hash.cc: Define hashers here.
	* src/abg-ir.cc: Adjust for above.
	* src/abg-reader.cc: Same.
	* src/abg-writer.cc: Same.
2013-08-14 15:07:19 +02:00
Benjamin Kosnik
9c7f025ae9 Simplify interface for serializing/deserializing translation_units.
2013-08-06  Benjamin Kosnik  <bkoz@redhat.com>

	* include/abg-ir.h (translation_unit::read): New member function.
	(translation_unit::write): Same.
	* src/abg-reader.cc (translation_unit::read): Define.
	* src/abg-writer.cc (translation_unit::write): Define.

	* include/abg-reader.h: Remove.
	* include/abg-writer.h: Remove.
	* include/Makefile.am (headers): Same.
	* include/Makefile.in: Regenerate.
2013-08-14 15:07:18 +02:00
Benjamin Kosnik
f7fd078486 Rename traversable to traversable_base, move up the _decl hierarchy via decl_base derivation.
* include/abg-ir.h (traversable): To traversable_base.
	(decl_base): Inherit from traversable_base.
	(decl_base::traverse): Null definition.
	(function_decl, etc.): Remove traversable_base as base class.
2013-08-14 15:07:18 +02:00
Benjamin Kosnik
7916bff4fb Standardize typedef naming. Plural form is the container form, smart_ptr types are type + _sptr.
* include/abg-ir.h (scope_decl): Add declarations, scopes as types.
	(function_type): Add parameter_sptr, parameters as types.
	(enum_type_decl): Add type_sptr, enumerators as types.
	(class_decl): Adjust typedefs for consistency.  Change
	base_specs_type to base_specs, member_types_type to member_types,
	data_members_type to data_members, member_functions_type to
	member_functions, member_function_templates_type to
	member_function_templates, member_class_templates_type to
	member_class_templates.
2013-08-14 15:07:18 +02:00
Benjamin Kosnik
1240a6513a Doxygen markup fixes final.
* include/abg-config.h: Doxygen cleanups round two.
	* include/abg-hash.h: Same.
	* include/abg-ir.h: Same.
	* include/abg-irfwd.h: Same.
	* include/abg-libxml-utils.h: Same.
	* src/abg-config.cc: Same.
	* src/abg-hash.cc: Same.
	* src/abg-ir.cc: Same.
	* src/abg-reader.cc: Same.
	* src/abg-writer.cc: Same.
2013-08-14 15:07:18 +02:00
Benjamin Kosnik
e80ad1adee Forward decls for abg-ir.h, doxygen fixups, restyle.
* include/abg-irfwd.h: New file for forward declarations.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.

	* include/*: Forward declare, doxygen fixups, restyle.
	* src/*: Same.

	* src/abg-corpus.cc: Empty, removed.

	* doc/api/libabigail.doxy: Tweak.
2013-08-14 15:07:18 +02:00
Benjamin Kosnik
8652e0f935 Add virtual dtor to translation_unit.
* include/abg-ir.h (translation_unit): Add virtual dtor.
	* src/abg-ir.cc: Define.
2013-08-14 15:07:18 +02:00
Benjamin Kosnik
d23c4e9b96 Collapse subdir of include to include.
* include/libabigail/abg-*.h: Move to...
	* include/abg-*.h
	* include/libabigail: Remove.

	* configure.ac: Adjust include location from libabigail/include to
	include.
	* Makefile.in: Same.
	* aclocal.m4: Same.
	* configure: Same.
	* doc/Makefile.in: Same.
	* include/Makefile.am: Same.
	* src/Makefile.am: Same.
	* src/Makefile.in: Same.
	* tests/Makefile.am: Same.
	* tests/Makefile.in: Same.
2013-08-14 15:07:18 +02:00