Commit Graph

145 Commits

Author SHA1 Message Date
Dodji Seketeli
4989519a33 Fix header inclusion in abg-corpus.h
* include/abg-corpus.h: Drop incomplete abg-traverse.h and
	abg-fwd.h.  Use abg-ir.h proper and be done with it.  Users of the
	library will just have to use abg-corpus.h to manipulate and the
	archives and the IR they contain.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-29 16:38:24 +02:00
Dodji Seketeli
b9577015df Add error message to translation_unit::write
* src/abg-writer.cc (translation_unit::write): Add an error
	message to stderr if something ultimately went wrong.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-29 16:36:17 +02:00
Dodji Seketeli
5767379648 Rename abigail::corpus::{get_file_path --> get_path}
* include/abg-corpus.h (corpus::{get_path, set_path): Renamed
	corpus::get_file_path and corpus::set_file_path into these as
	get_path/set_path is what is used elsewhere as well.
	* src/abg-corpus.cc (corpus::{get_path, set_path}): Likewise.
	* tests/test-write-read-archive.cc (main): Adjust for the change
	above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-29 16:29:25 +02:00
Dodji Seketeli
67ff0340be Cleanup src/Makefile.am
* src/Makefile.am: Fix library naming and remove useless trailing
	space from directory path.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-29 16:23:41 +02:00
Dodji Seketeli
c57e950ec7 Initial writing/reading of an ABI corpus to an archive
* configure.ac: Support detection of libzip dependency. Define
        new DEPS_CFLAGS and DEPS_LIBS variables for use in
        Makefile.am to refer to the dependency headers and
        libraries.
	* doc/website/mainpage.txt: Update this to talk about the new
	libzip dependency.
	* include/Makefile.am: Add abg-libzip-utils.h to the build system.
	* include/abg-corpus.h (corps): Hide abigail::corpus's private behind a
	pimpl idiom.
	(corpus::{drop_translation_units, get_file_path, set_file_path,
	write, read}): New methods.
	* include/abg-libxml-utils.h (new_reader_from_buffer): Declare new
	function.
	* include/abg-libzip-utils.h: New file.
	* src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to
	the build system.  Refer to the library and headers dependencies
	via the new DEPS_LIBS and DEPS_CFLAGS variables.
	* src/abg-corpus.cc: New file.
	* src/abg-ir.cc (translation::set_path): New method.
	* src/abg-libxml-utils.cc (new_reader_from_buffer): Define new
	function.
	* src/abg-libzip-utils.cc: New file.
	* src/abg-reader.cc (translation_unit::read): New overload.
	* src/abg-writer.cc: Inject the names from the std namespace into
	the abigail namespace, rather than into abigail::writer.
	(abigail::translation_unit::write): New overload.  This can now
	use ofstream and the other stuff from std that are injected in the
	abigail:: namespace.
	* tests/Makefile.am: Add tests/test-write-read-archive.cc to the
	build system; use that to build runtestwritereadarchive.  Also add
	the input test data from
	tests/data/test-write-read-archive/test[0-4].xml.
	* /tests/data/test-write-read-archive/test[0-4].xml: New test
	input data files.
	* tests/test-write-read-archive.cc: New test for this archive
	write/read support.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 16:20:41 +02:00
Dodji Seketeli
8884b58638 Fix & add missing API documentation
* src/abg-ir.cc (location_manager::create_new_location): Fix
	documentation comment.  (translation_unit::translation_unit)
	(translation_uni::get_global_scope, translation_unit::get_path)
	(translation_unit::traverse, translation_unit::get_loc_mgr)
	(translation_unit::is_empty, translation_unit::traverse): Add
	missing documentation comments.
	* src/abg-libxml-utils.cc (new_reader_from_file): Fix comment.
	* src/abg-reader.cc (translation_unit::read): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 16:20:41 +02:00
Dodji Seketeli
ea129b5a7c Remove useless header inclusion
* include/abg-traverse.h: Remove useless #include <tr1/memory>

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 16:20:40 +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
6a2204fa0d Small cleanup in abg-config.cc
* src/abg-config.cc: Include auto-generated
	$(top_builddir)/config.h file.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 16:20:40 +02:00
Dodji Seketeli
81c496dfe3 Pass absolute paths to the compiler during the build
* src/Makefile.am: Pass absolute file paths to the compiler during
	the build.  This helps in e.g in emacs' compilation mode, when the
	output shows an error reported by GCC's diagnostics, setting point
	to the error line and hitting 'enter' transports the user to the
	file location where the error happened; as the file path is nows
	absolute, emacs can always find it.  Otherwise, finding it depends
	on $PWD and whatnot.
	* tests/Makefile.am: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 16:20:00 +02:00
Dodji Seketeli
10ed52ca7c Misc cleanups in abg-fwd.h
* include/abg-fwd.h: Move location, location_manager and
	translation_unit in the ir section.  Remove stuff that was
	commented out anyway.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:27:35 +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
Dodji Seketeli
d5e0a10f1f Make libxml2 a private dependency wrt pkconfig
* libabigail.pc.in: Libxml2 is not exposed to clients so make it
	be a private dependency.
2013-08-22 17:41:29 +02:00
Dodji Seketeli
13e2d1ee12 White space fix in COMPILING
* COMPILING: White space fix.
2013-08-22 17:40:50 +02:00
Dodji Seketeli
fb481b3693 Add abg-version.h.in to the source distribution & cleanup
* include/Makefile.am:  Add abg-version.h.in to the source
	distribution.
	* configure.ac: Generate abg-version.h in using the existing
	AC_CONFIG_FILES macro call.
2013-08-22 17:07:07 +02:00
Dodji Seketeli
849b598cf5 Support pkgconfig through a new libabigail.pc file
* libabigail.pc.in: New pkgconfig file.
	* configure.ac: Define the LIBXML2_VERSION variable that is used
	in the libabigail.pc.in file.  Generate the libabigail.pc file
	from its libabigail.pc.in template.
	* Makefile.am: Add libabigail.pc.in to the source distribution.
	Install the generated libabigail.pc to the right destination.
2013-08-22 17:06:56 +02:00
Dodji Seketeli
a9a8834018 Tweak the apidoc mainpage
* include/abg-fwd.h<doxygen markup>: Fix link to the project web
	page and for git check-out.
2013-08-21 22:24:13 +02:00
Dodji Seketeli
2927145da4 Initial website generation-fu using Doxygen
* doc/website/mainpage.txt: New file representing the input for
	the website.
	* doc/website/libabigail-website.doxy: New file representing the
	doxygen configuration for the website generation.
	* doc/api/libabigail.doxy: Output doxygen generation warnings into
	a file.
	* doc/Makefile.am: Support generating the website from doxygen.
	Update the api generation relevant macros names for better
	consistency.  Make "make html" generate the website too.  Make
	"make clean" erase the website bits too.  Add a 'website'
	target to make the website.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-21 19:54:01 +02:00
Dodji Seketeli
56253ee20a Fix typo in CONTRIBUTING file
* CONTRIBUTING: Fix typo, courtesy of Mark Wielaard.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-21 11:53:12 +02:00
Dodji Seketeli
b9ea069f1d Remove autotools-generated files
* Makefile.in: Remove this autotools-generated file.  I know that
	people in the GCC-realm like storing these autotools-generated
	files into the source control system, but I believe in this day
	and age, this is annoying (to say the least) for the project
	developers for no good reason.  Requiring (the ubiquitous)
	autoconf for building from source is no big deal today, and typing
	"autoreconf" is not hard to do, really.  And it saves the
	developers for having to update a bunch of boilerplate
	automatically generated files into the source control system; this
	is really unnecessary noise and it is a commonly accepted good
	practice to avoid doing it these days.  To help people who do not
	know how to handle this, there is a COMPILING file in the source
	tree that explains how to build the project from sources.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* include/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* doc/Makefile.in: Likewise.
	* tests/Makefile.in: Likewise.
2013-08-20 00:05:07 +02:00
Dodji Seketeli
c325b3aa4a Add a new COMPILING file explaining how to build the package
* COMPILING: New file.
2013-08-19 23:52:15 +02:00
Dodji Seketeli
6d316b4438 Remove name of unused parameter in decl_base::traverse.
* src/abg-ir.c (decl_base::traverse): Remove name of unused parameter.
2013-08-14 17:20:02 +02:00
Dodji Seketeli
f437bfc04d install headers in $includedir/libabigail
* include/Makefile.am: Install headers in $includedir/libabigail
2013-08-14 17:12:54 +02:00
Dodji Seketeli
6c828d266e For usage from within GCC set header path to $includedir/libabigail
* abigail.m4:  The include path used for compilation goes to
	$includedir/libabigail.
2013-08-14 16:10:15 +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
9f7c830236 Slight change to doxy config.
* doc/api/libabigail.doxy: Turn off namespace scopes, on all the viz.
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
9add67dfe5 Rename abi_corpus to corpus
* include/abg-corpus.h (abi_corpus): Change to corpus.

	* include/abg-hash.h: Tweaks.
	* include/abg-libxml-utils.h: Same.
2013-08-14 15:07:18 +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
32ce30a23c First pass clean reading API.
* include/abg-reader.h (read_file): Remove extraneous file parameter.
	* src/abg-reader.cc: Same.
	* tests/test-read-write.cc: Adjust.
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
1f702180e6 Adjust doxygen input path.
* doc/api/libabigail.doxy: Adjust include directory.
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
Dodji Seketeli
e5dd19b2a6 Update autotool auto-generated files
* Makefile.in: Updated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* tests/Makefile.in: Likewise.
2013-07-23 23:17:28 +02:00
Dodji Seketeli
95ec67b143 Implement a translation unit traversal API
* include/libabigail/abg-ir.h (struct ir_node_visitor, struct
	traversable): New interfaces.
	(translation_unit, scope_decl, type_decl, qualified_type_def)
	(pointer_type_def, reference_type_def, enum_type_decl)
	(typedef_decl, var_decl, function_decl, data_member)
	(member_function, member_function_template)
	(member_class_template): Implement the traversable interface,
	overload the traversable::traverse pure virtual function.
	* src/abg-ir.cc ({translation_unit, scope_decl, type_decl,
	namespace_decl, qualified_type_def, pointer_type_def,
	reference_type_def, enum_type_decl, typedef_decl, var_decl,
	function_decl, class_decl::member_function, class_decl,
	class_decl::data_member, class_decl::member_function_template,
	class_decl::member_class_template, function_template_decl,
	class_template_decl, }::traverse): Implement traversal.
	(ir_node_visitor::visit): New method, overloaded for the types
	above, which implement the traversable interface.
	* tests/test-walker.cc: New test case program to showcase how to
	use the new traversal API.
	* tests/makefile.am: Add test-walker.cc to the build system.
2013-07-23 23:13:56 +02:00
Dodji Seketeli
e9be65956c By default, statically link libabigail with whoever uses abigail.m4
* abigail.m4: Make $abigaillibs statically link libabigail by default.
2013-07-23 23:13:56 +02:00
Dodji Seketeli
04873cb485 Move static member definition to abg-viz-dot.cc file
* include/libabigail/abg-viz-dot.h: Move definition of
	node_base::_M_count_total to ...
	* src/abg-viz-dot.cc: ... here.
2013-07-23 23:13:56 +02:00
Dodji Seketeli
f9d66af03c Put headers in include/libabigail
* include/libabigail: New directory.
	* include/Makefile.am:  New file.
	* include/libabigail/Makefile.am: New file.
	* src/abg-*.h: Move these in include/libabigail/*.h
	* src/Makefile.am: Set -I option to look for headers in include/libabigail
	* doc/api/libabigail.doxy: Look for headers in include/libabigail
	* tests/Makefile.am: Set -I option to look for headers in include/libabigail
	* abigail.m4: Set includedir to $prefix/include/libabigail for
	library used as a dep, or to srcdir/libabigail/include/libabigail
	in GCC source tree.
	* configure.ac: Add Makefile.am in include and include/libabigail
	* abigail.m4: Look for headers in include/libabigail when the
	libabigail is in in the source tree and in $incdir/libabigail when
	it is installed as a dependency.
2013-07-23 23:13:56 +02:00
Benjamin Kosnik
8e950513b0 Install into docdir, turn off collaboration graphs.
* doc/Makefile.am (doc-install-html-doxygen): Install generated
	files into docdir.

	* doc/api/libabigail.doxy (COLLABORATION_GRAPH): Turn off.
2013-07-23 23:13:56 +02:00
Benjamin Kosnik
ba24c0aee8 Fix dependencies for api/html output directory.
* doc/Makefile.am: Create abi output directory.
2013-07-23 23:13:55 +02:00
Dodji Seketeli
921f0d36ea Prepare for publishing
* COMMIT-LOG-GUIDELINES: New file.
	* CONTRIBUTING: New file.
	* README: Amended to refer to the first files above.
2013-07-23 23:13:55 +02:00
Dodji Seketeli
7daf60f12c LGPLv3 License the library
* COPYING-LGPLV3:  New file.
	* abg-config.cc: License the file to LGPLv3.
	* abg-config.h: Likewise.
	* abg-corpus.cc: Likewise.
	* abg-corpus.h: Likewise.
	* abg-hash.cc: Likewise.
	* abg-hash.h: Likewise.
	* abg-ir.cc: Likewise.
	* abg-ir.h: Likewise.
	* abg-libxml-utils.cc: Likewise.
	* abg-libxml-utils.h: Likewise.
	* abg-reader.cc: Likewise.
	* abg-reader.h: Likewise.
	* abg-writer.cc: Likewise.
	* abg-writer.h: Likewise.
	* src/abg-viz-common.cc: Likewise.
	* src/abg-viz-common.h: Likewise.
	* src/abg-viz-dot.cc: Likewise.
	* src/abg-viz-dot.h: Likewise.
	* src/abg-viz-svg.cc: Likewise.
	* src/abg-viz-svg.h: Likewise.
	* tests/test-read-write.cc: Likewise.
	* tests/test-utils.cc: Likewise.
	* tests/test-utils.h: Likewise.
2013-07-23 23:13:55 +02:00
Dodji Seketeli
59db5b3095 Add assert.h in abg-ir.cc
* src/abg-ir.cc: Add missing assert.h
2013-07-23 23:13:55 +02:00