Rename read_elf_symbol_binding to read_elf_symbol_visibility.
Commit Message
From: Mark Wielaard <mark@klomp.org>
read_elf_symbol_binding was overloaded so that it could be called to
read either a binding or a visibility attribute. This is slightly
confusing, since another elf_symbol attribute, type, does have its own
read_elf_symbol_type. Rename the read_elf_symbol_binding that reads
the visibility to read_elf_symbol_visibility for claritiy.
* src/abg-reader.cc (read_elf_symbol_binding): Renamed to...
(read_elf_symbol_visibility): ...this.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
src/abg-reader.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
On Sun, Apr 26, 2020 at 10:56:22PM +0200, Mark J. Wielaard wrote:
>From: Mark Wielaard <mark@klomp.org>
>
>read_elf_symbol_binding was overloaded so that it could be called to
>read either a binding or a visibility attribute. This is slightly
>confusing, since another elf_symbol attribute, type, does have its own
>read_elf_symbol_type. Rename the read_elf_symbol_binding that reads
>the visibility to read_elf_symbol_visibility for claritiy.
>
> * src/abg-reader.cc (read_elf_symbol_binding): Renamed to...
> (read_elf_symbol_visibility): ...this.
>
>Signed-off-by: Mark Wielaard <mark@klomp.org>
Reviewed-by: Matthias Maennich <maennich@google.com>
Cheers,
Matthias
>---
> src/abg-reader.cc | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/src/abg-reader.cc b/src/abg-reader.cc
>index dcaa27e1..3727e044 100644
>--- a/src/abg-reader.cc
>+++ b/src/abg-reader.cc
>@@ -1166,6 +1166,8 @@ static bool read_is_struct(xmlNodePtr, bool&);
> static bool read_is_anonymous(xmlNodePtr, bool&);
> static bool read_elf_symbol_type(xmlNodePtr, elf_symbol::type&);
> static bool read_elf_symbol_binding(xmlNodePtr, elf_symbol::binding&);
>+static bool read_elf_symbol_visibility(xmlNodePtr,
>+ elf_symbol::visibility&);
>
> static namespace_decl_sptr
> build_namespace_decl(read_context&, const xmlNodePtr, bool);
>@@ -2743,7 +2745,7 @@ read_elf_symbol_binding(xmlNodePtr node, elf_symbol::binding& b)
> ///
> /// @return true iff the function completed successfully.
> static bool
>-read_elf_symbol_binding(xmlNodePtr node, elf_symbol::visibility& v)
>+read_elf_symbol_visibility(xmlNodePtr node, elf_symbol::visibility& v)
> {
> if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "visibility"))
> {
>@@ -2883,7 +2885,7 @@ build_elf_symbol(read_context& ctxt, const xmlNodePtr node,
> read_elf_symbol_binding(node, binding);
>
> elf_symbol::visibility visibility = elf_symbol::DEFAULT_VISIBILITY;
>- read_elf_symbol_binding(node, visibility);
>+ read_elf_symbol_visibility(node, visibility);
>
> elf_symbol::version version(version_string, is_default_version);
>
>--
>2.20.1
>
Hello Mark,
"Mark J. Wielaard" <mark@klomp.org> a ?crit:
> From: Mark Wielaard <mark@klomp.org>
>
> read_elf_symbol_binding was overloaded so that it could be called to
> read either a binding or a visibility attribute. This is slightly
> confusing, since another elf_symbol attribute, type, does have its own
> read_elf_symbol_type. Rename the read_elf_symbol_binding that reads
> the visibility to read_elf_symbol_visibility for claritiy.
>
> * src/abg-reader.cc (read_elf_symbol_binding): Renamed to...
> (read_elf_symbol_visibility): ...this.
Applied to master. Thanks!
Cheers,
@@ -1166,6 +1166,8 @@ static bool read_is_struct(xmlNodePtr, bool&);
static bool read_is_anonymous(xmlNodePtr, bool&);
static bool read_elf_symbol_type(xmlNodePtr, elf_symbol::type&);
static bool read_elf_symbol_binding(xmlNodePtr, elf_symbol::binding&);
+static bool read_elf_symbol_visibility(xmlNodePtr,
+ elf_symbol::visibility&);
static namespace_decl_sptr
build_namespace_decl(read_context&, const xmlNodePtr, bool);
@@ -2743,7 +2745,7 @@ read_elf_symbol_binding(xmlNodePtr node, elf_symbol::binding& b)
///
/// @return true iff the function completed successfully.
static bool
-read_elf_symbol_binding(xmlNodePtr node, elf_symbol::visibility& v)
+read_elf_symbol_visibility(xmlNodePtr node, elf_symbol::visibility& v)
{
if (xml_char_sptr s = XML_NODE_GET_ATTRIBUTE(node, "visibility"))
{
@@ -2883,7 +2885,7 @@ build_elf_symbol(read_context& ctxt, const xmlNodePtr node,
read_elf_symbol_binding(node, binding);
elf_symbol::visibility visibility = elf_symbol::DEFAULT_VISIBILITY;
- read_elf_symbol_binding(node, visibility);
+ read_elf_symbol_visibility(node, visibility);
elf_symbol::version version(version_string, is_default_version);