Skip to content

Refactor DeserializeAllCompilerFlags to only take a CompilerInvocatio… #3327

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
Oct 4, 2021
Merged
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
9 changes: 4 additions & 5 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1330,15 +1330,14 @@ void SwiftASTContext::DiagnoseWarnings(Process &process, Module &module) const {
/// Retrieve the serialized AST data blobs and initialize the compiler
/// invocation with the concatenated search paths from the blobs.
/// \returns true if an error was encountered.
static bool DeserializeAllCompilerFlags(SwiftASTContext &swift_ast,
static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
Module &module,
const std::string &m_description,
llvm::raw_ostream &error,
bool &got_serialized_options,
bool &found_swift_modules) {
bool found_validation_errors = false;
got_serialized_options = false;
auto &invocation = swift_ast.GetCompilerInvocation();
auto ast_file_datas = module.GetASTData(eLanguageTypeSwift);
LOG_PRINTF(LIBLLDB_LOG_TYPES, "Found %d AST file data entries.",
(int)ast_file_datas.size());
Expand Down Expand Up @@ -1739,9 +1738,9 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
bool got_serialized_options = false;
llvm::SmallString<0> error;
llvm::raw_svector_ostream errs(error);
if (DeserializeAllCompilerFlags(*swift_ast_sp, module, m_description, errs,
got_serialized_options,
found_swift_modules)) {
if (DeserializeAllCompilerFlags(
swift_ast_sp->GetCompilerInvocation(), module, m_description, errs,
got_serialized_options, found_swift_modules)) {
// Validation errors are not fatal for the context.
swift_ast_sp->m_module_import_warnings.push_back(std::string(error));
}
Expand Down