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>
This commit is contained in:
Dodji Seketeli 2013-10-10 10:11:35 +02:00
parent 997e2d9328
commit 5f2b66d22e
4 changed files with 829 additions and 876 deletions

View File

@ -36,208 +36,131 @@
/// Toplevel namespace for libabigail.
namespace abigail
{
/**
@mainpage libabigail
/**
@mainpage libabigail
The GNU Application Binary Interface Generic Analysis and
Instrumentation Library.
The GNU Application Binary Interface Generic Analysis and
Instrumentation Library.
This is an interface to the GNU Compiler Collection for the
collection and analysis of compiler-generated binaries.
This is an interface to the GNU Compiler Collection for the
collection and analysis of compiler-generated binaries.
Checkout out the project homepage <a
href="http://sourceware.org/libabigail"> here</a>.
Checkout out the project homepage <a
href="http://sourceware.org/libabigail"> here</a>.
The current libabigail source code can be checked out with:
git clone git://git.sourceware.org/git/libabigail.git.
The current libabigail source code can be checked out with:
git clone git://git.sourceware.org/git/libabigail.git.
The mailing list to send messages and patches to is
libabigail@sourceware.org.
*/
The mailing list to send messages and patches to is
libabigail@sourceware.org.
*/
// Inject some types.
using std::tr1::shared_ptr;
using std::string;
// Inject some types.
using std::tr1::shared_ptr;
using std::string;
// Pull in relational operators.
using namespace std::rel_ops;
// Pull in relational operators.
using namespace std::rel_ops;
// Forward declarations for corpus.
// Forward declarations for corpus.
class corpus;
class corpus;
// Forward declarations for ir.
class location;
class location_manager;
class translation_unit;
class class_decl;
class class_tdecl;
class decl_base;
class enum_type_decl;
class function_decl;
class function_tdecl;
class function_type;
class global_scope;
class node_visitor;
class location;
class location_manager;
class method_type;
class namespace_decl;
class parameter;
class pointer_type_def;
class qualified_type_def;
class reference_type_def;
class scope_decl;
class scope_type_decl;
class template_decl;
class template_parameter;
class non_type_tparameter;
class type_tparameter;
class template_tparameter;
// Forward declarations for ir.
class location;
class location_manager;
class translation_unit;
class class_decl;
class class_tdecl;
class decl_base;
class enum_type_decl;
class function_decl;
class function_tdecl;
class function_type;
class global_scope;
class node_visitor;
class location;
class location_manager;
class method_type;
class namespace_decl;
class parameter;
class pointer_type_def;
class qualified_type_def;
class reference_type_def;
class scope_decl;
class scope_type_decl;
class template_decl;
class template_parameter;
class non_type_tparameter;
class type_tparameter;
class template_tparameter;
class type_composition;
class type_base;
class type_decl;
class typedef_decl;
class var_decl;
class type_composition;
class type_base;
class type_decl;
class typedef_decl;
class var_decl;
struct type_shared_ptr_equal;
struct traversable_base;
struct type_shared_ptr_equal;
struct traversable_base;
void
add_decl_to_scope(shared_ptr<decl_base>, scope_decl*);
void
add_decl_to_scope(shared_ptr<decl_base>, scope_decl*);
void
add_decl_to_scope (shared_ptr<decl_base>, shared_ptr<scope_decl>);
void
add_decl_to_scope (shared_ptr<decl_base>, shared_ptr<scope_decl>);
global_scope*
get_global_scope(const shared_ptr<decl_base>);
global_scope*
get_global_scope(const shared_ptr<decl_base>);
translation_unit*
get_translation_unit(const shared_ptr<decl_base>);
translation_unit*
get_translation_unit(const shared_ptr<decl_base>);
/// Tests whether if a given scope is the global scope.
///
/// @param scpe the scope to consider.
///
/// @return true iff the current scope is the global one.
bool
is_global_scope(const scope_decl* scpe);
bool
is_global_scope(const scope_decl* scpe);
/// Tests whether if a given scope is the global scope.
///
/// @param scpe the scope to consider.
///
/// @return true iff the current scope is the global one.
bool
is_global_scope(const shared_ptr<scope_decl> scpe);
bool
is_global_scope(const shared_ptr<scope_decl> scpe);
/// Tests whether a given declaration is at global scope.
///
/// @param dcl the decl to consider.
///
/// @return true iff dcl is at global scope.
bool
is_at_global_scope(const shared_ptr<decl_base> dcl);
bool
is_at_global_scope(const shared_ptr<decl_base> dcl);
/// Tests whether a given decl is at class scope.
///
/// @param dcl the decl to consider.
///
/// @return true iff dcl is at class scope.
bool
is_at_class_scope(const shared_ptr<decl_base> dcl);
bool
is_at_class_scope(const shared_ptr<decl_base> dcl);
/// Tests whether a given decl is at template scope.
///
/// Note that only template parameters , types that are compositions,
/// and template patterns (function or class) can be at template scope.
///
/// @param dcl the decl to consider.
///
/// @return true iff the dcl is at template scope.
bool
is_at_template_scope(const shared_ptr<decl_base> dcl);
bool
is_at_template_scope(const shared_ptr<decl_base> dcl);
/// Tests whether a decl is a template parameter.
///
/// @param dcl the decl to consider.
///
/// @return true iff decl is a template parameter.
bool
is_template_parameter(const shared_ptr<decl_base> dcl);
bool
is_template_parameter(const shared_ptr<decl_base> dcl);
/// Tests whether a declaration is a type.
///
/// @param decl the decl to consider.
///
/// @return true iff decl is a type.
bool
is_type(const shared_ptr<decl_base> decl);
bool
is_type(const shared_ptr<decl_base> decl);
/// Tests whether a decl is a template parameter composition type.
///
/// @param dcl the declaration to consider.
///
/// @return true iff dcl is a template parameter composition type.
bool
is_template_parm_composition_type(const shared_ptr<decl_base> dcl);
bool
is_var_decl(const shared_ptr<decl_base> decl);
/// Tests whether a decl is a template.
///
/// @param dcl the decl to consider.
///
/// @return true iff dcl is a function template, class template, or
/// template template parameter.
bool
is_template_decl(const shared_ptr<decl_base> dcl);
bool
is_template_parm_composition_type(const shared_ptr<decl_base> dcl);
/// Test whether a decl is the pattern of a function template.
///
/// @param dcl the decl to consider.
///
/// @return true iff dcl is the pattern of a function template.
bool
is_function_template_pattern(const shared_ptr<decl_base> dcl);
bool
is_template_decl(const shared_ptr<decl_base> dcl);
bool
is_function_template_pattern(const shared_ptr<decl_base> dcl);
/// Appends a declaration to a given scope, if the declaration
/// doesn't already belong to one.
///
/// @param dcl the declaration to add to the scope
///
/// @param scpe the scope to append the declaration to
void
add_decl_to_scope(shared_ptr<decl_base> dcl, scope_decl* scpe);
void
add_decl_to_scope(shared_ptr<decl_base> dcl, scope_decl* scpe);
/// Appends a declaration to a given scope, if the declaration doesn't already
/// belong to a scope.
///
/// @param dcl the declaration to add append to the scope
///
/// @param scpe the scope to append the dcl to
void
add_decl_to_scope(shared_ptr<decl_base> dcl, shared_ptr<scope_decl> scpe);
void
add_decl_to_scope(shared_ptr<decl_base> dcl, shared_ptr<scope_decl> scpe);
/// Return the global scope as seen by a given declaration.
///
/// @param dcl the declaration to consider.
///
/// @return the global scope of the decl, or a null pointer if the
/// decl is not yet added to a translation_unit.
global_scope*
get_global_scope(const shared_ptr<decl_base> dcl);
/// Return the translation unit a declaration belongs to.
///
/// @param dcl the declaration to consider.
///
/// @return the resulting translation unit, or null if the decl is not
/// yet added to a translation unit.
translation_unit*
get_translation_unit(const shared_ptr<decl_base> dcl);
global_scope*
get_global_scope(const shared_ptr<decl_base> dcl);
translation_unit*
get_translation_unit(const shared_ptr<decl_base> dcl);
} // end namespace abigail
#endif // __ABG_IRFWD_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -610,7 +610,7 @@ write_translation_unit(const translation_unit& tu,
else
o << ">";
typedef scope_decl::declarations declarations;
typedef scope_decl::declarations declarations;
typedef typename declarations::const_iterator const_iterator;
const declarations& d = tu.get_global_scope()->get_member_decls();
@ -640,7 +640,7 @@ write_translation_unit(const translation_unit& tu,
///
/// @return true upon successful completion, false otherwise.
static bool
write_type_decl(const shared_ptr<type_decl> d, write_context& ctxt,
write_type_decl(const shared_ptr<type_decl> d, write_context& ctxt,
unsigned indent)
{
if (!d)
@ -686,7 +686,7 @@ write_namespace_decl(const shared_ptr<namespace_decl> decl,
o << "<namespace-decl name='" << decl->get_name() << "'>";
typedef scope_decl::declarations declarations;
typedef scope_decl::declarations declarations;
typedef typename declarations::const_iterator const_iterator;
const declarations& d = decl->get_member_decls();
@ -1193,7 +1193,7 @@ write_class_decl(const shared_ptr<class_decl> decl,
/// @param indent the initial indentation to use.
///
/// @return true upon successful completion, false otherwise.
static bool
static bool
write_type_tparameter(const shared_ptr<type_tparameter> decl,
write_context& ctxt, unsigned indent)
{