11#include "llvm/Support/FormattedStream.h"
12#include "llvm/Support/raw_ostream.h"
69 assert(i <
GetSize() &&
"Accessing past the end of a TypeList");
70 for (pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
79 std::function<
bool(
const lldb::TypeSP &type_sp)>
const &callback)
const {
80 for (
auto pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
87 std::function<
bool(lldb::TypeSP &type_sp)>
const &callback) {
88 for (
auto pos =
m_types.begin(), end =
m_types.end(); pos != end; ++pos) {
96 if (
Type *t = pos->get())
97 t->Dump(s, show_context);
102 llvm::StringRef type_scope;
103 llvm::StringRef type_basename;
104 TypeClass type_class = eTypeClassAny;
106 type_basename, type_class)) {
107 type_basename = qualified_typename;
115 llvm::StringRef type_basename,
116 TypeClass type_class,
bool exact_match) {
125 for (pos =
m_types.begin(); pos != end; ++pos) {
126 Type *the_type = pos->get();
127 bool keep_match =
false;
128 TypeClass match_type_class = eTypeClassAny;
130 if (type_class != eTypeClassAny) {
132 if ((match_type_class & type_class) == 0)
137 if (match_type_name_const_str) {
138 const char *match_type_name = match_type_name_const_str.GetCString();
139 llvm::StringRef match_type_scope;
140 llvm::StringRef match_type_basename;
144 if (match_type_basename == type_basename) {
145 const size_t type_scope_size = type_scope.size();
146 const size_t match_type_scope_size = match_type_scope.size();
147 if (exact_match || (type_scope_size == match_type_scope_size)) {
148 keep_match = match_type_scope == type_scope;
150 if (match_type_scope_size > type_scope_size) {
151 const size_t type_scope_pos = match_type_scope.rfind(type_scope);
152 if (type_scope_pos == match_type_scope_size - type_scope_size) {
153 if (type_scope_pos >= 2) {
164 if (match_type_scope[type_scope_pos - 1] ==
':' &&
165 match_type_scope[type_scope_pos - 2] ==
':') {
176 keep_match = type_scope.empty() && type_basename == match_type_name;
181 matching_types.push_back(*pos);
188 if (type_class == eTypeClassAny)
199 for (pos =
m_types.begin(); pos != end; ++pos) {
200 Type *the_type = pos->get();
201 TypeClass match_type_class =
203 if (match_type_class & type_class)
204 matching_types.push_back(*pos);
lldb::TypeClass GetTypeClass() const
A uniqued constant string class.
A stream class that can stream formatted output to a file.
std::vector< lldb::TypeSP > collection
void ForEach(std::function< bool(const lldb::TypeSP &type_sp)> const &callback) const
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
collection::iterator iterator
void Dump(Stream *s, bool show_context)
void Insert(const lldb::TypeSP &type)
void RemoveMismatchedTypes(llvm::StringRef qualified_typename, bool exact_match)
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.