Commit Graph

252 Commits

Author SHA1 Message Date
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
Dodji Seketeli
f4c9b07069 Fix missing license blurbs
* src/abg-config.cc: Fix licensing blurb.
	* src/abg-config.h: Likewise.
	* src/abg-corpus.cc: Likewise.
	* src/abg-corpus.h: Likewise.
	* src/abg-ir.cc: Likewise.
	* src/abg-ir.h: Likewise.
	* src/abg-reader.cc: Likewise.
	* src/abg-writer.cc: Likewise.
2013-07-23 23:13:55 +02:00
Benjamin Kosnik
f6c2daedc3 Correct DOT merge.
* src/abg-viz-common.h: Use _M_attributes for attribute overflows.
	* src/abg-viz-dot.h: Merge in correct node_base.
	* src/abg-viz-dot.cc: Same.
	* tests/test-dot.cc: Correct examples.

	* tests/Makefile.am: Add .gv to CLEANFILES.
	* tests/Makefile.in: Regenerate.
2013-07-23 23:13:55 +02:00
Benjamin Kosnik
202476207b Pull out common style type.
* src/abg-viz-common.h: Pull out common style type.
	* src/abg-viz-dot.cc: Adjust scoping.
	* src/abg-viz-common.cc: Same.
	* src/abg-viz-dot.h: Use common style class.
	* src/abg-viz-svg.h: Same.
2013-07-23 23:13:55 +02:00
Benjamin Kosnik
1807401e6c Commonize visualization support.
* src/abg-viz-svg.h: Move common code to...
	* src/abg-viz-dot.h: Move common code to...
	* src/abg-viz-common.h: ...here. New.
	* src/abg-viz-svg.cc: Move common code to...
	* src/abg-viz-common.cc: ...here. New.
	* src/Makefile.am: Add abg-viz-common.cc, abg-viz-common.h
	* src/Makefile.in: Regenerate.
