Make is_global_scope() return a pointer to the global scope

This helps while debugging from GDB.

	* include/abg-fwd.h (is_global_scope): Return a global_scope*.
	* src/abg-ir.cc (is_global_scope): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-03-17 12:00:52 +01:00
parent 75915d5bde
commit f9ec2f1555
2 changed files with 5 additions and 4 deletions

View File

@ -143,7 +143,7 @@ get_translation_unit(const shared_ptr<decl_base>);
bool
is_global_scope(const scope_decl&);
bool
const global_scope*
is_global_scope(const scope_decl*);
bool

View File

@ -3059,10 +3059,11 @@ is_global_scope(const scope_decl& scope)
///
/// @param scope the scope to consider.
///
/// @return true iff the current scope is the global one.
bool
/// @return the @ref global_scope* representing the scope @p scope or
/// 0 if @p scope is not a global scope.
const global_scope*
is_global_scope(const scope_decl* scope)
{return scope ? is_global_scope(*scope) : false;}
{return dynamic_cast<const global_scope*>(scope);}
/// Tests whether if a given scope is the global scope.
///