lookup_name_info::make_ignore_params
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 5dfe95363418ab4f5776da42c48f6407eb1e5ee0..8cd3496c53062fc0760817c73aa8b49cadae7c41 100644 (file)
@@ -167,9 +167,11 @@ class lookup_name_info final
   /* Create a new object.  */
   lookup_name_info (std::string name,
                    symbol_name_match_type match_type,
-                   bool completion_mode = false)
+                   bool completion_mode = false,
+                   bool ignore_parameters = false)
     : m_match_type (match_type),
       m_completion_mode (completion_mode),
+      m_ignore_parameters (ignore_parameters),
       m_name (std::move (name))
   {}
 
@@ -177,6 +179,16 @@ class lookup_name_info final
   symbol_name_match_type match_type () const { return m_match_type; }
   bool completion_mode () const { return m_completion_mode; }
   const std::string &name () const { return m_name; }
+  const bool ignore_parameters () const { return m_ignore_parameters; }
+
+  /* Return a version of this lookup name that is usable with
+     comparisons against symbols have no parameter info, such as
+     psymbols and GDB index symbols.  */
+  lookup_name_info make_ignore_params () const
+  {
+    return lookup_name_info (m_name, m_match_type, m_completion_mode,
+                            true /* ignore params */);
+  }
 
   /* Get the search name hash for searches in language LANG.  */
   unsigned int search_name_hash (language lang) const
@@ -253,6 +265,7 @@ private:
   /* The lookup info as passed to the ctor.  */
   symbol_name_match_type m_match_type;
   bool m_completion_mode;
+  bool m_ignore_parameters;
   std::string m_name;
 
   /* Language-specific info.  These fields are filled lazily the first
This page took 0.042061 seconds and 4 git commands to generate.