mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-12 04:19:30 +00:00
Consider a method_decl as always being a member decl
The is_member_decl() function considers that a decl is a member decl only if it's at class scope. In preparation for the support of incremental building of method decls, a method decl, even before being added to its final class, must always be considered as a member decl. This allows for instance, the proper pretty printing of the method decl even before it's added to its class. This patch prepares the upcoming support of incremental building of method decls by making is_member_decl() work on a method_decl that hasn't yet been added to a class, so that is not, strictly-speaking, at class scope yet. * src/abg-ir.cc (is_member_decl): Consider a method decl as always being a member decl. (is_member_function): Use is_member_decl. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
6c100a88b5
commit
0ca774c85a
@ -3141,7 +3141,7 @@ has_scope(const decl_base_sptr d)
|
||||
/// @return true if @p d is a class member, false otherwise.
|
||||
bool
|
||||
is_member_decl(const decl_base_sptr d)
|
||||
{return is_at_class_scope(d);}
|
||||
{return is_at_class_scope(d) || is_method_decl(d);}
|
||||
|
||||
/// Tests if a declaration is a class member.
|
||||
///
|
||||
@ -3150,7 +3150,7 @@ is_member_decl(const decl_base_sptr d)
|
||||
/// @return true if @p d is a class member, false otherwise.
|
||||
bool
|
||||
is_member_decl(const decl_base* d)
|
||||
{return is_at_class_scope(d);}
|
||||
{return is_at_class_scope(d) || is_method_decl(d);}
|
||||
|
||||
/// Tests if a declaration is a class member.
|
||||
///
|
||||
@ -3159,7 +3159,7 @@ is_member_decl(const decl_base* d)
|
||||
/// @return true if @p d is a class member, false otherwise.
|
||||
bool
|
||||
is_member_decl(const decl_base& d)
|
||||
{return is_at_class_scope(d);}
|
||||
{return is_at_class_scope(d) || is_method_decl(d);}
|
||||
|
||||
/// Test if a declaration is a @ref scope_decl.
|
||||
///
|
||||
@ -3432,7 +3432,7 @@ get_data_member_is_laid_out(const var_decl_sptr m)
|
||||
/// @return true if @p f is a member function, false otherwise.
|
||||
bool
|
||||
is_member_function(const function_decl& f)
|
||||
{return is_at_class_scope(f);}
|
||||
{return is_member_decl(f);}
|
||||
|
||||
/// Test whether a function_decl is a member function.
|
||||
///
|
||||
@ -3441,7 +3441,7 @@ is_member_function(const function_decl& f)
|
||||
/// @return true if @p f is a member function, false otherwise.
|
||||
bool
|
||||
is_member_function(const function_decl* f)
|
||||
{return is_member_function(*f);}
|
||||
{return is_member_decl(*f);}
|
||||
|
||||
/// Test whether a function_decl is a member function.
|
||||
///
|
||||
@ -3450,7 +3450,7 @@ is_member_function(const function_decl* f)
|
||||
/// @return true if @p f is a member function, false otherwise.
|
||||
bool
|
||||
is_member_function(const function_decl_sptr& f)
|
||||
{return is_member_function(*f);}
|
||||
{return is_member_decl(*f);}
|
||||
|
||||
/// Test whether a member function is a constructor.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user