public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@google.com>
To: "Rafael Espíndola" <rafael.espindola@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [patch] Remove is_merge_section_for
Date: Sat, 21 Mar 2015 19:08:00 -0000	[thread overview]
Message-ID: <CAHACq4rJb6upcCqZKgwCQG-L-VvFLArc5o9ysQ=FrhbpD3vUPA@mail.gmail.com> (raw)
In-Reply-To: <CAG3jReLX_6ZV9oWeJHp8NVroph9WjB1brdeZHyUjLAVjPxcZjg@mail.gmail.com>

> Now that Input_merge_map has an Output_section_data, we can use it in
> implementing find_merge_section and replace the only use of
> is_merge_section_for with it.

@@ -151,6 +150,11 @@ class Object_merge_map
   Input_merge_map*
   get_input_merge_map(unsigned int shndx);

+  const Input_merge_map*
+  get_input_merge_map(unsigned int shndx) const {
+    return const_cast<Object_merge_map*>(this)->get_input_merge_map(shndx);
+  }

When you need both const and non-const versions of a method, have the
non-const version call the const version, instead of the other way
around.

+// Build the lookup maps for relaxed sections.  This is needs
 // to be declared as a const methods so that it is callable with a const

s/is needs/needs/
s/as a const methods/as a const method/

+  const Output_section_data* data = this->find_merge_section(object, shndx);
+  if (!data)

I prefer "if (data == NULL)".

This is OK, with a ChangeLog entry and those fixes.

Thanks!

-cary

       reply	other threads:[~2015-03-21 19:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAG3jReLX_6ZV9oWeJHp8NVroph9WjB1brdeZHyUjLAVjPxcZjg@mail.gmail.com>
2015-03-21 19:08 ` Cary Coutant [this message]
2015-03-23 13:25   ` Rafael Espíndola
2015-03-23 17:14     ` Cary Coutant
2015-03-09 16:01 Rafael Espíndola
2015-03-16 14:57 ` Rafael Espíndola
2015-03-19 15:40   ` Rafael Espíndola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHACq4rJb6upcCqZKgwCQG-L-VvFLArc5o9ysQ=FrhbpD3vUPA@mail.gmail.com' \
    --to=ccoutant@google.com \
    --cc=binutils@sourceware.org \
    --cc=rafael.espindola@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).