2013-07-23 23:13:55 +02:00
Benjamin Kosnik
f3dae517b9 Initial DOT work.
* doc/vizualization/layout/scripts/
	(inkscape_export_svg_to_plain_svg.sh): Move...
	(inkscape_export_svg_to_png_and_pdf.sh): Move...
	* scripts: ..here. New toplevel directory.
	* scripts/scripts/dot_to_png.sh: New.
	* scripts/scripts/dot_to_svg.sh: New.
	* src/Makefile.am: Add abg-viz-dot.cc, abg-viz-dot.h.
	* tests/Makefile.am: Add test-dot.cc.
	* src/abg-viz-dot.cc: New.
	* src/abg-viz-dot.h: New.
	* tests/test-dot.cc: New.
	* doc/vizualization/graph: New.
	* doc/vizualization/graph/gv/sa-A.gv: New.
	* doc/vizualization/graph/gv/sa-B.gv: New.
	* doc/vizualization/graph/gv/sa-C1.gv: New.
	* doc/vizualization/graph/gv/sa-C2.gv: New.
	* doc/vizualization/graph/gv/sa-C3.gv: New.
	* doc/vizualization/graph/gv/sa-C4.gv: New.
	* doc/vizualization/graph/gv/sa-D1.gv: New.
	* doc/vizualization/graph/gv/sa-D2.gv: New.
	* doc/vizualization/graph/gv/sa-D2v.gv: New.
	* doc/vizualization/graph/gv/sa-D3.gv: New.
	* doc/vizualization/graph/gv/sa-D3v.gv: New.
	* doc/vizualization/graph/gv/sa-D4v.gv: New.
	* doc/vizualization/graph/gv/sa-D5v1.gv: New.
	* doc/vizualization/graph/gv/sa-D5v2.gv: New.
	* doc/vizualization/graph/gv/sa-DD1.gv: New.
	* doc/vizualization/graph/gv/sa-DD2.gv: New.
	* doc/vizualization/graph/gv/sa-DD3.gv: New.
	* doc/vizualization/graph/gv/sa-DD4.gv: New.
	* doc/vizualization/graph/gv/sa-DD5.gv: New.
	* doc/vizualization/graph/gv/sa-base.gv: New.
	* doc/vizualization/graph/png/sa-A.png: New.
	* doc/vizualization/graph/png/sa-B.png: New.
	* doc/vizualization/graph/png/sa-C1.png: New.
	* doc/vizualization/graph/png/sa-C2.png: New.
	* doc/vizualization/graph/png/sa-C3.png: New.
	* doc/vizualization/graph/png/sa-C4.png: New.
	* doc/vizualization/graph/png/sa-D1.png: New.
	* doc/vizualization/graph/png/sa-D2.png: New.
	* doc/vizualization/graph/png/sa-D2v.png: New.
	* doc/vizualization/graph/png/sa-D3.png: New.
	* doc/vizualization/graph/png/sa-D3v.png: New.
	* doc/vizualization/graph/png/sa-D4v.png: New.
	* doc/vizualization/graph/png/sa-D5v1.png: New.
	* doc/vizualization/graph/png/sa-D5v2.png: New.
	* doc/vizualization/graph/png/sa-DD1.png: New.
	* doc/vizualization/graph/png/sa-DD2.png: New.
	* doc/vizualization/graph/png/sa-DD3.png: New.
	* doc/vizualization/graph/png/sa-DD4.png: New.
	* doc/vizualization/graph/png/sa-DD5.png: New.
	* doc/vizualization/graph/png/sa-base.png: New.
	* doc/vizualization/graph/sources/sa-A.cc: New.
	* doc/vizualization/graph/sources/sa-B.cc: New.
	* doc/vizualization/graph/sources/sa-C.cc: New.
	* doc/vizualization/graph/sources/sa-D.cc: New.
	* doc/vizualization/graph/sources/sa-DD.cc: New.
	* doc/vizualization/graph/sources/sa-base.cc: New.
	* doc/vizualization/graph/svg/sa-A.svg: New.
	* doc/vizualization/graph/svg/sa-B.svg: New.
	* doc/vizualization/graph/svg/sa-C1.svg: New.
	* doc/vizualization/graph/svg/sa-C2.svg: New.
	* doc/vizualization/graph/svg/sa-C3.svg: New.
	* doc/vizualization/graph/svg/sa-C4.svg: New.
	* doc/vizualization/graph/svg/sa-D1.svg: New.
	* doc/vizualization/graph/svg/sa-D2.svg: New.
	* doc/vizualization/graph/svg/sa-D2v.svg: New.
	* doc/vizualization/graph/svg/sa-D3.svg: New.
	* doc/vizualization/graph/svg/sa-D3v.svg: New.
	* doc/vizualization/graph/svg/sa-D4v.svg: New.
	* doc/vizualization/graph/svg/sa-D5v1.svg: New.
	* doc/vizualization/graph/svg/sa-D5v2.svg: New.
	* doc/vizualization/graph/svg/sa-DD1.svg: New.
	* doc/vizualization/graph/svg/sa-DD2.svg: New.
	* doc/vizualization/graph/svg/sa-DD3.svg: New.
	* doc/vizualization/graph/svg/sa-DD4.svg: New.
	* doc/vizualization/graph/svg/sa-DD5.svg: New.
	* doc/vizualization/graph/svg/sa-base.svg: New.
2013-07-23 23:13:55 +02:00
Benjamin Kosnik
8e6fea044a Regenerate build/configure. 2013-07-23 23:13:54 +02:00
Benjamin Kosnik
1a151751ad Regenerate configure files. 2013-07-23 23:13:54 +02:00
Benjamin Kosnik
e021203019 Add svg generation.
* src/Makefile.am: Add abg-viz-svg.cc, abg-viz-svg.h.
	* tests/Makefile.am: Add test-svg.cc.
	* src/abg-viz-svg.cc: New.
	* src/abg-viz-svg.h: New.
	* tests/test-svg.cc: New.
2013-07-23 23:13:54 +02:00
Benjamin Kosnik
7dd26cff0f Remove ChangeLog
* ChangeLog: Remove content.
2013-07-23 23:13:54 +02:00
Benjamin Kosnik
6fb9db6505 Fixup abg-version.h merge duplicate.
2013-05-21  Benjamin Kosnik  <bkoz@redhat.com>

	* configure.ac: Remove src/abg-version.h merge duplicate.
