void ClangASTSource::CompleteType(TagDecl *tag_decl) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
-
if (log) {
LLDB_LOG(log,
- " CompleteTagDecl[{0}] on (ASTContext*){1} Completing "
+ " CompleteTagDecl on (ASTContext*){1} Completing "
"(TagDecl*){2} named {3}",
- current_id, m_clang_ast_context->getDisplayName(), tag_decl,
+ m_clang_ast_context->getDisplayName(), tag_decl,
tag_decl->getName());
- LLDB_LOG(log, " CTD[%u] Before:\n{0}", current_id,
- ClangUtil::DumpDecl(tag_decl));
+ LLDB_LOG(log, " CTD Before:\n{0}", ClangUtil::DumpDecl(tag_decl));
}
auto iter = m_active_lexical_decls.find(tag_decl);
// We couldn't complete the type. Maybe there's a definition somewhere
// else that can be completed.
- LLDB_LOG(log,
- " CTD[{0}] Type could not be completed in the module in "
- "which it was first found.",
- current_id);
+ LLDB_LOG(log, " CTD Type could not be completed in the module in "
+ "which it was first found.");
bool found = false;
m_ast_importer_sp->GetNamespaceMap(namespace_context);
if (log && log->GetVerbose())
- LLDB_LOG(log,
- " CTD[{0}] Inspecting namespace map{1} ({2} entries)",
- current_id, namespace_map.get(), namespace_map->size());
+ LLDB_LOG(log, " CTD Inspecting namespace map{1} ({2} entries)",
+ namespace_map.get(), namespace_map->size());
if (!namespace_map)
return;
for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin(),
e = namespace_map->end();
i != e && !found; ++i) {
- LLDB_LOG(log, " CTD[{0}] Searching namespace {1} in module {2}",
- current_id, i->second.GetName(),
- i->first->GetFileSpec().GetFilename());
+ LLDB_LOG(log, " CTD Searching namespace {1} in module {2}",
+ i->second.GetName(), i->first->GetFileSpec().GetFilename());
TypeList types;
m_active_lexical_decls.insert(context_decl);
ScopedLexicalDeclEraser eraser(m_active_lexical_decls, context_decl);
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
-
if (log) {
if (const NamedDecl *context_named_decl = dyn_cast<NamedDecl>(context_decl))
LLDB_LOG(log,
- "FindExternalLexicalDecls[{0}] on (ASTContext*){1} '{2}' in "
+ "FindExternalLexicalDecls on (ASTContext*){1} '{2}' in "
"'{3}' (%sDecl*){4}",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
+ m_ast_context, m_clang_ast_context->getDisplayName(),
context_named_decl->getNameAsString().c_str(),
context_decl->getDeclKindName(),
static_cast<const void *>(context_decl));
else if (context_decl)
LLDB_LOG(log,
- "FindExternalLexicalDecls[{0}] on (ASTContext*){1} '{2}' in "
+ "FindExternalLexicalDecls on (ASTContext*){1} '{2}' in "
"({3}Decl*){4}",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
+ m_ast_context, m_clang_ast_context->getDisplayName(),
context_decl->getDeclKindName(),
static_cast<const void *>(context_decl));
else
LLDB_LOG(log,
- "FindExternalLexicalDecls[{0}] on (ASTContext*){1} '{2}' in a "
+ "FindExternalLexicalDecls on (ASTContext*){1} '{2}' in a "
"NULL context",
- current_id, m_ast_context,
- m_clang_ast_context->getDisplayName());
+ m_ast_context, m_clang_ast_context->getDisplayName());
}
ClangASTImporter::DeclOrigin original = m_ast_importer_sp->GetDeclOrigin(context_decl);
if (!original.Valid())
return;
- LLDB_LOG(log, " FELD[{0}] Original decl {1} (Decl*){2:x}:\n{3}", current_id,
+ LLDB_LOG(log, " FELD Original decl {1} (Decl*){2:x}:\n{3}",
static_cast<void *>(original.ctx),
static_cast<void *>(original.decl),
ClangUtil::DumpDecl(original.decl));
std::string ast_dump = ClangUtil::DumpDecl(decl);
if (const NamedDecl *context_named_decl =
dyn_cast<NamedDecl>(context_decl))
- LLDB_LOG(
- log, " FELD[{0}] Adding [to {1}Decl {2}] lexical {3}Decl {4}",
- current_id, context_named_decl->getDeclKindName(),
- context_named_decl->getName(), decl->getDeclKindName(), ast_dump);
+ LLDB_LOG(log, " FELD Adding [to {1}Decl {2}] lexical {3}Decl {4}",
+ context_named_decl->getDeclKindName(),
+ context_named_decl->getName(), decl->getDeclKindName(),
+ ast_dump);
else
- LLDB_LOG(log, " FELD[{0}] Adding lexical {1}Decl {2}", current_id,
+ LLDB_LOG(log, " FELD Adding lexical {1}Decl {2}",
decl->getDeclKindName(), ast_dump);
}
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
-
if (log) {
if (!context.m_decl_context)
LLDB_LOG(log,
- "ClangASTSource::FindExternalVisibleDecls[{0}] on "
+ "ClangASTSource::FindExternalVisibleDecls on "
"(ASTContext*){1} '{2}' for '{3}' in a NULL DeclContext",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
- name);
+ m_ast_context, m_clang_ast_context->getDisplayName(), name);
else if (const NamedDecl *context_named_decl =
dyn_cast<NamedDecl>(context.m_decl_context))
LLDB_LOG(log,
- "ClangASTSource::FindExternalVisibleDecls[{0}] on "
+ "ClangASTSource::FindExternalVisibleDecls on "
"(ASTContext*){1} '{2}' for '{3}' in '{4}'",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
- name, context_named_decl->getName());
+ m_ast_context, m_clang_ast_context->getDisplayName(), name,
+ context_named_decl->getName());
else
LLDB_LOG(log,
- "ClangASTSource::FindExternalVisibleDecls[{0}] on "
+ "ClangASTSource::FindExternalVisibleDecls on "
"(ASTContext*){1} '{2}' for '{3}' in a '{4}'",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
- name, context.m_decl_context->getDeclKindName());
+ m_ast_context, m_clang_ast_context->getDisplayName(), name,
+ context.m_decl_context->getDeclKindName());
}
context.m_namespace_map = std::make_shared<ClangASTImporter::NamespaceMap>();
m_ast_importer_sp->GetNamespaceMap(namespace_context);
if (log && log->GetVerbose())
- LLDB_LOG(log,
- " CAS::FEVD[{0}] Inspecting namespace map {1} ({2} entries)",
- current_id, namespace_map.get(), namespace_map->size());
+ LLDB_LOG(log, " CAS::FEVD Inspecting namespace map {1} ({2} entries)",
+ namespace_map.get(), namespace_map->size());
if (!namespace_map)
return;
for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin(),
e = namespace_map->end();
i != e; ++i) {
- LLDB_LOG(log, " CAS::FEVD[{0}] Searching namespace {1} in module {2}",
- current_id, i->second.GetName(),
- i->first->GetFileSpec().GetFilename());
+ LLDB_LOG(log, " CAS::FEVD Searching namespace {1} in module {2}",
+ i->second.GetName(), i->first->GetFileSpec().GetFilename());
- FindExternalVisibleDecls(context, i->first, i->second, current_id);
+ FindExternalVisibleDecls(context, i->first, i->second);
}
} else if (isa<ObjCInterfaceDecl>(context.m_decl_context)) {
FindObjCPropertyAndIvarDecls(context);
} else {
CompilerDeclContext namespace_decl;
- LLDB_LOG(log, " CAS::FEVD[{0}] Searching the root namespace", current_id);
+ LLDB_LOG(log, " CAS::FEVD Searching the root namespace");
- FindExternalVisibleDecls(context, lldb::ModuleSP(), namespace_decl,
- current_id);
+ FindExternalVisibleDecls(context, lldb::ModuleSP(), namespace_decl);
}
if (!context.m_namespace_map->empty()) {
if (log && log->GetVerbose())
- LLDB_LOG(log,
- " CAS::FEVD[{0}] Registering namespace map {1} ({2} entries)",
- current_id, context.m_namespace_map.get(),
- context.m_namespace_map->size());
+ LLDB_LOG(log, " CAS::FEVD Registering namespace map {1} ({2} entries)",
+ context.m_namespace_map.get(), context.m_namespace_map->size());
NamespaceDecl *clang_namespace_decl =
AddNamespace(context, context.m_namespace_map);
void ClangASTSource::FindExternalVisibleDecls(
NameSearchContext &context, lldb::ModuleSP module_sp,
- CompilerDeclContext &namespace_decl, unsigned int current_id) {
+ CompilerDeclContext &namespace_decl) {
assert(m_ast_context);
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
std::pair<lldb::ModuleSP, CompilerDeclContext>(
module_sp, found_namespace_decl));
- LLDB_LOG(log, " CAS::FEVD[{0}] Found namespace {1} in module {2}",
- current_id, name, module_sp->GetFileSpec().GetFilename());
+ LLDB_LOG(log, " CAS::FEVD Found namespace {1} in module {2}", name,
+ module_sp->GetFileSpec().GetFilename());
}
}
} else {
std::pair<lldb::ModuleSP, CompilerDeclContext>(
image, found_namespace_decl));
- LLDB_LOG(log, " CAS::FEVD[{0}] Found namespace {1} in module {2}",
- current_id, name, image->GetFileSpec().GetFilename());
+ LLDB_LOG(log, " CAS::FEVD Found namespace {1} in module {2}", name,
+ image->GetFileSpec().GetFilename());
}
}
}
if (log) {
const char *name_string = type_sp->GetName().GetCString();
- LLDB_LOG(log, " CAS::FEVD[{0}] Matching type found for \"{1}\": {2}",
- current_id, name,
+ LLDB_LOG(log, " CAS::FEVD Matching type found for \"{1}\": {2}", name,
(name_string ? name_string : "<anonymous>"));
}
CompilerType copied_clang_type(GuardedCopyType(full_type));
if (!copied_clang_type) {
- LLDB_LOG(log, " CAS::FEVD[{0}] - Couldn't export a type",
- current_id);
+ LLDB_LOG(log, " CAS::FEVD - Couldn't export a type");
continue;
}
if (!context.m_found.type) {
// Try the modules next.
- FindDeclInModules(context, name, current_id);
+ FindDeclInModules(context, name);
}
if (!context.m_found.type) {
- FindDeclInObjCRuntime(context, name, current_id);
+ FindDeclInObjCRuntime(context, name);
}
}
}
bool ClangASTSource::FindObjCMethodDeclsWithOrigin(
- unsigned int current_id, NameSearchContext &context,
- ObjCInterfaceDecl *original_interface_decl, const char *log_info) {
+ NameSearchContext &context, ObjCInterfaceDecl *original_interface_decl,
+ const char *log_info) {
const DeclarationName &decl_name(context.m_decl_name);
clang::ASTContext *original_ctx = &original_interface_decl->getASTContext();
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- LLDB_LOG(log, " CAS::FOMD[{0}] found ({1}) {2}", current_id, log_info,
+ LLDB_LOG(log, " CAS::FOMD found ({1}) {2}", log_info,
ClangUtil::DumpDecl(copied_method_decl));
context.AddNamedDecl(copied_method_decl);
}
void ClangASTSource::FindDeclInModules(NameSearchContext &context,
- ConstString name, unsigned current_id) {
+ ConstString name) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
ClangModulesDeclVendor *modules_decl_vendor =
if (log) {
LLDB_LOG(log,
- " CAS::FEVD[{0}] Matching entity found for \"{1}\" in "
+ " CAS::FEVD Matching entity found for \"{1}\" in "
"the modules",
- current_id, name);
+ name);
}
clang::NamedDecl *const decl_from_modules = decls[0];
copied_decl ? dyn_cast<clang::NamedDecl>(copied_decl) : nullptr;
if (!copied_named_decl) {
- LLDB_LOG(log,
- " CAS::FEVD[{0}] - Couldn't export a type from the modules",
- current_id);
+ LLDB_LOG(log, " CAS::FEVD - Couldn't export a type from the modules");
return;
}
}
void ClangASTSource::FindDeclInObjCRuntime(NameSearchContext &context,
- ConstString name,
- unsigned current_id) {
+ ConstString name) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
lldb::ProcessSP process(m_target->GetProcessSP());
return;
if (log) {
- LLDB_LOG(log,
- " CAS::FEVD[{0}] Matching type found for \"{0}\" in the runtime",
- current_id, name);
+ LLDB_LOG(log, " CAS::FEVD Matching type found for \"{0}\" in the runtime",
+ name);
}
clang::Decl *copied_decl = CopyDecl(decls[0]);
copied_decl ? dyn_cast<clang::NamedDecl>(copied_decl) : nullptr;
if (!copied_named_decl) {
- LLDB_LOG(log, " CAS::FEVD[{0}] - Couldn't export a type from the runtime",
- current_id);
+ LLDB_LOG(log, " CAS::FEVD - Couldn't export a type from the runtime");
return;
}
void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
-
const DeclarationName &decl_name(context.m_decl_name);
const DeclContext *decl_ctx(context.m_decl_context);
ObjCInterfaceDecl *original_interface_decl =
dyn_cast<ObjCInterfaceDecl>(original.decl);
- if (FindObjCMethodDeclsWithOrigin(current_id, context,
- original_interface_decl, "at origin"))
+ if (FindObjCMethodDeclsWithOrigin(context, original_interface_decl,
+ "at origin"))
return; // found it, no need to look any further
} while (false);
ConstString selector_name(ss.GetString());
LLDB_LOG(log,
- "ClangASTSource::FindObjCMethodDecls[{0}] on (ASTContext*){1} '{2}' "
+ "ClangASTSource::FindObjCMethodDecls on (ASTContext*){1} '{2}' "
"for selector [{3} {4}]",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
+ m_ast_context, m_clang_ast_context->getDisplayName(),
interface_decl->getName(), selector_name);
SymbolContextList sc_list;
if (!copied_method_decl)
continue;
- LLDB_LOG(log, " CAS::FOMD[{0}] found (in symbols)\n{1}", current_id,
+ LLDB_LOG(log, " CAS::FOMD found (in symbols)\n{1}",
ClangUtil::DumpDecl(copied_method_decl));
context.AddNamedDecl(copied_method_decl);
break; // already checked this one
LLDB_LOG(log,
- "CAS::FOPD[{0}] trying origin "
+ "CAS::FOPD trying origin "
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
- current_id, complete_interface_decl,
- &complete_iface_decl->getASTContext());
+ complete_interface_decl, &complete_iface_decl->getASTContext());
- FindObjCMethodDeclsWithOrigin(current_id, context, complete_interface_decl,
+ FindObjCMethodDeclsWithOrigin(context, complete_interface_decl,
"in debug info");
return;
if (!interface_decl_from_modules)
break;
- if (FindObjCMethodDeclsWithOrigin(
- current_id, context, interface_decl_from_modules, "in modules"))
+ if (FindObjCMethodDeclsWithOrigin(context, interface_decl_from_modules,
+ "in modules"))
return;
}
} while (false);
if (!runtime_interface_decl)
break;
- FindObjCMethodDeclsWithOrigin(current_id, context, runtime_interface_decl,
+ FindObjCMethodDeclsWithOrigin(context, runtime_interface_decl,
"in runtime");
} while (false);
}
static bool FindObjCPropertyAndIvarDeclsWithOrigin(
- unsigned int current_id, NameSearchContext &context, ClangASTSource &source,
+ NameSearchContext &context, ClangASTSource &source,
DeclFromUser<const ObjCInterfaceDecl> &origin_iface_decl) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
DeclFromParser<ObjCPropertyDecl> parser_property_decl(
origin_property_decl.Import(source));
if (parser_property_decl.IsValid()) {
- LLDB_LOG(log, " CAS::FOPD[{0}] found\n{1}", current_id,
+ LLDB_LOG(log, " CAS::FOPD found\n{1}",
ClangUtil::DumpDecl(parser_property_decl.decl));
context.AddNamedDecl(parser_property_decl.decl);
origin_ivar_decl.Import(source));
if (parser_ivar_decl.IsValid()) {
if (log) {
- LLDB_LOG(log, " CAS::FOPD[{0}] found\n{1}", current_id,
+ LLDB_LOG(log, " CAS::FOPD found\n{1}",
ClangUtil::DumpDecl(parser_ivar_decl.decl));
}
void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
-
DeclFromParser<const ObjCInterfaceDecl> parser_iface_decl(
cast<ObjCInterfaceDecl>(context.m_decl_context));
DeclFromUser<const ObjCInterfaceDecl> origin_iface_decl(
ConstString class_name(parser_iface_decl->getNameAsString().c_str());
LLDB_LOG(log,
- "ClangASTSource::FindObjCPropertyAndIvarDecls[{0}] on "
+ "ClangASTSource::FindObjCPropertyAndIvarDecls on "
"(ASTContext*){1} '{2}' for '{3}.{4}'",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
+ m_ast_context, m_clang_ast_context->getDisplayName(),
parser_iface_decl->getName(), context.m_decl_name.getAsString());
- if (FindObjCPropertyAndIvarDeclsWithOrigin(
- current_id, context, *this, origin_iface_decl))
+ if (FindObjCPropertyAndIvarDeclsWithOrigin(context, *this, origin_iface_decl))
return;
LLDB_LOG(log,
- "CAS::FOPD[{0}] couldn't find the property on origin "
+ "CAS::FOPD couldn't find the property on origin "
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}, searching "
"elsewhere...",
- current_id, origin_iface_decl.decl,
- &origin_iface_decl->getASTContext());
+ origin_iface_decl.decl, &origin_iface_decl->getASTContext());
SymbolContext null_sc;
TypeList type_list;
break; // already checked this one
LLDB_LOG(log,
- "CAS::FOPD[{0}] trying origin "
+ "CAS::FOPD trying origin "
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
- current_id, complete_iface_decl.decl,
- &complete_iface_decl->getASTContext());
+ complete_iface_decl.decl, &complete_iface_decl->getASTContext());
- FindObjCPropertyAndIvarDeclsWithOrigin(current_id, context, *this,
- complete_iface_decl);
+ FindObjCPropertyAndIvarDeclsWithOrigin(context, *this, complete_iface_decl);
return;
} while (false);
LLDB_LOG(log,
"CAS::FOPD[{0}] trying module "
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
- current_id, interface_decl_from_modules.decl,
+ interface_decl_from_modules.decl,
&interface_decl_from_modules->getASTContext());
- if (FindObjCPropertyAndIvarDeclsWithOrigin(current_id, context, *this,
+ if (FindObjCPropertyAndIvarDeclsWithOrigin(context, *this,
interface_decl_from_modules))
return;
} while (false);
LLDB_LOG(log,
"CAS::FOPD[{0}] trying runtime "
"(ObjCInterfaceDecl*){1}/(ASTContext*){2}...",
- current_id, interface_decl_from_runtime.decl,
+ interface_decl_from_runtime.decl,
&interface_decl_from_runtime->getASTContext());
- if (FindObjCPropertyAndIvarDeclsWithOrigin(
- current_id, context, *this, interface_decl_from_runtime))
+ if (FindObjCPropertyAndIvarDeclsWithOrigin(context, *this,
+ interface_decl_from_runtime))
return;
} while (false);
}
FieldOffsetMap &field_offsets,
BaseOffsetMap &base_offsets,
BaseOffsetMap &virtual_base_offsets) {
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
LLDB_LOG(log,
- "LayoutRecordType[{0}] on (ASTContext*){1} '{2}' for (RecordDecl*)"
+ "LayoutRecordType on (ASTContext*){1} '{2}' for (RecordDecl*)"
"{3} [name = '{4}']",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
- record, record->getName());
+ m_ast_context, m_clang_ast_context->getDisplayName(), record,
+ record->getName());
DeclFromParser<const RecordDecl> parser_record(record);
DeclFromUser<const RecordDecl> origin_record(
m_ast_context->getCharWidth();
if (log) {
- LLDB_LOG(log, "LRT[{0}] returned:", current_id);
- LLDB_LOG(log, "LRT[{0}] Original = (RecordDecl*)%p", current_id,
+ LLDB_LOG(log, "LRT returned:");
+ LLDB_LOG(log, "LRT Original = (RecordDecl*)%p",
static_cast<const void *>(origin_record.decl));
- LLDB_LOG(log, "LRT[{0}] Size = %" PRId64, current_id, size);
- LLDB_LOG(log, "LRT[{0}] Alignment = %" PRId64, current_id, alignment);
- LLDB_LOG(log, "LRT[{0}] Fields:", current_id);
+ LLDB_LOG(log, "LRT Size = %" PRId64, size);
+ LLDB_LOG(log, "LRT Alignment = %" PRId64, alignment);
+ LLDB_LOG(log, "LRT Fields:");
for (RecordDecl::field_iterator fi = record->field_begin(),
fe = record->field_end();
fi != fe; ++fi) {
LLDB_LOG(log,
"LRT[{0}] (FieldDecl*){1}, Name = '{2}', Offset = {3} bits",
- current_id, *fi, fi->getName(), field_offsets[*fi]);
+ *fi, fi->getName(), field_offsets[*fi]);
}
DeclFromParser<const CXXRecordDecl> parser_cxx_record =
DynCast<const CXXRecordDecl>(parser_record);
if (parser_cxx_record.IsValid()) {
- LLDB_LOG(log, "LRT[{0}] Bases:", current_id);
+ LLDB_LOG(log, "LRT Bases:");
for (CXXRecordDecl::base_class_const_iterator
bi = parser_cxx_record->bases_begin(),
be = parser_cxx_record->bases_end();
DynCast<CXXRecordDecl>(base_record);
LLDB_LOG(log,
- "LRT[{0}] {1}(CXXRecordDecl*){2}, Name = '{3}', Offset = "
+ "LRT {1}(CXXRecordDecl*){2}, Name = '{3}', Offset = "
"{4} chars",
- current_id, (is_virtual ? "Virtual " : ""),
- base_cxx_record.decl, base_cxx_record.decl->getName(),
+ (is_virtual ? "Virtual " : ""), base_cxx_record.decl,
+ base_cxx_record.decl->getName(),
(is_virtual
? virtual_base_offsets[base_cxx_record.decl].getQuantity()
: base_offsets[base_cxx_record.decl].getQuantity()));
}
} else {
- LLDB_LOG(log, "LRD[{0}] Not a CXXRecord, so no bases", current_id);
+ LLDB_LOG(log, "LRD Not a CXXRecord, so no bases");
}
}
void ClangASTSource::CompleteNamespaceMap(
ClangASTImporter::NamespaceMapSP &namespace_map, ConstString name,
ClangASTImporter::NamespaceMapSP &parent_map) const {
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
if (log) {
if (parent_map && parent_map->size())
LLDB_LOG(log,
- "CompleteNamespaceMap[{0}] on (ASTContext*){1} '{2}' Searching "
+ "CompleteNamespaceMap on (ASTContext*){1} '{2}' Searching "
"for namespace {3} in namespace {4}",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
- name, parent_map->begin()->second.GetName());
+ m_ast_context, m_clang_ast_context->getDisplayName(), name,
+ parent_map->begin()->second.GetName());
else
LLDB_LOG(log,
- "CompleteNamespaceMap[{0}] on (ASTContext*){1} '{2}' Searching "
+ "CompleteNamespaceMap on (ASTContext*){1} '{2}' Searching "
"for namespace {3}",
- current_id, m_ast_context, m_clang_ast_context->getDisplayName(),
- name);
+ m_ast_context, m_clang_ast_context->getDisplayName(), name);
}
if (parent_map) {
namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(
module_sp, found_namespace_decl));
- LLDB_LOG(log, " CMN[{0}] Found namespace {1} in module {2}", current_id,
- name, module_sp->GetFileSpec().GetFilename());
+ LLDB_LOG(log, " CMN Found namespace {1} in module {2}", name,
+ module_sp->GetFileSpec().GetFilename());
}
} else {
const ModuleList &target_images = m_target->GetImages();
namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(
image, found_namespace_decl));
- LLDB_LOG(log, " CMN[{0}] Found namespace {1} in module {2}", current_id,
- name, image->GetFileSpec().GetFilename());
+ LLDB_LOG(log, " CMN[{0}] Found namespace {1} in module {2}", name,
+ image->GetFileSpec().GetFilename());
}
}
}
///
/// \param[in] namespace_decl
/// If valid and module is non-NULL, the parent namespace.
- ///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
void FindExternalVisibleDecls(NameSearchContext &context,
lldb::ModuleSP module,
- CompilerDeclContext &namespace_decl,
- unsigned int current_id);
+ CompilerDeclContext &namespace_decl);
/// Find all Objective-C methods matching a given selector.
///
protected:
bool FindObjCMethodDeclsWithOrigin(
- unsigned int current_id, NameSearchContext &context,
+ NameSearchContext &context,
clang::ObjCInterfaceDecl *original_interface_decl, const char *log_info);
- void FindDeclInModules(NameSearchContext &context, ConstString name,
- unsigned current_id);
- void FindDeclInObjCRuntime(NameSearchContext &context, ConstString name,
- unsigned current_id);
+ void FindDeclInModules(NameSearchContext &context, ConstString name);
+ void FindDeclInObjCRuntime(NameSearchContext &context, ConstString name);
friend struct NameSearchContext;
return;
}
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
-
if (log) {
if (!context.m_decl_context)
LLDB_LOGF(log,
- "ClangExpressionDeclMap::FindExternalVisibleDecls[%u] for "
+ "ClangExpressionDeclMap::FindExternalVisibleDecls for "
"'%s' in a NULL DeclContext",
- current_id, name.GetCString());
+ name.GetCString());
else if (const NamedDecl *context_named_decl =
dyn_cast<NamedDecl>(context.m_decl_context))
LLDB_LOGF(log,
- "ClangExpressionDeclMap::FindExternalVisibleDecls[%u] for "
+ "ClangExpressionDeclMap::FindExternalVisibleDecls for "
"'%s' in '%s'",
- current_id, name.GetCString(),
+ name.GetCString(),
context_named_decl->getNameAsString().c_str());
else
LLDB_LOGF(log,
- "ClangExpressionDeclMap::FindExternalVisibleDecls[%u] for "
+ "ClangExpressionDeclMap::FindExternalVisibleDecls for "
"'%s' in a '%s'",
- current_id, name.GetCString(),
- context.m_decl_context->getDeclKindName());
+ name.GetCString(), context.m_decl_context->getDeclKindName());
}
if (const NamespaceDecl *namespace_context =
CompilerDeclContext compiler_decl_ctx =
m_clang_ast_context->CreateDeclContext(
const_cast<clang::DeclContext *>(context.m_decl_context));
- FindExternalVisibleDecls(context, lldb::ModuleSP(), compiler_decl_ctx,
- current_id);
+ FindExternalVisibleDecls(context, lldb::ModuleSP(), compiler_decl_ctx);
return;
}
return;
if (log && log->GetVerbose())
- log->Printf(" CEDM::FEVD[%u] Inspecting (NamespaceMap*)%p (%d entries)",
- current_id, static_cast<void *>(namespace_map.get()),
+ log->Printf(" CEDM::FEVD Inspecting (NamespaceMap*)%p (%d entries)",
+ static_cast<void *>(namespace_map.get()),
(int)namespace_map->size());
for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin(),
e = namespace_map->end();
i != e; ++i) {
if (log)
- log->Printf(" CEDM::FEVD[%u] Searching namespace %s in module %s",
- current_id, i->second.GetName().AsCString(),
+ log->Printf(" CEDM::FEVD Searching namespace %s in module %s",
+ i->second.GetName().AsCString(),
i->first->GetFileSpec().GetFilename().GetCString());
- FindExternalVisibleDecls(context, i->first, i->second, current_id);
+ FindExternalVisibleDecls(context, i->first, i->second);
}
} else if (isa<TranslationUnitDecl>(context.m_decl_context)) {
CompilerDeclContext namespace_decl;
if (log)
- log->Printf(" CEDM::FEVD[%u] Searching the root namespace", current_id);
+ log->Printf(" CEDM::FEVD Searching the root namespace");
- FindExternalVisibleDecls(context, lldb::ModuleSP(), namespace_decl,
- current_id);
+ FindExternalVisibleDecls(context, lldb::ModuleSP(), namespace_decl);
}
ClangASTSource::FindExternalVisibleDecls(context);
}
void ClangExpressionDeclMap::SearchPersistenDecls(NameSearchContext &context,
- const ConstString name,
- unsigned int current_id) {
+ const ConstString name) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
NamedDecl *persistent_decl = GetPersistentDecl(name);
MaybeRegisterFunctionBody(parser_function_decl);
}
- LLDB_LOGF(log, " CEDM::FEVD[%u] Found persistent decl %s", current_id,
- name.GetCString());
+ LLDB_LOG(log, " CEDM::FEVD Found persistent decl %s", name);
context.AddNamedDecl(parser_named_decl);
}
-void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context,
- unsigned int current_id) {
+void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
StackFrame *frame = m_parser_vars->m_exe_ctx.GetFramePtr();
if (!ctx_obj_ptr || status.Fail())
return;
- AddThisType(context, TypeFromUser(m_ctx_obj->GetCompilerType()),
- current_id);
+ AddThisType(context, TypeFromUser(m_ctx_obj->GetCompilerType()));
m_struct_vars->m_object_pointer_type =
TypeFromUser(ctx_obj_ptr->GetCompilerType());
TypeFromUser class_user_type(class_qual_type.getAsOpaquePtr(),
function_decl_ctx.GetTypeSystem());
- LLDB_LOG(log, " CEDM::FEVD[{0}] Adding type for $__lldb_class: {1}",
- current_id, class_qual_type.getAsString());
+ LLDB_LOG(log, " CEDM::FEVD Adding type for $__lldb_class: {1}",
+ class_qual_type.getAsString());
- AddThisType(context, class_user_type, current_id);
+ AddThisType(context, class_user_type);
if (method_decl->isInstance()) {
// self is a pointer to the object
TypeFromUser pointee_type =
this_type->GetForwardCompilerType().GetPointeeType();
- LLDB_LOG(log, " FEVD[{0}] Adding type for $__lldb_class: {1}", current_id,
+ LLDB_LOG(log, " FEVD Adding type for $__lldb_class: {1}",
ClangUtil::GetQualType(pointee_type).getAsString());
- AddThisType(context, pointee_type, current_id);
+ AddThisType(context, pointee_type);
TypeFromUser this_user_type(this_type->GetFullCompilerType());
m_struct_vars->m_object_pointer_type = this_user_type;
}
}
-void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context,
- unsigned int current_id) {
+void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
StackFrame *frame = m_parser_vars->m_exe_ctx.GetFramePtr();
if (!ctx_obj_ptr || status.Fail())
return;
- AddOneType(context, TypeFromUser(m_ctx_obj->GetCompilerType()), current_id);
+ AddOneType(context, TypeFromUser(m_ctx_obj->GetCompilerType()));
m_struct_vars->m_object_pointer_type =
TypeFromUser(ctx_obj_ptr->GetCompilerType());
function_decl_ctx.GetTypeSystem());
LLDB_LOG(log, " FEVD[{0}] Adding type for $__lldb_objc_class: {1}",
- current_id, ClangUtil::ToString(interface_type));
+ ClangUtil::ToString(interface_type));
- AddOneType(context, class_user_type, current_id);
+ AddOneType(context, class_user_type);
if (method_decl->isInstanceMethod()) {
// self is a pointer to the object
return;
LLDB_LOG(log, " FEVD[{0}] Adding type for $__lldb_objc_class: {1}",
- current_id, ClangUtil::ToString(self_type->GetFullCompilerType()));
+ ClangUtil::ToString(self_type->GetFullCompilerType()));
TypeFromUser class_user_type(self_clang_type);
- AddOneType(context, class_user_type, current_id);
+ AddOneType(context, class_user_type);
TypeFromUser self_user_type(self_type->GetFullCompilerType());
}
void ClangExpressionDeclMap::LookupInModulesDeclVendor(
- NameSearchContext &context, ConstString name, unsigned current_id) {
+ NameSearchContext &context, ConstString name) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
if (!m_target)
clang::NamedDecl *const decl_from_modules = decls[0];
LLDB_LOG(log,
- " CAS::FEVD[{0}] Matching decl found for "
+ " CAS::FEVD Matching decl found for "
"\"{1}\" in the modules",
- current_id, name);
+ name);
clang::Decl *copied_decl = CopyDecl(decl_from_modules);
if (!copied_decl) {
- LLDB_LOG(log,
- " CAS::FEVD[{0}] - Couldn't export a "
- "declaration from the modules",
- current_id);
+ LLDB_LOG(log, " CAS::FEVD - Couldn't export a "
+ "declaration from the modules");
return;
}
}
bool ClangExpressionDeclMap::LookupLocalVariable(
- NameSearchContext &context, ConstString name, unsigned current_id,
- SymbolContext &sym_ctx, const CompilerDeclContext &namespace_decl) {
+ NameSearchContext &context, ConstString name, SymbolContext &sym_ctx,
+ const CompilerDeclContext &namespace_decl) {
if (sym_ctx.block == nullptr)
return false;
if (var && !variable_found) {
variable_found = true;
ValueObjectSP valobj = ValueObjectVariable::Create(frame, var);
- AddOneVariable(context, var, valobj, current_id);
+ AddOneVariable(context, var, valobj);
context.m_found.variable = true;
}
}
void ClangExpressionDeclMap::LookupFunction(
NameSearchContext &context, lldb::ModuleSP module_sp, ConstString name,
- const CompilerDeclContext &namespace_decl, unsigned current_id) {
+ const CompilerDeclContext &namespace_decl) {
if (!m_parser_vars)
return;
if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
continue;
- AddOneFunction(context, sym_ctx.function, nullptr, current_id);
+ AddOneFunction(context, sym_ctx.function, nullptr);
context.m_found.function_with_type_info = true;
context.m_found.function = true;
} else if (sym_ctx.symbol) {
if (!context.m_found.function_with_type_info) {
if (extern_symbol) {
- AddOneFunction(context, nullptr, extern_symbol, current_id);
+ AddOneFunction(context, nullptr, extern_symbol);
context.m_found.function = true;
} else if (non_extern_symbol) {
- AddOneFunction(context, nullptr, non_extern_symbol, current_id);
+ AddOneFunction(context, nullptr, non_extern_symbol);
context.m_found.function = true;
}
}
void ClangExpressionDeclMap::FindExternalVisibleDecls(
NameSearchContext &context, lldb::ModuleSP module_sp,
- const CompilerDeclContext &namespace_decl, unsigned int current_id) {
+ const CompilerDeclContext &namespace_decl) {
assert(m_ast_context);
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
// Try the persistent decls, which take precedence over all else.
if (!namespace_decl)
- SearchPersistenDecls(context, name, current_id);
+ SearchPersistenDecls(context, name);
if (name.GetStringRef().startswith("$") && !namespace_decl) {
if (name == "$__lldb_class") {
- LookUpLldbClass(context, current_id);
+ LookUpLldbClass(context);
return;
}
if (name == "$__lldb_objc_class") {
- LookUpLldbObjCClass(context, current_id);
+ LookUpLldbObjCClass(context);
return;
}
if (name == g_lldb_local_vars_namespace_cstr) {
m_parser_vars->m_persistent_vars->GetVariable(name));
if (pvar_sp) {
- AddOneVariable(context, pvar_sp, current_id);
+ AddOneVariable(context, pvar_sp);
return;
}
reg_name));
if (reg_info) {
- LLDB_LOGF(log, " CEDM::FEVD[%u] Found register %s", current_id,
- reg_info->name);
+ LLDB_LOGF(log, " CEDM::FEVD Found register %s", reg_info->name);
- AddOneRegister(context, reg_info, current_id);
+ AddOneRegister(context, reg_info);
}
}
return;
bool local_var_lookup = !namespace_decl || (namespace_decl.GetName() ==
g_lldb_local_vars_namespace_cstr);
if (frame && local_var_lookup)
- if (LookupLocalVariable(context, name, current_id, sym_ctx, namespace_decl))
+ if (LookupLocalVariable(context, name, sym_ctx, namespace_decl))
return;
if (target) {
if (var) {
valobj = ValueObjectVariable::Create(target, var);
- AddOneVariable(context, var, valobj, current_id);
+ AddOneVariable(context, var, valobj);
context.m_found.variable = true;
return;
}
}
- LookupFunction(context, module_sp, name, namespace_decl, current_id);
+ LookupFunction(context, module_sp, name, namespace_decl);
// Try the modules next.
if (!context.m_found.function_with_type_info)
- LookupInModulesDeclVendor(context, name, current_id);
+ LookupInModulesDeclVendor(context, name);
if (target && !context.m_found.variable && !namespace_decl) {
// We couldn't find a non-symbol variable for this. Now we'll hunt for a
m_ast_context->getDiagnostics().getCustomDiagID(
clang::DiagnosticsEngine::Level::Warning, "%0");
m_ast_context->getDiagnostics().Report(diag_id) << warning.c_str();
- AddOneGenericVariable(context, *data_symbol, current_id);
+ AddOneGenericVariable(context, *data_symbol);
context.m_found.variable = true;
}
}
void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
VariableSP var,
- ValueObjectSP valobj,
- unsigned int current_id) {
+ ValueObjectSP valobj) {
assert(m_parser_vars.get());
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
if (is_reference)
entity->m_flags |= ClangExpressionVariable::EVTypeIsReference;
- LLDB_LOG(log,
- " CEDM::FEVD[{0}] Found variable {1}, returned\n{2} (original {3})",
- current_id, decl_name, ClangUtil::DumpDecl(var_decl),
- ClangUtil::ToString(ut));
+ LLDB_LOG(log, " CEDM::FEVD Found variable {1}, returned\n{2} (original {3})",
+ decl_name, ClangUtil::DumpDecl(var_decl), ClangUtil::ToString(ut));
}
void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
- ExpressionVariableSP &pvar_sp,
- unsigned int current_id) {
+ ExpressionVariableSP &pvar_sp) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
TypeFromUser user_type(
TypeFromParser parser_type(GuardedCopyType(user_type));
if (!parser_type.GetOpaqueQualType()) {
- LLDB_LOGF(log, " CEDM::FEVD[%u] Couldn't import type for pvar %s",
- current_id, pvar_sp->GetName().GetCString());
+ LLDB_LOGF(log, " CEDM::FEVD Couldn't import type for pvar %s",
+ pvar_sp->GetName().GetCString());
return;
}
parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_value.Clear();
- LLDB_LOG(log, " CEDM::FEVD[{0}] Added pvar {1}, returned\n{2}", current_id,
+ LLDB_LOG(log, " CEDM::FEVD Added pvar {1}, returned\n{2}",
pvar_sp->GetName(), ClangUtil::DumpDecl(var_decl));
}
void ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context,
- const Symbol &symbol,
- unsigned int current_id) {
+ const Symbol &symbol) {
assert(m_parser_vars.get());
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_sym = &symbol;
- LLDB_LOG(log, " CEDM::FEVD[{0}] Found variable {1}, returned\n{2}",
- current_id, decl_name, ClangUtil::DumpDecl(var_decl));
+ LLDB_LOG(log, " CEDM::FEVD Found variable {1}, returned\n{2}", decl_name,
+ ClangUtil::DumpDecl(var_decl));
}
void ClangExpressionDeclMap::AddOneRegister(NameSearchContext &context,
- const RegisterInfo *reg_info,
- unsigned int current_id) {
+ const RegisterInfo *reg_info) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
CompilerType clang_type =
parser_vars->m_lldb_value.Clear();
entity->m_flags |= ClangExpressionVariable::EVBareRegister;
- LLDB_LOG(log, " CEDM::FEVD[{0}] Added register {1}, returned\n{2}",
- current_id, context.m_decl_name.getAsString(),
- ClangUtil::DumpDecl(var_decl));
+ LLDB_LOG(log, " CEDM::FEVD Added register {1}, returned\n{2}",
+ context.m_decl_name.getAsString(), ClangUtil::DumpDecl(var_decl));
}
void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
- Function *function, Symbol *symbol,
- unsigned int current_id) {
+ Function *function,
+ Symbol *symbol) {
assert(m_parser_vars.get());
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
function->DumpSymbolContext(&ss);
LLDB_LOG(log,
- " CEDM::FEVD[{0}] Imported decl for function template"
+ " CEDM::FEVD Imported decl for function template"
" {1} (description {2}), returned\n{3}",
- current_id, copied_function_template->getNameAsString(),
+ copied_function_template->getNameAsString(),
ss.GetData(),
ClangUtil::DumpDecl(copied_function_template));
}
function->DumpSymbolContext(&ss);
LLDB_LOG(log,
- " CEDM::FEVD[{0}]] Imported decl for function {1} "
+ " CEDM::FEVD Imported decl for function {1} "
"(description {2}), returned\n{3}",
- current_id, copied_function_decl->getNameAsString(),
- ss.GetData(), ClangUtil::DumpDecl(copied_function_decl));
+ copied_function_decl->getNameAsString(), ss.GetData(),
+ ClangUtil::DumpDecl(copied_function_decl));
}
context.AddNamedDecl(copied_function_decl);
Address::DumpStyleResolvedDescription);
LLDB_LOG(log,
- " CEDM::FEVD[{0}] Found {1} function {2} (description {3}), "
+ " CEDM::FEVD Found {1} function {2} (description {3}), "
"returned\n{4}",
- current_id, (function ? "specific" : "generic"), decl_name,
- ss.GetData(), ClangUtil::DumpDecl(function_decl));
+ (function ? "specific" : "generic"), decl_name, ss.GetData(),
+ ClangUtil::DumpDecl(function_decl));
}
}
void ClangExpressionDeclMap::AddThisType(NameSearchContext &context,
- const TypeFromUser &ut,
- unsigned int current_id) {
+ const TypeFromUser &ut) {
CompilerType copied_clang_type = GuardedCopyType(ut);
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
}
void ClangExpressionDeclMap::AddOneType(NameSearchContext &context,
- const TypeFromUser &ut,
- unsigned int current_id) {
+ const TypeFromUser &ut) {
CompilerType copied_clang_type = GuardedCopyType(ut);
if (!copied_clang_type) {
///
/// \param[in] namespace_decl
/// If valid and module is non-NULL, the parent namespace.
- ///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
void FindExternalVisibleDecls(NameSearchContext &context,
lldb::ModuleSP module,
- const CompilerDeclContext &namespace_decl,
- unsigned int current_id);
+ const CompilerDeclContext &namespace_decl);
protected:
/// Retrieves the declaration with the given name from the storage of
///
/// \param[in] name
/// The name of the entities that need to be found.
- ///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
- void SearchPersistenDecls(NameSearchContext &context, const ConstString name,
- unsigned int current_id);
+ void SearchPersistenDecls(NameSearchContext &context, const ConstString name);
/// Handles looking up $__lldb_class which requires special treatment.
///
/// \param[in] context
/// The NameSearchContext that can construct Decls for this name.
- ///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
- void LookUpLldbClass(NameSearchContext &context, unsigned int current_id);
+ void LookUpLldbClass(NameSearchContext &context);
/// Handles looking up $__lldb_objc_class which requires special treatment.
///
/// \param[in] context
/// The NameSearchContext that can construct Decls for this name.
- ///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
- void LookUpLldbObjCClass(NameSearchContext &context, unsigned int current_id);
+ void LookUpLldbObjCClass(NameSearchContext &context);
/// Handles looking up the synthetic namespace that contains our local
/// variables for the current frame.
///
/// \param[in] name
/// The name of the entities that need to be found.
- ///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
- void LookupInModulesDeclVendor(NameSearchContext &context, ConstString name,
- unsigned current_id);
+ void LookupInModulesDeclVendor(NameSearchContext &context, ConstString name);
/// Looks up a local variable.
///
/// \param[in] name
/// The name of the entities that need to be found.
///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
- ///
/// \param[in] sym_ctx
/// The current SymbolContext of this frame.
///
/// \return
/// True iff a local variable was found.
bool LookupLocalVariable(NameSearchContext &context, ConstString name,
- unsigned current_id, SymbolContext &sym_ctx,
+ SymbolContext &sym_ctx,
const CompilerDeclContext &namespace_decl);
/// Searches for functions in the given SymbolContextList.
///
/// \param[in] namespace_decl
/// If valid and module is non-NULL, the parent namespace.
- ///
- /// \param[in] current_id
- /// The ID for the current FindExternalVisibleDecls invocation,
- /// for logging purposes.
void LookupFunction(NameSearchContext &context, lldb::ModuleSP module_sp,
ConstString name,
- const CompilerDeclContext &namespace_decl,
- unsigned current_id);
+ const CompilerDeclContext &namespace_decl);
/// Given a target, find a variable that matches the given name and type.
///
/// \param[in] valobj
/// The LLDB ValueObject for that variable.
void AddOneVariable(NameSearchContext &context, lldb::VariableSP var,
- lldb::ValueObjectSP valobj, unsigned int current_id);
+ lldb::ValueObjectSP valobj);
/// Use the NameSearchContext to generate a Decl for the given persistent
/// variable, and put it in the list of found entities.
///
/// \param[in] pvar_sp
/// The persistent variable that needs a Decl.
- ///
- /// \param[in] current_id
- /// The ID of the current invocation of FindExternalVisibleDecls
- /// for logging purposes.
void AddOneVariable(NameSearchContext &context,
- lldb::ExpressionVariableSP &pvar_sp,
- unsigned int current_id);
+ lldb::ExpressionVariableSP &pvar_sp);
/// Use the NameSearchContext to generate a Decl for the given LLDB symbol
/// (treated as a variable), and put it in the list of found entities.
- void AddOneGenericVariable(NameSearchContext &context, const Symbol &symbol,
- unsigned int current_id);
+ void AddOneGenericVariable(NameSearchContext &context, const Symbol &symbol);
/// Use the NameSearchContext to generate a Decl for the given function.
/// (Functions are not placed in the Tuple list.) Can handle both fully
/// \param[in] sym
/// The Symbol that corresponds to a function that needs to be
/// created with generic type (unitptr_t foo(...)).
- void AddOneFunction(NameSearchContext &context, Function *fun, Symbol *sym,
- unsigned int current_id);
+ void AddOneFunction(NameSearchContext &context, Function *fun, Symbol *sym);
/// Use the NameSearchContext to generate a Decl for the given register.
///
///
/// \param[in] reg_info
/// The information corresponding to that register.
- void AddOneRegister(NameSearchContext &context, const RegisterInfo *reg_info,
- unsigned int current_id);
+ void AddOneRegister(NameSearchContext &context, const RegisterInfo *reg_info);
/// Use the NameSearchContext to generate a Decl for the given type. (Types
/// are not placed in the Tuple list.)
///
/// \param[in] type
/// The type that needs to be created.
- void AddOneType(NameSearchContext &context, const TypeFromUser &type,
- unsigned int current_id);
+ void AddOneType(NameSearchContext &context, const TypeFromUser &type);
/// Generate a Decl for "*this" and add a member function declaration to it
/// for the expression, then report it.
///
/// \param[in] type
/// The type for *this.
- void AddThisType(NameSearchContext &context, const TypeFromUser &type,
- unsigned int current_id);
+ void AddThisType(NameSearchContext &context, const TypeFromUser &type);
/// Move a type out of the current ASTContext into another, but make sure to
/// export all components of the type also.
bool FindExternalVisibleDeclsByName(const clang::DeclContext *decl_ctx,
clang::DeclarationName name) override {
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
Log *log(GetLogIfAllCategoriesSet(
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
if (log) {
LLDB_LOGF(log,
- "AppleObjCExternalASTSource::FindExternalVisibleDeclsByName[%"
- "u] on (ASTContext*)%p Looking for %s in (%sDecl*)%p",
- current_id,
+ "AppleObjCExternalASTSource::FindExternalVisibleDeclsByName"
+ " on (ASTContext*)%p Looking for %s in (%sDecl*)%p",
static_cast<void *>(&decl_ctx->getParentASTContext()),
name.getAsString().c_str(), decl_ctx->getDeclKindName(),
static_cast<const void *>(decl_ctx));
}
void CompleteType(clang::TagDecl *tag_decl) override {
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
Log *log(GetLogIfAllCategoriesSet(
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
LLDB_LOGF(log,
- "AppleObjCExternalASTSource::CompleteType[%u] on "
+ "AppleObjCExternalASTSource::CompleteType on "
"(ASTContext*)%p Completing (TagDecl*)%p named %s",
- current_id, static_cast<void *>(&tag_decl->getASTContext()),
+ static_cast<void *>(&tag_decl->getASTContext()),
static_cast<void *>(tag_decl), tag_decl->getName().str().c_str());
- LLDB_LOG(log, " AOEAS::CT[{0}] Before:\n{1}", current_id,
- ClangUtil::DumpDecl(tag_decl));
+ LLDB_LOG(log, " AOEAS::CT Before:\n{1}", ClangUtil::DumpDecl(tag_decl));
- LLDB_LOG(log, " AOEAS::CT[{1}] After:{1}", current_id,
- ClangUtil::DumpDecl(tag_decl));
+ LLDB_LOG(log, " AOEAS::CT After:{1}", ClangUtil::DumpDecl(tag_decl));
return;
}
void CompleteType(clang::ObjCInterfaceDecl *interface_decl) override {
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
Log *log(GetLogIfAllCategoriesSet(
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
if (log) {
LLDB_LOGF(log,
- "AppleObjCExternalASTSource::CompleteType[%u] on "
+ "AppleObjCExternalASTSource::CompleteType on "
"(ASTContext*)%p Completing (ObjCInterfaceDecl*)%p named %s",
- current_id,
static_cast<void *>(&interface_decl->getASTContext()),
static_cast<void *>(interface_decl),
interface_decl->getName().str().c_str());
- LLDB_LOGF(log, " AOEAS::CT[%u] Before:", current_id);
+ LLDB_LOGF(log, " AOEAS::CT Before:");
LLDB_LOG(log, " [CT] {0}", ClangUtil::DumpDecl(interface_decl));
}
uint32_t AppleObjCDeclVendor::FindDecls(ConstString name, bool append,
uint32_t max_matches,
std::vector<CompilerDecl> &decls) {
- static unsigned int invocation_id = 0;
- unsigned int current_id = invocation_id++;
Log *log(GetLogIfAllCategoriesSet(
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
- LLDB_LOGF(log, "AppleObjCDeclVendor::FindDecls [%u] ('%s', %s, %u, )",
- current_id, (const char *)name.AsCString(),
- append ? "true" : "false", max_matches);
+ LLDB_LOGF(log, "AppleObjCDeclVendor::FindDecls ('%s', %s, %u, )",
+ (const char *)name.AsCString(), append ? "true" : "false",
+ max_matches);
if (!append)
decls.clear();
isa_value = metadata->GetISAPtr();
LLDB_LOG(log,
- "AOCTV::FT [%u] Found %s (isa 0x%" PRIx64
- ") in the ASTContext",
- current_id, result_iface_type.getAsString(), isa_value);
+ "AOCTV::FT Found %s (isa 0x%" PRIx64 ") in the ASTContext",
+ result_iface_type.getAsString(), isa_value);
}
decls.push_back(m_ast_ctx.GetCompilerDecl(result_iface_decl));
ret++;
break;
} else {
- LLDB_LOGF(log,
- "AOCTV::FT [%u] There's something in the ASTContext, but "
- "it's not something we know about",
- current_id);
+ LLDB_LOGF(log, "AOCTV::FT There's something in the ASTContext, but "
+ "it's not something we know about");
break;
}
} else if (log) {
- LLDB_LOGF(log, "AOCTV::FT [%u] Couldn't find %s in the ASTContext",
- current_id, name.AsCString());
+ LLDB_LOGF(log, "AOCTV::FT Couldn't find %s in the ASTContext",
+ name.AsCString());
}
// It's not. If it exists, we have to put it into our ASTContext.
ObjCLanguageRuntime::ObjCISA isa = m_runtime.GetISA(name);
if (!isa) {
- LLDB_LOGF(log, "AOCTV::FT [%u] Couldn't find the isa", current_id);
+ LLDB_LOGF(log, "AOCTV::FT Couldn't find the isa");
break;
}
if (!iface_decl) {
LLDB_LOGF(log,
- "AOCTV::FT [%u] Couldn't get the Objective-C interface for "
+ "AOCTV::FT Couldn't get the Objective-C interface for "
"isa 0x%" PRIx64,
- current_id, (uint64_t)isa);
+ (uint64_t)isa);
break;
}
if (log) {
clang::QualType new_iface_type = ast_ctx.getObjCInterfaceType(iface_decl);
- LLDB_LOG(log, "AOCTV::FT [{0}] Created {1} (isa 0x{2:x})", current_id,
+ LLDB_LOG(log, "AOCTV::FT Created {1} (isa 0x{2:x})",
new_iface_type.getAsString(), (uint64_t)isa);
}