From b04bad4717dae1a199ea8337bb8252099fcd179b Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Fri, 9 Feb 2024 09:03:41 -0800 Subject: [PATCH] [lldb] Update swift::ASTContext API Update lldb to use updated swift::ASTContext API. --- lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp | 7 ++++++- lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h | 3 +++ .../Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index 5c6012539a96d..7be982024fa74 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -3104,6 +3104,10 @@ swift::symbolgraphgen::SymbolGraphOptions &SwiftASTContext::GetSymbolGraphOption return GetCompilerInvocation().getSymbolGraphOptions(); } +swift::CASOptions &SwiftASTContext::GetCASOptions() { + return GetCompilerInvocation().getCASOptions(); +} + swift::DiagnosticEngine &SwiftASTContext::GetDiagnosticEngine() { if (!m_diagnostic_engine_ap) { m_diagnostic_engine_ap.reset( @@ -3293,7 +3297,8 @@ swift::ASTContext *SwiftASTContext::GetASTContext() { m_ast_context_ap.reset(swift::ASTContext::get( GetLanguageOptions(), GetTypeCheckerOptions(), GetSILOptions(), GetSearchPathOptions(), GetClangImporterOptions(), - GetSymbolGraphOptions(), GetSourceManager(), GetDiagnosticEngine(), + GetSymbolGraphOptions(), GetCASOptions(), GetSourceManager(), + GetDiagnosticEngine(), /*OutputBackend=*/nullptr)); if (getenv("LLDB_SWIFT_DUMP_DIAGS")) { diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h index e48d240f5fc2b..bd094ffbf105a 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h @@ -45,6 +45,7 @@ struct TBDGenOptions; class VarDecl; class ModuleDecl; class SourceFile; +class CASOptions; struct PrintOptions; class MemoryBufferSerializedModuleLoader; namespace Demangle { @@ -238,6 +239,8 @@ class SwiftASTContext : public TypeSystemSwift { swift::symbolgraphgen::SymbolGraphOptions &GetSymbolGraphOptions(); + swift::CASOptions &GetCASOptions(); + swift::TypeCheckerOptions &GetTypeCheckerOptions(); swift::DiagnosticEngine &GetDiagnosticEngine(); diff --git a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp index 8cc2fe9b633d4..4557a41db08bb 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp @@ -71,6 +71,7 @@ class ClangNameImporter { m_compiler_invocation.getSearchPathOptions(), m_compiler_invocation.getClangImporterOptions(), m_compiler_invocation.getSymbolGraphOptions(), + m_compiler_invocation.getCASOptions(), m_source_manager, m_diagnostic_engine)); m_clang_importer = swift::ClangImporter::create(*m_ast_context, "", {}, {});