2013-07-23 23:13:54 +02:00
Benjamin Kosnik
40029ae864 Add doc/visualization/layout.
* doc/vizualization/layout: New.
	* doc/vizualization/layout/pdf/sa-A.pdf: New.
	* doc/vizualization/layout/pdf/sa-B.pdf: New.
	* doc/vizualization/layout/pdf/sa-C1.pdf: New.
	* doc/vizualization/layout/pdf/sa-C2.pdf: New.
	* doc/vizualization/layout/pdf/sa-C3.pdf: New.
	* doc/vizualization/layout/pdf/sa-D1.pdf: New.
	* doc/vizualization/layout/pdf/sa-D2.pdf: New.
	* doc/vizualization/layout/pdf/sa-D2v.pdf: New.
	* doc/vizualization/layout/pdf/sa-D3.pdf: New.
	* doc/vizualization/layout/pdf/sa-D3v.pdf: New.
	* doc/vizualization/layout/pdf/sa-D4v.pdf: New.
	* doc/vizualization/layout/pdf/sa-DD1.pdf: New.
	* doc/vizualization/layout/pdf/sa-DD2.pdf: New.
	* doc/vizualization/layout/pdf/sa-DD3.pdf: New.
	* doc/vizualization/layout/pdf/sa-DD4.pdf: New.
	* doc/vizualization/layout/pdf/sa-DD5.pdf: New.
	* doc/vizualization/layout/pdf/sa-base.pdf: New.
	* doc/vizualization/layout/png/sa-A.png: New.
	* doc/vizualization/layout/png/sa-B.png: New.
	* doc/vizualization/layout/png/sa-C1.png: New.
	* doc/vizualization/layout/png/sa-C2.png: New.
	* doc/vizualization/layout/png/sa-C3.png: New.
	* doc/vizualization/layout/png/sa-D1.png: New.
	* doc/vizualization/layout/png/sa-D2.png: New.
	* doc/vizualization/layout/png/sa-D2v.png: New.
	* doc/vizualization/layout/png/sa-D3.png: New.
	* doc/vizualization/layout/png/sa-D3v.png: New.
	* doc/vizualization/layout/png/sa-D4v.png: New.
	* doc/vizualization/layout/png/sa-DD1.png: New.
	* doc/vizualization/layout/png/sa-DD2.png: New.
	* doc/vizualization/layout/png/sa-DD3.png: New.
	* doc/vizualization/layout/png/sa-DD4.png: New.
	* doc/vizualization/layout/png/sa-DD5.png: New.
	* doc/vizualization/layout/png/sa-base.png: New.
	* doc/vizualization/layout/scripts/
	(inkscape_export_svg_to_plain_svg.sh): New.
	(inkscape_export_svg_to_png_and_pdf.sh): New.
	* doc/vizualization/layout/sources/sa-A.cc: New.
	* doc/vizualization/layout/sources/sa-B.cc: New.
	* doc/vizualization/layout/sources/sa-C.cc: New.
	* doc/vizualization/layout/sources/sa-D.cc: New.
	* doc/vizualization/layout/sources/sa-DD.cc: New.
	* doc/vizualization/layout/sources/sa-base.cc: New.
	* doc/vizualization/layout/svg/sa-A.svg: New.
	* doc/vizualization/layout/svg/sa-B.svg: New.
	* doc/vizualization/layout/svg/sa-C1.svg: New.
	* doc/vizualization/layout/svg/sa-C2.svg: New.
	* doc/vizualization/layout/svg/sa-C3.svg: New.
	* doc/vizualization/layout/svg/sa-D1.svg: New.
	* doc/vizualization/layout/svg/sa-D2.svg: New.
	* doc/vizualization/layout/svg/sa-D2v.svg: New.
	* doc/vizualization/layout/svg/sa-D3.svg: New.
	* doc/vizualization/layout/svg/sa-D3v.svg: New.
	* doc/vizualization/layout/svg/sa-D4v.svg: New.
	* doc/vizualization/layout/svg/sa-DD1.svg: New.
	* doc/vizualization/layout/svg/sa-DD2.svg: New.
	* doc/vizualization/layout/svg/sa-DD3.svg: New.
	* doc/vizualization/layout/svg/sa-DD4.svg: New.
	* doc/vizualization/layout/svg/sa-DD5.svg: New.
	* doc/vizualization/layout/svg/sa-base.svg: New.
