ClangASTImporter::NamespaceMapSP namespace_map =
m_ast_importer_sp->GetNamespaceMap(namespace_context);
- if (log && log->GetVerbose())
- LLDB_LOG(log, " CTD Inspecting namespace map{1} ({2} entries)",
- namespace_map.get(), namespace_map->size());
+ LLDB_LOGV(log, " CTD Inspecting namespace map{1} ({2} entries)",
+ namespace_map.get(), namespace_map->size());
if (!namespace_map)
return;
interface_decl->getSuperClass() != interface_decl)
CompleteType(interface_decl->getSuperClass());
- if (log) {
- LLDB_LOG(log, " [COID] After:");
- LLDB_LOG(log, " [COID] {0}", ClangUtil::DumpDecl(interface_decl));
- }
+ LLDB_LOG(log, " [COID] After:");
+ LLDB_LOG(log, " [COID] {0}", ClangUtil::DumpDecl(interface_decl));
}
clang::ObjCInterfaceDecl *ClangASTSource::GetCompleteObjCInterface(
if (!modules_decl_vendor->FindDecls(name, append, max_matches, decls))
return;
- if (log) {
- LLDB_LOG(log,
- " CAS::FEVD Matching entity found for \"{1}\" in "
- "the modules",
- name);
- }
+ LLDB_LOG(log, " CAS::FEVD Matching entity found for \"{1}\" in the modules",
+ name);
clang::NamedDecl *const decl_from_modules = decls[0];
if (!clang_decl_vendor->FindDecls(name, append, max_matches, decls))
return;
- if (log) {
- LLDB_LOG(log, " CAS::FEVD Matching type found for \"{0}\" in the runtime",
- name);
- }
+ LLDB_LOG(log, " CAS::FEVD Matching type found for \"{0}\" in the runtime",
+ name);
clang::Decl *copied_decl = CopyDecl(decls[0]);
clang::NamedDecl *copied_named_decl =
DeclFromParser<ObjCIvarDecl> parser_ivar_decl(
origin_ivar_decl.Import(source));
if (parser_ivar_decl.IsValid()) {
- if (log) {
- LLDB_LOG(log, " CAS::FOPD found\n{1}",
- ClangUtil::DumpDecl(parser_ivar_decl.decl));
- }
+ LLDB_LOG(log, " CAS::FOPD found\n{1}",
+ ClangUtil::DumpDecl(parser_ivar_decl.decl));
context.AddNamedDecl(parser_ivar_decl.decl);
found = true;
ClangASTImporter::NamespaceMapSP namespace_map =
m_ast_importer_sp->GetNamespaceMap(namespace_context);
- if (log && log->GetVerbose())
- LLDB_LOG(log, " CAS::FEVD Inspecting namespace map {1} ({2} entries)",
- namespace_map.get(), namespace_map->size());
+ LLDB_LOGV(log, " CAS::FEVD Inspecting namespace map {1} ({2} entries)",
+ namespace_map.get(), namespace_map->size());
if (!namespace_map)
return;
TypeFromUser user_type = DeportType(*context, *ast, parser_type);
if (!user_type.GetOpaqueQualType()) {
- LLDB_LOGF(log, "Persistent variable's type wasn't copied successfully");
+ LLDB_LOG(log, "Persistent variable's type wasn't copied successfully");
return false;
}
var->m_flags |= ClangExpressionVariable::EVKeepInTarget;
}
- LLDB_LOGF(log, "Created persistent variable with flags 0x%hx", var->m_flags);
+ LLDB_LOG(log, "Created persistent variable with flags {0:x}", var->m_flags);
var->EnableParserVars(GetParserID());
if (!var)
return false;
- LLDB_LOGF(log, "Adding value for (NamedDecl*)%p [%s - %s] to the structure",
- static_cast<const void *>(decl), name.GetCString(),
- var->GetName().GetCString());
+ LLDB_LOG(log, "Adding value for (NamedDecl*)%p [%s - %s] to the structure",
+ decl, name, var->GetName());
// We know entity->m_parser_vars is valid because we used a parser variable
// to find it
llvm::cast<ClangExpressionVariable>(var)->GetJITVars(GetParserID())) {
// We already laid this out; do not touch
- LLDB_LOGF(log, "Already placed at 0x%llx",
- (unsigned long long)jit_vars->m_offset);
+ LLDB_LOG(log, "Already placed at {0:x}", jit_vars->m_offset);
}
llvm::cast<ClangExpressionVariable>(var)->EnableJITVars(GetParserID());
if (!err.Success())
return false;
- LLDB_LOGF(log, "Placed at 0x%llx", (unsigned long long)offset);
+ LLDB_LOG(log, "Placed at {0:x}", offset);
jit_vars->m_offset =
offset; // TODO DoStructLayout() should not change this.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
if (GetImportInProgress()) {
- if (log && log->GetVerbose())
- LLDB_LOGF(log, "Ignoring a query during an import");
+ LLDB_LOGV(log, "Ignoring a query during an import");
return;
}
if (log) {
if (!context.m_decl_context)
- LLDB_LOGF(log,
- "ClangExpressionDeclMap::FindExternalVisibleDecls for "
- "'%s' in a NULL DeclContext",
- name.GetCString());
+ LLDB_LOG(log,
+ "ClangExpressionDeclMap::FindExternalVisibleDecls for "
+ "'{0}' in a NULL DeclContext",
+ name);
else if (const NamedDecl *context_named_decl =
dyn_cast<NamedDecl>(context.m_decl_context))
- LLDB_LOGF(log,
- "ClangExpressionDeclMap::FindExternalVisibleDecls for "
- "'%s' in '%s'",
- name.GetCString(),
- context_named_decl->getNameAsString().c_str());
+ LLDB_LOG(log,
+ "ClangExpressionDeclMap::FindExternalVisibleDecls for "
+ "'{0}' in '{1}'",
+ name, context_named_decl->getNameAsString());
else
- LLDB_LOGF(log,
- "ClangExpressionDeclMap::FindExternalVisibleDecls for "
- "'%s' in a '%s'",
- name.GetCString(), context.m_decl_context->getDeclKindName());
+ LLDB_LOG(log,
+ "ClangExpressionDeclMap::FindExternalVisibleDecls for "
+ "'{0}' in a '{1}'",
+ name, context.m_decl_context->getDeclKindName());
}
if (const NamespaceDecl *namespace_context =
if (!namespace_map)
return;
- if (log && log->GetVerbose())
- log->Printf(" CEDM::FEVD Inspecting (NamespaceMap*)%p (%d entries)",
- static_cast<void *>(namespace_map.get()),
- (int)namespace_map->size());
+ LLDB_LOGV(log, " CEDM::FEVD Inspecting (NamespaceMap*){0:x} ({1} entries)",
+ namespace_map.get(), namespace_map->size());
for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin(),
e = namespace_map->end();
i != e; ++i) {
- if (log)
- log->Printf(" CEDM::FEVD Searching namespace %s in module %s",
- i->second.GetName().AsCString(),
- i->first->GetFileSpec().GetFilename().GetCString());
+ LLDB_LOG(log, " CEDM::FEVD Searching namespace {0} in module {1}",
+ i->second.GetName(), i->first->GetFileSpec().GetFilename());
FindExternalVisibleDecls(context, i->first, i->second);
}
} else if (isa<TranslationUnitDecl>(context.m_decl_context)) {
CompilerDeclContext namespace_decl;
- if (log)
- log->Printf(" CEDM::FEVD Searching the root namespace");
+ LLDB_LOG(log, " CEDM::FEVD Searching the root namespace");
FindExternalVisibleDecls(context, lldb::ModuleSP(), namespace_decl);
}
reg_name));
if (reg_info) {
- LLDB_LOGF(log, " CEDM::FEVD Found register %s", reg_info->name);
+ LLDB_LOG(log, " CEDM::FEVD Found register {0}", reg_info->name);
AddOneRegister(context, reg_info);
}
Type *var_type = var->GetType();
if (!var_type) {
- if (log)
- log->PutCString("Skipped a definition because it has no type");
+ LLDB_LOG(log, "Skipped a definition because it has no type");
return false;
}
CompilerType var_clang_type = var_type->GetFullCompilerType();
if (!var_clang_type) {
- if (log)
- log->PutCString("Skipped a definition because it has no Clang type");
+ LLDB_LOG(log, "Skipped a definition because it has no Clang type");
return false;
}
var_type->GetForwardCompilerType().GetTypeSystem());
if (!clang_ast) {
- if (log)
- log->PutCString("Skipped a definition because it has no Clang AST");
+ LLDB_LOG(log, "Skipped a definition because it has no Clang AST");
return false;
}
const_value_extractor.GetByteSize());
var_location.SetValueType(Value::eValueTypeHostAddress);
} else {
- LLDB_LOGF(log, "Error evaluating constant variable: %s", err.AsCString());
+ LLDB_LOG(log, "Error evaluating constant variable: {0}", err.AsCString());
return false;
}
}
CompilerType type_to_use = GuardedCopyType(var_clang_type);
if (!type_to_use) {
- LLDB_LOGF(log,
- "Couldn't copy a variable's type into the parser's AST context");
+ LLDB_LOG(log,
+ "Couldn't copy a variable's type into the parser's AST context");
return false;
}
TypeFromParser parser_type(GuardedCopyType(user_type));
if (!parser_type.GetOpaqueQualType()) {
- LLDB_LOGF(log, " CEDM::FEVD Couldn't import type for pvar %s",
- pvar_sp->GetName().GetCString());
+ LLDB_LOG(log, " CEDM::FEVD Couldn't import type for pvar {0}",
+ pvar_sp->GetName());
return;
}
reg_info->encoding, reg_info->byte_size * 8);
if (!clang_type) {
- LLDB_LOGF(log, " Tried to add a type for %s, but couldn't get one",
- context.m_decl_name.getAsString().c_str());
+ LLDB_LOG(log, " Tried to add a type for {0}, but couldn't get one",
+ context.m_decl_name.getAsString());
return;
}
context.AddNamedDecl(copied_function_decl);
return;
} else {
- if (log) {
- LLDB_LOGF(log, " Failed to import the function decl for '%s'",
- src_function_decl->getName().str().c_str());
- }
+ LLDB_LOG(log, " Failed to import the function decl for '{0}'",
+ src_function_decl->getName());
}
}
}
}
if (!function_type) {
- if (log)
- log->PutCString(" Skipped a function because it has no type");
+ LLDB_LOG(log, " Skipped a function because it has no type");
return;
}
function_clang_type = function_type->GetFullCompilerType();
if (!function_clang_type) {
- if (log)
- log->PutCString(" Skipped a function because it has no Clang type");
+ LLDB_LOG(log, " Skipped a function because it has no Clang type");
return;
}
function_decl = context.AddFunDecl(copied_function_type, extern_c);
if (!function_decl) {
- if (log) {
- LLDB_LOGF(
- log,
- " Failed to create a function decl for '%s' {0x%8.8" PRIx64 "}",
- function_type->GetName().GetCString(), function_type->GetID());
- }
+ LLDB_LOG(log, " Failed to create a function decl for '{0}' ({1:x})",
+ function_type->GetName(), function_type->GetID());
return;
}
} else {
// We failed to copy the type we found
- if (log) {
- LLDB_LOGF(log,
- " Failed to import the function type '%s' {0x%8.8" PRIx64
- "} into the expression parser AST contenxt",
- function_type->GetName().GetCString(),
- function_type->GetID());
- }
+ LLDB_LOG(log,
+ " Failed to import the function type '{0}' ({1:x})"
+ " into the expression parser AST contenxt",
+ function_type->GetName(), function_type->GetID());
return;
}
function_decl = context.AddGenericFunDecl();
is_indirect_function = symbol->IsIndirect();
} else {
- if (log)
- log->PutCString(" AddOneFunction called with no function and no symbol");
+ LLDB_LOG(log, " AddOneFunction called with no function and no symbol");
return;
}
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
if (!copied_clang_type) {
- if (log)
- LLDB_LOGF(
- log,
- "ClangExpressionDeclMap::AddThisType - Couldn't import the type");
+ LLDB_LOG(log,
+ "ClangExpressionDeclMap::AddThisType - Couldn't import the type");
return;
}
if (!copied_clang_type) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- if (log)
- LLDB_LOGF(
- log, "ClangExpressionDeclMap::AddOneType - Couldn't import the type");
+ LLDB_LOG(log,
+ "ClangExpressionDeclMap::AddOneType - Couldn't import the type");
return;
}