Skip to content

Commit 4482ff7

Browse files
committed
[NFC] Add SerializationOptions to SwiftASTContext
1 parent 417d34b commit 4482ff7

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "swift/IRGen/Linking.h"
5151
#include "swift/SIL/SILModule.h"
5252
#include "swift/Sema/IDETypeChecking.h"
53+
#include "swift/Serialization/SerializationOptions.h"
5354
#include "swift/Serialization/Validation.h"
5455
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
5556

@@ -3345,6 +3346,10 @@ swift::CASOptions &SwiftASTContext::GetCASOptions() {
33453346
return GetCompilerInvocation().getCASOptions();
33463347
}
33473348

3349+
swift::SerializationOptions &SwiftASTContext::GetSerializationOptions() {
3350+
return GetCompilerInvocation().getSerializationOptions();
3351+
}
3352+
33483353
swift::DiagnosticEngine &SwiftASTContext::GetDiagnosticEngine() {
33493354
if (!m_diagnostic_engine_ap) {
33503355
m_diagnostic_engine_ap.reset(
@@ -3536,9 +3541,8 @@ ThreadSafeASTContext SwiftASTContext::GetASTContext() {
35363541
m_ast_context_ap.reset(swift::ASTContext::get(
35373542
GetLanguageOptions(), GetTypeCheckerOptions(), GetSILOptions(),
35383543
GetSearchPathOptions(), GetClangImporterOptions(),
3539-
GetSymbolGraphOptions(), GetCASOptions(), GetSourceManager(),
3540-
GetDiagnosticEngine(),
3541-
/*OutputBackend=*/nullptr));
3544+
GetSymbolGraphOptions(), GetCASOptions(), GetSerializationOptions(),
3545+
GetSourceManager(), GetDiagnosticEngine(), /*OutputBackend=*/nullptr));
35423546

35433547
if (getenv("LLDB_SWIFT_DUMP_DIAGS")) {
35443548
// NOTE: leaking a swift::PrintingDiagnosticConsumer() here, but

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "swift/AST/Import.h"
2626
#include "swift/AST/Module.h"
2727
#include "swift/Parse/ParseVersion.h"
28+
#include "swift/Serialization/SerializationOptions.h"
2829
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
2930

3031
#include "llvm/ADT/SmallVector.h"
@@ -249,6 +250,8 @@ class SwiftASTContext : public TypeSystemSwift {
249250

250251
swift::SearchPathOptions &GetSearchPathOptions();
251252

253+
swift::SerializationOptions &GetSerializationOptions();
254+
252255
void InitializeSearchPathOptions(
253256
llvm::ArrayRef<std::string> module_search_paths,
254257
llvm::ArrayRef<std::pair<std::string, bool>> framework_search_paths);

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ class ClangNameImporter {
6565
: m_source_manager(FileSystem::Instance().GetVirtualFileSystem()),
6666
m_diagnostic_engine(m_source_manager) {
6767
m_compiler_invocation.getLangOptions() = lang_opts;
68-
m_ast_context.reset(swift::ASTContext::get(
69-
m_compiler_invocation.getLangOptions(),
70-
m_compiler_invocation.getTypeCheckerOptions(),
71-
m_compiler_invocation.getSILOptions(),
72-
m_compiler_invocation.getSearchPathOptions(),
73-
m_compiler_invocation.getClangImporterOptions(),
74-
m_compiler_invocation.getSymbolGraphOptions(),
75-
m_compiler_invocation.getCASOptions(),
76-
m_source_manager, m_diagnostic_engine));
68+
m_ast_context.reset(
69+
swift::ASTContext::get(m_compiler_invocation.getLangOptions(),
70+
m_compiler_invocation.getTypeCheckerOptions(),
71+
m_compiler_invocation.getSILOptions(),
72+
m_compiler_invocation.getSearchPathOptions(),
73+
m_compiler_invocation.getClangImporterOptions(),
74+
m_compiler_invocation.getSymbolGraphOptions(),
75+
m_compiler_invocation.getCASOptions(),
76+
m_compiler_invocation.getSerializationOptions(),
77+
m_source_manager, m_diagnostic_engine));
7778

7879
m_clang_importer = swift::ClangImporter::create(*m_ast_context, "", {}, {});
7980
}

0 commit comments

Comments
 (0)