2013-07-23 23:13:54 +02:00
Benjamin Kosnik
73dec4acda Generate abg-version.h at configure time.
2013-05-20  Benjamin Kosnik  <bkoz@redhat.com>

	* configure.ac: Add src/abg-version.h to AC_CONFIG_FILES.
	* src/Makefile.am: Remove abg-version.h generation rules.
	* src/abg-version.h.in: New.
2013-07-23 23:13:54 +02:00
Benjamin Kosnik
be9e84e756 Add doc dir. Add Doxgen api generation rules.
* doc: Add.
	* doc/Makefile.am (html, install-html): Add.
	* doc/Makefile.in: Add.
	* doc/api/libabigail.doxy: Add doxygen config.
	* src/abg-*: Add @file markup.
2013-07-23 23:13:54 +02:00
Benjamin Kosnik
d1f004df51 Add configure to source control
* configure: Add.
	* src/abg-corpus.cc: include stdexcept
2013-07-23 23:13:53 +02:00
Dodji Seketeli
9b99a77d8a Support offsets and virtual attribute in base class specifiers
* src/abg-ir.h (class_decl::base_spec::base_spec): Take an offset
	and a is_virtual flag.
	(class_decl::base_spec::{get_is_virtual, get_offset_in_bits}): New
	methods.
	(class_decl::has_no_base_nor_member): New method declaration..
	* src/abg-ir.cc (class_decl::base_spec::base_spec): Take an offset
	and a is_virtual flag
	(class_decl::has_no_base_nor_member): Define it.
	* src/abg-reader.cc (read_offset_in_bits): Renamed
	read_var_offset_in_bits into this.
	(read_is_virtual): New static function.
	(build_class_decl): Read the 'layout-offset-in-bits' and the
	'is-virtual' of the base class specifier.  Adjust for the
	read_var_offset_in_bits -> read_offset_in_bits rename.
	* src/abg-writer.cc (write_layout_offset): New overload for the
	base class specifiers.
	(write_class_decl): If the class has no member or base class, make
	it a proper empty xml element.  Write the offset and the
	is-virtual attribute.
	* tests/data/test-read-write/test20.xml: New test input data.
	* tests/test-read-write.cc: De-serialize the test above, serialize
	it back and compare that both versions are the same.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
c94ef0da7a Iron out support for simple base classes.
* src/abg-ir.h (class_decl::base_spec::base_spec): Move this
	out-of-line.  Add a new constructor for clients compiled without
	RTTI.
	* src/abg-ir.cc (class_decl::base_spec::base_spec):  This is now
	here out-of-line.  Define the new constructor for clients compiled
	without RTTI.
	* tests/data/test-read-write/test19.xml: New test case input for
	base classes.
	* tests/test-read-write.cc: De-serialize and serialize the new
	test case input above.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
b04ca87487 Fix handling of forward decl of classes
* abg-ir.h (class_decl::set_earlier_declaration): Move this
	out-of-line and add an overload.
	* src/abg-ir.cc (class_decl::set_earlier_declaration): Moved this
	out-of-line here and add an overload.
	* src/abg-reader.cc (build_class_decl): Really read the
	'decl-of-decl-id' property.  Do not make the definition use the id
	of the declaration.  Both have their id.
	* src/abg-writer.cc (write_class_decl):  Put a space before the
	property "def-of-decl-id".
	* tests/data/test-read-write/test18.xml: New test input.
	* tests/test-read-write.cc: De-serialize this new input, serialize
	it back and make sure both versions are identical.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
a9ad6be655 Serialize the layout offset of class data members.
* src/abg-writer.cc (write_layout_offset): New function.
	(write_class_decl): Serialize the layout offset.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
