]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Symbol/TypeList.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Symbol / TypeList.h
1 //===-- TypeList.h ----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef liblldb_TypeList_h_
10 #define liblldb_TypeList_h_
11
12 #include "lldb/Symbol/Type.h"
13 #include "lldb/Utility/Iterable.h"
14 #include "lldb/lldb-private.h"
15 #include <functional>
16 #include <vector>
17
18 namespace lldb_private {
19
20 class TypeList {
21 public:
22   // Constructors and Destructors
23   TypeList();
24
25   virtual ~TypeList();
26
27   void Clear();
28
29   void Dump(Stream *s, bool show_context);
30
31   //    lldb::TypeSP
32   //    FindType(lldb::user_id_t uid);
33
34   TypeList FindTypes(ConstString name);
35
36   void Insert(const lldb::TypeSP &type);
37
38   uint32_t GetSize() const;
39
40   lldb::TypeSP GetTypeAtIndex(uint32_t idx);
41
42   typedef std::vector<lldb::TypeSP> collection;
43   typedef AdaptedIterable<collection, lldb::TypeSP, vector_adapter>
44       TypeIterable;
45
46   TypeIterable Types() { return TypeIterable(m_types); }
47
48   void ForEach(
49       std::function<bool(const lldb::TypeSP &type_sp)> const &callback) const;
50
51   void ForEach(std::function<bool(lldb::TypeSP &type_sp)> const &callback);
52
53   void RemoveMismatchedTypes(const char *qualified_typename, bool exact_match);
54
55   void RemoveMismatchedTypes(const std::string &type_scope,
56                              const std::string &type_basename,
57                              lldb::TypeClass type_class, bool exact_match);
58
59   void RemoveMismatchedTypes(lldb::TypeClass type_class);
60
61 private:
62   typedef collection::iterator iterator;
63   typedef collection::const_iterator const_iterator;
64
65   collection m_types;
66
67   DISALLOW_COPY_AND_ASSIGN(TypeList);
68 };
69
70 } // namespace lldb_private
71
72 #endif // liblldb_TypeList_h_