[patch] Remove is_merge_section_for

Cary Coutant ccoutant@google.com
Sat Mar 21 19:08:00 GMT 2015


> 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



More information about the Binutils mailing list