Skip to content

Add provenance information to the collected import options in the typ #2756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2166,10 +2166,12 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
}

if (!add_it) {
LOG_PRINTF(LIBLLDB_LOG_TYPES,
"process_one_module rejecting framework path \"%s\" "
"as it has no Headers or Modules subdirectories.",
framework_path.c_str());
LOG_PRINTF(
LIBLLDB_LOG_TYPES,
"process_one_module(\"%s\") rejecting framework path \"%s\" "
"as it has no \"Headers\" or \"Modules\" subdirectories.",
module_file.GetFilename().AsCString(""),
framework_path.c_str());
}

if (add_it) {
Expand All @@ -2187,6 +2189,11 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
// SDK instead.
if (!StringRef(parent_path).startswith("/System/Library") &&
!IsDeviceSupport(parent_path.c_str()))
LOG_PRINTF(LIBLLDB_LOG_TYPES,
"process_one_module(\"%s\") adding framework path "
"\"%s\".",
module_file.GetFilename().AsCString(""),
framework_path.c_str());
framework_search_paths.push_back(
{std::move(parent_path), /*system*/ false});
}
Expand Down Expand Up @@ -2223,7 +2230,13 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
opts.ImportSearchPaths.end());
for (const auto &fwsp : opts.FrameworkSearchPaths)
framework_search_paths.push_back({fwsp.Path, fwsp.IsSystem});

if (lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_TARGET))
for (const std::string &arg : ast_context->GetClangArguments()) {
LOG_PRINTF(
LIBLLDB_LOG_TYPES,
"process_one_module(\"%s\") adding Clang argument \"%s\".",
module_file.GetFilename().AsCString(""), arg.c_str());
}
swift_ast_sp->AddExtraClangArgs(ast_context->GetClangArguments());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_system_framework(self):
neg = 0
with open(log, "r") as logfile:
for line in logfile:
if "process_one_module rejecting framework path" in line:
if ") rejecting framework path " in line:
pos += 1
elif "/System/Library/Frameworks" in line:
neg += 1
Expand Down