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) {
95 std::function<
bool(
const lldb::TypeSP &type_sp)>
const &callback)
const {
96 for (
auto pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
97 if (!callback(pos->second))
103 std::function<
bool(
lldb::TypeSP &type_sp)>
const &callback) {
104 for (
auto pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
105 if (!callback(pos->second))
114 pos != end && pos->first == uid; ++pos) {
115 if (pos->second == type_sp) {
126 pos->second->Dump(s, show_context, level);
131 llvm::StringRef type_basename,
132 TypeClass type_class,
bool exact_match) {
141 for (pos =
m_types.begin(); pos != end; ++pos) {
142 Type *the_type = pos->second.get();
143 bool keep_match =
false;
144 TypeClass match_type_class = eTypeClassAny;
146 if (type_class != eTypeClassAny) {
148 if ((match_type_class & type_class) == 0)
153 if (match_type_name_const_str) {
154 const char *match_type_name = match_type_name_const_str.
GetCString();
155 llvm::StringRef match_type_scope;
156 llvm::StringRef match_type_basename;
160 if (match_type_basename == type_basename) {
161 const size_t type_scope_size = type_scope.size();
162 const size_t match_type_scope_size = match_type_scope.size();
163 if (exact_match || (type_scope_size == match_type_scope_size)) {
164 keep_match = match_type_scope == type_scope;
166 if (match_type_scope_size > type_scope_size) {
167 const size_t type_scope_pos = match_type_scope.rfind(type_scope);
168 if (type_scope_pos == match_type_scope_size - type_scope_size) {
169 if (type_scope_pos >= 2) {
180 if (match_type_scope[type_scope_pos - 1] ==
':' &&
181 match_type_scope[type_scope_pos - 2] ==
':') {
192 keep_match = type_scope.empty() && type_basename == match_type_name;
197 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.
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
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
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