157529b027 Support Bitwise OR for qualified_type_def::CV better
* src/abg-ir.h (qualified_type_def::CV_RESTRICT): New enumerator
	for the qualified_type_def::CV enum.
	(operator|(qualified_type_def::CV, qualified_type_def::CV)): New
	declaration.
	* src/abg-ir.cc (operator|(qualified_type_def::CV,
	qualified_type_def::CV)): New definition.
	* src/abg-reader.cc (build_qualified_type_decl): No need for
	casting the result of bitwise or between instances of
	qualified_type_def::CV.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
c243aac0a4 Support method type/decl, variadic functions, class declarations-only
* src/abg-ir.h (function_decl::parameter::parameter): New
	constructor with variadic parameter marker.
	(function_decl::m_type): Make this protected to let method_decl
	inheriting class to access it.
	(function_decl::get_type): Move this out-of-line.
	(class method_type, method_type_hash): New types.
	(enum class_decl::access_specifier): Add no_access new enumerator.
	(class_decl::data_member::data_member): Move this out-of-line.
	(class_decl::data_member::~data_member): Declare virtual
	destructor.
	(class method_decl): New class.
	(class member_function): Make this inherit method_decl, instead of
	function_decl.
	(class_decl::class_decl): New constructors.
	(class_decl::{hashing_started, is_declaration_only,
	set_earlier_declaration, get_earlier_declaration}): New methods.
	* src/abg-ir.cc (add_decl_to_scope): If a decl is already in a
	scope, don't add it to this scope.
	(get_global_scope): Make this work when passed an instance of
	global_scope.
	(dynamic_type_hash::operator()): Add support for method_type.
	(method_type::{method_type, set_class_type, ~method_type, })
	(method_type_hash::operator()): New defintions.
	(function_decl::get_type, class_decl::class_decl): Move these
	out-of-line here.
	(class_decl::method_decl::{method_decl, ~method_decl, get_type}):
	New definitions.
	(class_decl::member_function::member_function): Move this
	out-of-line here.  Support method_decl.
	(class_decl::data_member::data_member): Likewise.
	(class_decl_hash::operator()): Guard this against endless loop.
	* src/abg-reader.cc (write_class_is_declaration_only): New static
	function.
	(write_var_decl): Take a flag to write the mangled name or not.
	(write_function_decl): Take a flag to skip the first parameter.
	(write_cdtor_const_static): Use 'yes' instead of 'true' as value
	of the properties.
	(write_decl, write_function_template_decl): Adjust wrt the new
	signatures of write_var_decl and write_function_decl.
	(write_enum_type_decl): Simplify call to write_location.
	(write_class_decl): Support serializing declaration-only classes.
	* src/abg-writer.cc:
	* tests/data/test-read-write/test17.xml: New test input.
	* tests/test-read-write.cc: De-serialize the above, and serialize it back.
	* tests/data/test-read-write/test10.xml: Update this test.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
