- /* Given a new match, recompute the lowest common denominator (LCD)
- to hand over to readline. Normally readline computes this itself
- based on the whole set of completion matches. However, some
- completers want to override readline, in order to be able to
- provide a LCD that is not really a prefix of the matches, but the
- lowest common denominator of some relevant substring of each
- match. E.g., "b push_ba" completes to
- "std::vector<..>::push_back", "std::string::push_back", etc., and
- in this case we want the lowest common denominator to be
- "push_back" instead of "std::". */
- void recompute_lowest_common_denominator
- (gdb::unique_xmalloc_ptr<char> &&new_match);
+ /* Ensure that the lowest common denominator held in the member variable
+ M_LOWEST_COMMON_DENOMINATOR is valid. This method must be called if
+ there is any chance that new completions have been added to the
+ tracker before the lowest common denominator is read. */
+ void recompute_lowest_common_denominator ();
+
+ /* Callback used from recompute_lowest_common_denominator, called for
+ every entry in m_entries_hash. */
+ void recompute_lcd_visitor (completion_hash_entry *entry);