gdb: use gdb::optional instead of passing a pointer to gdb::array_view
[deliverable/binutils-gdb.git] / gdb / filename-seen-cache.h
index dd9cf7a8d7974fef1fba4aa6fba1a49759427697..89e07044fdbf4f50442a5d04113e73b7e7ab8492 100644 (file)
@@ -1,6 +1,6 @@
 /* Filename-seen cache for the GNU debugger, GDB.
 
-   Copyright (C) 1986-2017 Free Software Foundation, Inc.
+   Copyright (C) 1986-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef FILENAME_SEEN_CACHE_H
+#define FILENAME_SEEN_CACHE_H
+
 #include "defs.h"
-#include "common/function-view.h"
+#include "gdbsupport/function-view.h"
 
 /* Cache to watch for file names already seen.  */
 
@@ -26,11 +29,8 @@ class filename_seen_cache
 {
 public:
   filename_seen_cache ();
-  ~filename_seen_cache ();
 
-  /* Disable copy.  */
-  filename_seen_cache (const filename_seen_cache &) = delete;
-  void operator= (const filename_seen_cache &) = delete;
+  DISABLE_COPY_AND_ASSIGN (filename_seen_cache);
 
   /* Empty the cache, but do not delete it.  */
   void clear ();
@@ -54,10 +54,12 @@ public:
        return 1;
       };
 
-    htab_traverse_noresize (m_tab, erased_cb, &callback);
+    htab_traverse_noresize (m_tab.get (), erased_cb, &callback);
   }
 
 private:
   /* Table of files seen so far.  */
-  htab_t m_tab;
+  htab_up m_tab;
 };
+
+#endif /* FILENAME_SEEN_CACHE_H */
This page took 0.024312 seconds and 4 git commands to generate.