Skip to content

Commit a344183

Browse files
committed
Refactor DeserializeAllCompilerFlags to only take a CompilerInvocation (NFC)
1 parent 4eb9dc6 commit a344183

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,15 +1330,14 @@ void SwiftASTContext::DiagnoseWarnings(Process &process, Module &module) const {
13301330
/// Retrieve the serialized AST data blobs and initialize the compiler
13311331
/// invocation with the concatenated search paths from the blobs.
13321332
/// \returns true if an error was encountered.
1333-
static bool DeserializeAllCompilerFlags(SwiftASTContext &swift_ast,
1333+
static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
13341334
Module &module,
13351335
const std::string &m_description,
13361336
llvm::raw_ostream &error,
13371337
bool &got_serialized_options,
13381338
bool &found_swift_modules) {
13391339
bool found_validation_errors = false;
13401340
got_serialized_options = false;
1341-
auto &invocation = swift_ast.GetCompilerInvocation();
13421341
auto ast_file_datas = module.GetASTData(eLanguageTypeSwift);
13431342
LOG_PRINTF(LIBLLDB_LOG_TYPES, "Found %d AST file data entries.",
13441343
(int)ast_file_datas.size());
@@ -1739,9 +1738,9 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
17391738
bool got_serialized_options = false;
17401739
llvm::SmallString<0> error;
17411740
llvm::raw_svector_ostream errs(error);
1742-
if (DeserializeAllCompilerFlags(*swift_ast_sp, module, m_description, errs,
1743-
got_serialized_options,
1744-
found_swift_modules)) {
1741+
if (DeserializeAllCompilerFlags(
1742+
swift_ast_sp->GetCompilerInvocation(), module, m_description, errs,
1743+
got_serialized_options, found_swift_modules)) {
17451744
// Validation errors are not fatal for the context.
17461745
swift_ast_sp->m_module_import_warnings.push_back(std::string(error));
17471746
}

0 commit comments

Comments
 (0)