11#include "llvm/Support/FormattedStream.h"
12#include "llvm/Support/raw_ostream.h"
31 m_types.insert(std::make_pair(type_sp->GetID(), type_sp));
39 for (pos =
m_types.find(type_uid);
40 pos != end && pos->second->GetID() == type_uid; ++pos) {
41 if (pos->second.get() == type_sp.get())
86 for (pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
101 std::function<
bool(
const lldb::TypeSP &type_sp)>
const &callback)
const {
102 for (
auto pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
103 if (!callback(pos->second))
109 std::function<
bool(
lldb::TypeSP &type_sp)>
const &callback) {
110 for (
auto pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
111 if (!callback(pos->second))
120 pos != end && pos->first == uid; ++pos) {
121 if (pos->second == type_sp) {
132 for (
const auto &pair :
m_types)
133 pair.second->Dump(s, show_context, level);
137 llvm::StringRef type_basename,
138 TypeClass type_class,
bool exact_match) {
147 for (pos =
m_types.begin(); pos != end; ++pos) {
148 Type *the_type = pos->second.get();
149 bool keep_match =
false;
150 TypeClass match_type_class = eTypeClassAny;
152 if (type_class != eTypeClassAny) {
154 if ((match_type_class & type_class) == 0)
159 if (match_type_name_const_str) {
160 const char *match_type_name = match_type_name_const_str.
GetCString();
161 llvm::StringRef match_type_scope;
162 llvm::StringRef match_type_basename;
166 if (match_type_basename == type_basename) {
167 const size_t type_scope_size = type_scope.size();
168 const size_t match_type_scope_size = match_type_scope.size();
169 if (exact_match || (type_scope_size == match_type_scope_size)) {
170 keep_match = match_type_scope == type_scope;
172 if (match_type_scope_size > type_scope_size) {
173 const size_t type_scope_pos = match_type_scope.rfind(type_scope);
174 if (type_scope_pos == match_type_scope_size - type_scope_size) {
175 if (type_scope_pos >= 2) {
186 if (match_type_scope[type_scope_pos - 1] ==
':' &&
187 match_type_scope[type_scope_pos - 2] ==
':') {
198 keep_match = type_scope.empty() && type_basename == match_type_name;
203 matching_types.insert(*pos);
lldb::TypeClass GetTypeClass() const
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
A stream class that can stream formatted output to a file.
lldb::TypeSP FirstType() const
void Insert(const lldb::TypeSP &type)
bool Remove(const lldb::TypeSP &type_sp)
bool InsertUnique(const lldb::TypeSP &type)
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) const
std::multimap< lldb::user_id_t, lldb::TypeSP > collection
collection::iterator iterator
void RemoveMismatchedTypes(llvm::StringRef type_scope, llvm::StringRef type_basename, lldb::TypeClass type_class, bool exact_match)
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
CompilerType GetForwardCompilerType()
static bool GetTypeScopeAndBasename(llvm::StringRef name, llvm::StringRef &scope, llvm::StringRef &basename, lldb::TypeClass &type_class)
ConstString GetQualifiedName()
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Type > TypeSP