Skip to content

Commit bed1dc9

Browse files
committed
Simplify logging code in ProcessModule (NFC)
1 parent 4eb9dc6 commit bed1dc9

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
@@ -1954,6 +1954,13 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
19541954
std::vector<std::string> &module_search_paths,
19551955
std::vector<std::pair<std::string, bool>> &framework_search_paths,
19561956
std::vector<std::string> &extra_clang_args) {
1957+
{
1958+
llvm::raw_string_ostream ss(m_description);
1959+
ss << "ProcessModule(" << '"';
1960+
module_sp->GetDescription(ss, eDescriptionLevelBrief);
1961+
ss << '"' << ')';
1962+
}
1963+
19571964
const FileSpec &module_file = module_sp->GetFileSpec();
19581965
std::string module_path = module_file.GetPath();
19591966

@@ -1986,9 +1993,8 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
19861993

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

@@ -2006,9 +2012,7 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
20062012
// SDK instead.
20072013
if (!StringRef(parent_path).startswith("/System/Library") &&
20082014
!IsDeviceSupport(parent_path.c_str())) {
2009-
LOG_PRINTF(LIBLLDB_LOG_TYPES,
2010-
"ProcessModule(\"%s\") adding framework path \"%s\".",
2011-
module_file.GetFilename().AsCString(""),
2015+
LOG_PRINTF(LIBLLDB_LOG_TYPES, "adding framework path \"%s\".",
20122016
framework_path.c_str());
20132017
framework_search_paths.push_back(
20142018
{std::move(parent_path), /*system*/ false});
@@ -2072,9 +2076,8 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
20722076
framework_search_paths.push_back({fwsp.Path, fwsp.IsSystem});
20732077
for (const std::string &arg : ast_context->GetClangArguments()) {
20742078
extra_clang_args.push_back(arg);
2075-
LOG_VERBOSE_PRINTF(LIBLLDB_LOG_TYPES,
2076-
"ProcessModule(\"%s\") adding Clang argument \"%s\".",
2077-
module_file.GetFilename().AsCString(""), arg.c_str());
2079+
LOG_VERBOSE_PRINTF(LIBLLDB_LOG_TYPES, "adding Clang argument \"%s\".",
2080+
arg.c_str());
20782081
}
20792082
}
20802083
}

0 commit comments

Comments
 (0)