0c65215330 Support function_type and adapt a function_decl to use it
* src/abg-ir.h (class function_type): Forward decl prior to class
	function_decl.
	(function_decl::parameter): Pass string by const reference.  Add a
	variadic marker member and initialize it.
	(function_decl::parameter::get_type): Add a non-const overload.
	(function_decl::parameter::get_variadic_marker): New getter.
	(function_decl::function_decl) Take a const reference to a vector
	for parameters, type size/alignment.  Add two overloads that takes a
	pointer to function_type.
	(function_decl::get_parameters): Move this out-of-line.
	(function_decl::append_parameter(s)): Renamed
	function_decl::add_parameter(s) into these.  Move it out-of-line.
	Add an overload.
	(function_decl::{get_type, set_type}): New declaration.
	(function_decl::get_return_type): Move this out-of-line.
	(function_decl::is_variadic): New in-line function.
	(function_decl::m_type): New data member.
	(function_decl::{m_parms, m_return_type}): Remove.  This are now
	carried by function_decl::m_type.
	(class function_type, struct function_type_hash): New
	declarations.
	(member_function::member_function): Take a vector of pointers to
	parameters.  Take size/align of the type of the member function.
	Adjust initialization.
	* src/abg-ir.cc (dynamic_type_hash): Hash instance of
	function_type accessed through a pointer.
	(function_type::{operator==, ~function_type})
	(function_type_hash::operaror(), function_decl::{get_return_type,
	}, function_decl::parameter:#️⃣:operator()): New definitions.
	(function_decl::function_decl): The out-of-line definitions of the
	declarations above.
	(function_decl::append_parameter): Moved this out-of-line from
	inline function_decl::add_parameter.  Make this rely on the
	underlying m_type.
	(function_decl::operator==): Adjust for use of vector for the
	parameters.  Also, there is no need anymore to compare the
	parameters or the return types as they are compared by the
	comparison of the function types.
	* src/abg-reader.cc (build_function_decl): Read the new size/alignment
	attributes on the function-decl element.  Build a function_type
	and use it to build the function_decl.  Parameters and return type
	are now hung off of the function_type.
	(handle_function_decl): use build_function_decl.
	* src/abg-writer.cc (write_function_decl): Write the new
	size/alignment properties of the function-decl element.  Adjust
	for the use of vectors for function parameters now.
	* tests/data/test-read-write/test10.xml: Adjust for the presence
	of size/alignment properties in the function-decl element now.
	* tests/data/test-read-write/test11.xml: Likewise.
	* tests/data/test-read-write/test12.xml: Likewise.
	* tests/data/test-read-write/test13.xml: Likewise.
	* tests/data/test-read-write/test14.xml: Likewise.
	* tests/data/test-read-write/test9.xml: Likewise.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
ab86692904 Support null type hashing
* src/abg-ir.cc (dynamic_type_hash::operator()(const type_base* t)
	const): Support hashing null type.
2013-07-23 23:13:53 +02:00
Dodji Seketeli
19016962ab Add a couple of output file suffix configuration properties
* src/abg-config.h (config::{get_tu_instr_suffix,
	set_tu_instr_suffix, get_tu_instr_archive_suffix,
	set_tu_instr_archive_suffix}): New decls.
	* src/abg-config.cc (config::{get_tu_instr_suffix,
	set_tu_instr_suffix, get_tu_instr_archive_suffix,
	set_tu_instr_archive_suffix}): New defs.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
e43a5286fb Add a new add_decl_to_scope overload
* src/abg-ir.h (add_decl_to_scope): New declaration.
	* src/abg-ir.cc (add_decl_to_scope): New definition.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
0d0726b1ed Ensure add_decl_to_scope properly updates the scope
* src/abg-ir.h (scope_decl::m_member_scopes)
	(scope_decl::get_member_scopes): New declarations.
	(scope_decl::add_member_decl): Move this to ...
	* src/abg-ir.cc (scope_decl::add_member_decl): ... here.  Make it
	update the new scope_decl::m_member_scopes too.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
750b14c159 Add translation_unit::get_path
* src/abg-ir.cc (translation_unit::get_path): New declaration.
	* src/abg-ir.cc (translation_unit::get_path): New definition.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
85af4588e7 Link the global scope to its translation unit
* src/abg-ir.h (global_scope::global_scope): Take a translation
	unit and initialize the tu member with it.
	* src/abg-ir.cc (translation_unit::get_global_scope): Initialize
	the global scope with its actual translation unit.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
a0a6ce46a5 Have location numbers that are stable throughout translation unit editing
* src/abg-irc.cc (location_manager::create_new_location): Just
	append the new expanded location to the end of the location
	vectors, and return the new size of the vector as the location
	number.  That way we don't change the location number of an
	expanded location that is already in the vector -- that change
	happens if we keep the vector sorted during the insertion.
	(location_manager::expand_location):  The index of the expanded
	location is the location number - 1.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
dae05596a6 Fix in-source detection of the library for GCC
* abigail.m4 (ABIGAIL_INIT): Don't forget to set abigaillibs when
	we detect the library in the source tree, particularly for GCC.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
98bb3a8721 Re-generate aclocal.m4
* aclocal.m4: Re-generate with autoconf 2.64.
2013-07-23 23:13:52 +02:00
Benjamin Kosnik
cdf03dd644 Generate abg-version at configure time in builddir
* configure.ac: Add src/abg-version.h to AC_CONFIG_FILES.
	* src/Makefile.am: Remote ad-hoc generation of abg-version.h from
	here.
	* src/abg-version.h.in: New file.
	* configure: Re-generate.
	* src/Makefile.in: Likewise.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
61ae9b831a add abigail.m4 to the distribution
* Makefile.am: Add abigail.m4 to the distribution.
	* Makefile.in: Re-generate.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
fb4916db06 Pedantic fixes
* src/abg-ir.h (enum decl_base::binding): Remove trailing space.
	(enum class_decl::access_specifier): Likewise.
2013-07-23 23:13:52 +02:00
Dodji Seketeli
44db5ccb71 Fix for building libabigail inside the GCC tree
* abigail.m4: Detect when we are in the GCC tree; disable version
	check in that case.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
8b28981421 Re-generate configury with autoconf 2.64
* abigail.m4: Add licence header.
	* configure.ac: Re-generate configure script with autoconf 2.64
	like for GCC.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
e4fefbdbe4 Allow autoconf-based clients to detect the library
* configure.ac: Define the components of the version number as
	autoconf variables.  Set the version number to 0.1.0
	* abigail.m4: New file
	* Makefile.am: Add abigail.m4 to the build system.  Install it in
	  $(datadir)/aclocal.
	* src/Makefile.am: Generate and add abg-version.h from the version
	number autoconf variable defined in configure.ac.  Re-generate
	abg-version.h each time configure.ac changes.
	* src/abg-config.h (abigail_get_library_version): Declare ...
	* src/abg-config.cc (abigail_get_library_version): ... and define
	this wirth C linkage.  This is useful for autoconf tests to test
	for the presence of the library.
	* configure: Re-generate.
	* Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* tests/Makefile.in: Likewise.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
3563b06270 Build system fix for make distcheck
* Makefile.am: Support the doc sub-directory.  We don't have a
	COPYRIGHT file.
	* src/Makefile.am: Don't prefix the file paths by the absolute
	path of the src dir; current autotools know how to deal with it,
	otherwise and it break them.
	* tests/Makefile.am: Likewise.  Make sure to remove the output of
	the tests upon make clean.
	* Makefile.in: Re-generate.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* src/Makefile.in: Likewise.
	* tests/Makefile.in: Likewise.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
a7e6fbbd7d Initial support for member class templates
* src/abg-ir.cc (class_decl::add_member_function_template): Fix
	comment.
	(class_decl::add_member_class_template)
	(class_decl::member_class_template::operator==)
	(class_decl::member_class_template_hash::operator()): New
	definitions.
	(class_decl::operator==): Compare member templates.  Fix logic.
	(class_decl::data_member_hash::operator())
	(class_decl::member_function_hash::operator())
	(class_decl::member_function_template_hash::operator()): Don't
	hash the is_static boolean as it's hashed as part of the 'member'
	sub-object hashing.
	(class_decl::member_function_template::operator==): Move this out
	of line here, from the header file.
	(class_decl_hash::operator()): Hash member class templates.
	* src/abg-ir.h (class_decl::member::{m_is_static,is_static}): Add the is_static
	boolean here, so that it's factorized out of the inherited classes
	of this class.
	(class_decl::data_member::{is_static, m_is_static})
	(class_decl::member_function::{is_static, m_is_static})
	(class_decl::member_function_template::{is_static, m_is_static}): Remove this
	as it's now part of the base 'member' class.
	(class_decl::data_member::operator==)
	(class_decl::member_function::operator==): Don't compare the
	is_static boolean as it's now compared as part of the 'member'
	sub-object comparison.
	(class_decl::member_function_template::operator==): Move this
	out-of-line into src/abg-ir.cc.
	(class class_decl::member_class_template, struct
	class_decl::member_class_template_hash)
	(class_decl::{add_member_class_template,
	get_member_class_templates}): New declarations.
	(class_decl::member_class_templates_type): New typedef.
	* src/abg-reader.cc (build_class_decl): Support de-serializing
	member class templates.
	* src/abg-writer.cc (write_class_decl): Likewise, support
	serializing member class templates.
	* tests/data/test-read-write/test16.xml: New test input.
	* tests/test-read-write.cc (int_out_specs[]): Add the new test
	input to the list of inputs that are de-serialized and serialized
	back.
	* tests/Makefile.am: Add the new test input to the distribution.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
c50b9dbb55 Initial support of class templates
* src/abg-ir.cc (class_template_decl::class_template_decl)
	(class_template_decl::set_pattern)
	(class_template_decl::operator==)
	(class_template_decl::~class_template_decl)
	(class_template_decl_hash::operator())
	(class_tmpl_shared_ptr_hash::operator()): New definitions.
	* src/abg-ir.h (class class_template_decl, struct
	class_tmpl_shared_ptr_hash, struct class_tmpl_shared_ptr_hash):
	New declarations.
	* src/abg-reader.cc (read_context::const_class_tmpl_map_it): New
	typedef.
	(read_context::get_fn_tmpl_decl): Fix comment.
	(read_context::{get_class_tmpl_decl,key_class_tmpl_decl})
	(build_class_template_decl, handle_class_template_decl): New
	definitions.
	(read_context::m_class_tmpl_map): New member.
	(handle_element): Support "class-template-decl" xml elements
	nodes.
	(build_class_decl): Add missing bits to comment.
	(build_function_template_decl): Fix spacing.
	* src/abg-writer.cc (class_tmpl_shared_ptr_map): New typedef.
	(write_context::m_class_tmpl_map): New member.
	(write_context::get_id_for_class_tmpl, write_class_template_decl):
	New definitions.
	(write_template_parameters): Factorize this this out from ...
	(write_function_template_decl): ... here.
	(write_decl): Support writing instances of class_template_decl.
	Fix spacing.
	* tests/data/test-read-write/test15.xml: New test input.
	* tests/Makefile.am: Add the new test15.xml input to the
	distribution.
	* tests/test-read-write.cc (in_out_specs): Add the new test15.xml
	test to the list of serialized output to be de-serialized and
	serialized back.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
9b14a86ac4 Fix function_tempalte_decl init & hashing
* src/abg-ir.cc (function_template_decl::operator==): Compare the
	patterns, not a pointer to them.
	(function_template_decl_hash::operator()): Don't try to hash null
	patterns.
	* src/abg-ir.h (function_template_decl::function_template_decl):
	Use function_template_decl::set_pattern to set the pattern here.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
97ef8941b3 Support member function templates
* src:abg-ir.h: Move template declarations before class
	class_decl, so that class_decl can have member templates.
	(class class_decl::member_function_template)
	(class_decl::add_member_function_template)
	(class_decl::{base_specs_type, member_types_type,
	data_members_types, member_functions_type,
	member_function_templates_type}): New declarations.
	* src/abg-ir.cc (class_decl::add_member_function_template)
	(class_decl::member_function_template_hash::operator()): New
	definitions.
	(class_decl_hash::operator()):  Support hashing for member
	function templates.
	* src/abg-reader.cc (build_class_decl): Use the new
	class_decl::{member_types_type, data_members_type,
	member_functions_type, base_specs_type} types.  Support member
	function templates.
	* src/abg-writer.cc (write_cdtor_const_static): New definition.
	(write_class_decl): Support member function templates.
	* tests/data/test-read-write/test14.xml: New input data.
	* tests/Makefile.am: Add it to the distribution.
	* tests/test-read-write.cc (InOutSpec int_out_specs): De-serialize
	the new test input file, serialize it back and diff both results.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
2b44ad22ea Inheritance fix
* src/abg-ir.h (class template_non_type_parameter): Make this
	inherit decl_base virtually.
2013-07-23 23:13:51 +02:00
Dodji Seketeli
f6a157a519 Small comment fix
* src/abg-ir.h (class template_decl): Fix comment.
2013-07-23 23:13:51 +02:00