2014-04-02 Sriraman Tallam <tmsriram@google.com>
authorSriraman Tallam <tmsriram@google.com>
Wed, 2 Apr 2014 23:46:02 +0000 (16:46 -0700)
committerSriraman Tallam <tmsriram@google.com>
Thu, 3 Apr 2014 00:07:47 +0000 (17:07 -0700)
* icf.cc (get_section_contents): Replace copies of reloc
vectors with (const) references.

gold/ChangeLog
gold/icf.cc

index 7545ddb30909f303b7c87ea113f278ecbe986501..4db6d85186613fbf7846453555783b237c3990de 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-02  Sriraman Tallam  <tmsriram@google.com>
+
+       * icf.cc (get_section_contents): Replace copies of reloc
+       vectors with const references.
+
 2014-04-02  Cary Coutant  <ccoutant@google.com>
 
        * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
index f30eb41b60f9fa8aaf5635626c1a900653ced009..ad887154dd837dbe0affc4c6e63f71489a6d1872 100644 (file)
@@ -269,21 +269,21 @@ get_section_contents(bool first_iteration,
 
   if (it_reloc_info_list != reloc_info_list.end())
     {
-      Icf::Sections_reachable_info v =
+      Icf::Sections_reachable_info &v =
         (it_reloc_info_list->second).section_info;
       // Stores the information of the symbol pointed to by the reloc.
-      Icf::Symbol_info s = (it_reloc_info_list->second).symbol_info;
+      const Icf::Symbol_info &s = (it_reloc_info_list->second).symbol_info;
       // Stores the addend and the symbol value.
-      Icf::Addend_info a = (it_reloc_info_list->second).addend_info;
+      Icf::Addend_info &a = (it_reloc_info_list->second).addend_info;
       // Stores the offset of the reloc.
-      Icf::Offset_info o = (it_reloc_info_list->second).offset_info;
-      Icf::Reloc_addend_size_info reloc_addend_size_info =
+      const Icf::Offset_info &o = (it_reloc_info_list->second).offset_info;
+      const Icf::Reloc_addend_size_info &reloc_addend_size_info =
         (it_reloc_info_list->second).reloc_addend_size_info;
       Icf::Sections_reachable_info::iterator it_v = v.begin();
-      Icf::Symbol_info::iterator it_s = s.begin();
+      Icf::Symbol_info::const_iterator it_s = s.begin();
       Icf::Addend_info::iterator it_a = a.begin();
-      Icf::Offset_info::iterator it_o = o.begin();
-      Icf::Reloc_addend_size_info::iterator it_addend_size =
+      Icf::Offset_info::const_iterator it_o = o.begin();
+      Icf::Reloc_addend_size_info::const_iterator it_addend_size =
         reloc_addend_size_info.begin();
 
       for (; it_v != v.end(); ++it_v, ++it_s, ++it_a, ++it_o, ++it_addend_size)