11 #include "llvm/Support/FormattedStream.h"
12 #include "llvm/Support/raw_ostream.h"
22 TypeList::TypeList() : m_types() {}
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 pos->get()->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;
117 TypeClass type_class,
bool exact_match) {
126 for (pos =
m_types.begin(); pos != end; ++pos) {
127 Type *the_type = pos->get();
128 bool keep_match =
false;
129 TypeClass match_type_class = eTypeClassAny;
131 if (type_class != eTypeClassAny) {
133 if ((match_type_class & type_class) == 0)
138 if (match_type_name_const_str) {
139 const char *match_type_name = match_type_name_const_str.GetCString();
140 llvm::StringRef match_type_scope;
141 llvm::StringRef match_type_basename;
145 if (match_type_basename == type_basename) {
146 const size_t type_scope_size = type_scope.size();
147 const size_t match_type_scope_size = match_type_scope.size();
148 if (exact_match || (type_scope_size == match_type_scope_size)) {
149 keep_match = match_type_scope == type_scope;
151 if (match_type_scope_size > type_scope_size) {
152 const size_t type_scope_pos = match_type_scope.rfind(type_scope);
153 if (type_scope_pos == match_type_scope_size - type_scope_size) {
154 if (type_scope_pos >= 2) {
165 if (match_type_scope[type_scope_pos - 1] ==
':' &&
166 match_type_scope[type_scope_pos - 2] ==
':') {
177 keep_match = type_scope.empty() && type_basename == match_type_name;
182 matching_types.push_back(*pos);
189 if (type_class == eTypeClassAny)
200 for (pos =
m_types.begin(); pos != end; ++pos) {
201 Type *the_type = pos->get();
202 TypeClass match_type_class =
204 if (match_type_class & type_class)
205 matching_types.push_back(*pos);