gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gold / gc.cc
index 95867c4bbb6ef4c912b9c5af7698e90a8660b8b0..7ee4eff90b4c71b22c0065308e2e705e285d5e01 100644 (file)
@@ -1,6 +1,6 @@
 // gc.cc -- garbage collection of unused sections
 
-// Copyright (C) 2009-2015 Free Software Foundation, Inc.
+// Copyright (C) 2009-2020 Free Software Foundation, Inc.
 // Written by Sriraman Tallam <tmsriram@google.com>.
 
 // This file is part of gold.
@@ -38,17 +38,10 @@ Garbage_collection::do_transitive_closure()
     {
       // Add elements from the work list to the referenced list
       // one by one.
-      Section_id entry = this->worklist().front();
-      this->worklist().pop();
-      if (this->referenced_list().find(entry)
-          == this->referenced_list().end()) 
-        {
-          this->referenced_list().insert(entry);
-        }
-      else
-        {
-          continue;
-        }
+      Section_id entry = this->worklist().back();
+      this->worklist().pop_back();
+      if (!this->referenced_list().insert(entry).second)
+        continue;
       Garbage_collection::Section_ref::iterator find_it = 
                 this->section_reloc_map().find(entry);
       if (find_it == this->section_reloc_map().end()) 
@@ -64,7 +57,7 @@ Garbage_collection::do_transitive_closure()
           if (this->referenced_list().find(*it_v)
               == this->referenced_list().end())
             {
-              this->worklist().push(*it_v);   
+              this->worklist().push_back(*it_v);
             }
         }
     }
This page took 0.025586 seconds and 4 git commands to generate.