Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:52

0001 //===-- TypeMap.h ----------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_SYMBOL_TYPEMAP_H
0010 #define LLDB_SYMBOL_TYPEMAP_H
0011 
0012 #include "lldb/Symbol/Type.h"
0013 #include "lldb/Utility/Iterable.h"
0014 #include "lldb/lldb-private.h"
0015 #include <functional>
0016 #include <map>
0017 
0018 namespace lldb_private {
0019 
0020 class TypeMap {
0021 public:
0022   // Constructors and Destructors
0023   TypeMap();
0024 
0025   virtual ~TypeMap();
0026 
0027   void Clear();
0028 
0029   void Dump(Stream *s, bool show_context,
0030             lldb::DescriptionLevel level = lldb::eDescriptionLevelFull) const;
0031 
0032   TypeMap FindTypes(ConstString name);
0033 
0034   void Insert(const lldb::TypeSP &type);
0035 
0036   bool Empty() const;
0037 
0038   bool InsertUnique(const lldb::TypeSP &type);
0039 
0040   uint32_t GetSize() const;
0041 
0042   lldb::TypeSP GetTypeAtIndex(uint32_t idx);
0043 
0044   lldb::TypeSP FirstType() const;
0045 
0046   typedef std::multimap<lldb::user_id_t, lldb::TypeSP> collection;
0047   typedef AdaptedIterable<collection, lldb::TypeSP, map_adapter> TypeIterable;
0048 
0049   TypeIterable Types() const { return TypeIterable(m_types); }
0050 
0051   void ForEach(
0052       std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
0053 
0054   void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
0055 
0056   bool Remove(const lldb::TypeSP &type_sp);
0057 
0058 private:
0059   typedef collection::iterator iterator;
0060   typedef collection::const_iterator const_iterator;
0061 
0062   collection m_types;
0063 
0064   TypeMap(const TypeMap &) = delete;
0065   const TypeMap &operator=(const TypeMap &) = delete;
0066 };
0067 
0068 } // namespace lldb_private
0069 
0070 #endif // LLDB_SYMBOL_TYPEMAP_H