Skip to content

Commit 66583c7

Browse files
authored
Merge pull request #9895 from swiftlang/cherrypick-4482ff71fd90
[NFC] Add SerializationOptions to SwiftASTContext
2 parents 988fe55 + cde7f23 commit 66583c7

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "swift/IRGen/Linking.h"
5454
#include "swift/SIL/SILModule.h"
5555
#include "swift/Sema/IDETypeChecking.h"
56+
#include "swift/Serialization/SerializationOptions.h"
5657
#include "swift/Serialization/Validation.h"
5758
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
5859

@@ -3462,6 +3463,10 @@ swift::CASOptions &SwiftASTContext::GetCASOptions() {
34623463
return GetCompilerInvocation().getCASOptions();
34633464
}
34643465

3466+
swift::SerializationOptions &SwiftASTContext::GetSerializationOptions() {
3467+
return GetCompilerInvocation().getSerializationOptions();
3468+
}
3469+
34653470
swift::DiagnosticEngine &SwiftASTContext::GetDiagnosticEngine() {
34663471
if (!m_diagnostic_engine_ap) {
34673472
m_diagnostic_engine_ap.reset(
@@ -3653,9 +3658,8 @@ ThreadSafeASTContext SwiftASTContext::GetASTContext() {
36533658
m_ast_context_ap.reset(swift::ASTContext::get(
36543659
GetLanguageOptions(), GetTypeCheckerOptions(), GetSILOptions(),
36553660
GetSearchPathOptions(), GetClangImporterOptions(),
3656-
GetSymbolGraphOptions(), GetCASOptions(), GetSourceManager(),
3657-
GetDiagnosticEngine(),
3658-
/*OutputBackend=*/nullptr));
3661+
GetSymbolGraphOptions(), GetCASOptions(), GetSerializationOptions(),
3662+
GetSourceManager(), GetDiagnosticEngine(), /*OutputBackend=*/nullptr));
36593663

36603664
if (getenv("LLDB_SWIFT_DUMP_DIAGS")) {
36613665
// 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
@@ -26,6 +26,7 @@
2626
#include "swift/AST/Module.h"
2727
#include "swift/Demangling/ManglingFlavor.h"
2828
#include "swift/Parse/ParseVersion.h"
29+
#include "swift/Serialization/SerializationOptions.h"
2930
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
3031

3132
#include "llvm/ADT/SmallVector.h"
@@ -252,6 +253,8 @@ class SwiftASTContext : public TypeSystemSwift {
252253

253254
swift::SearchPathOptions &GetSearchPathOptions();
254255

256+
swift::SerializationOptions &GetSerializationOptions();
257+
255258
void InitializeSearchPathOptions(
256259
llvm::ArrayRef<std::pair<std::string, bool>> module_search_paths,
257260
llvm::ArrayRef<std::pair<std::string, bool>> framework_search_paths);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class ClangNameImporter {
8282
m_compiler_invocation.getClangImporterOptions(),
8383
m_compiler_invocation.getSymbolGraphOptions(),
8484
m_compiler_invocation.getCASOptions(),
85+
m_compiler_invocation.getSerializationOptions(),
8586
m_source_manager, m_diagnostic_engine));
8687
m_clang_importer = swift::ClangImporter::create(*m_ast_context, "", {}, {});
8788
}

0 commit comments

Comments
 (0)