This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Remove is_merge_section_for


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]