Skip to content

Commit 8cea8b5

Browse files
Merge pull request #3330 from adrian-prantl/logging
Simplify logging code in ProcessModule (NFC)
2 parents 1a49c87 + bed1dc9 commit 8cea8b5

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,13 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
19531953
std::vector<std::string> &module_search_paths,
19541954
std::vector<std::pair<std::string, bool>> &framework_search_paths,
19551955
std::vector<std::string> &extra_clang_args) {
1956+
{
1957+
llvm::raw_string_ostream ss(m_description);
1958+
ss << "ProcessModule(" << '"';
1959+
module_sp->GetDescription(ss, eDescriptionLevelBrief);
1960+
ss << '"' << ')';
1961+
}
1962+
19561963
const FileSpec &module_file = module_sp->GetFileSpec();
19571964
std::string module_path = module_file.GetPath();
19581965

@@ -1985,9 +1992,8 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
19851992

19861993
if (!add_it) {
19871994
LOG_PRINTF(LIBLLDB_LOG_TYPES,
1988-
"ProcessModule(\"%s\") rejecting framework path \"%s\" "
1989-
"as it has no \"Headers\" or \"Modules\" subdirectories.",
1990-
module_file.GetFilename().AsCString(""),
1995+
"rejecting framework path \"%s\" as it has no \"Headers\" "
1996+
"or \"Modules\" subdirectories.",
19911997
framework_path.c_str());
19921998
}
19931999

@@ -2005,9 +2011,7 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
20052011
// SDK instead.
20062012
if (!StringRef(parent_path).startswith("/System/Library") &&
20072013
!IsDeviceSupport(parent_path.c_str())) {
2008-
LOG_PRINTF(LIBLLDB_LOG_TYPES,
2009-
"ProcessModule(\"%s\") adding framework path \"%s\".",
2010-
module_file.GetFilename().AsCString(""),
2014+
LOG_PRINTF(LIBLLDB_LOG_TYPES, "adding framework path \"%s\".",
20112015
framework_path.c_str());
20122016
framework_search_paths.push_back(
20132017
{std::move(parent_path), /*system*/ false});
@@ -2071,9 +2075,8 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
20712075
framework_search_paths.push_back({fwsp.Path, fwsp.IsSystem});
20722076
for (const std::string &arg : ast_context->GetClangArguments()) {
20732077
extra_clang_args.push_back(arg);
2074-
LOG_VERBOSE_PRINTF(LIBLLDB_LOG_TYPES,
2075-
"ProcessModule(\"%s\") adding Clang argument \"%s\".",
2076-
module_file.GetFilename().AsCString(""), arg.c_str());
2078+
LOG_VERBOSE_PRINTF(LIBLLDB_LOG_TYPES, "adding Clang argument \"%s\".",
2079+
arg.c_str());
20772080
}
20782081
}
20792082
}

0 commit comments

Comments
 (0)