Skip to content

[Cherry-pick into next] [lldb] Update swift::ASTContext API #8241

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
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3071,6 +3071,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(
Expand Down Expand Up @@ -3260,7 +3264,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")) {
Expand Down
3 changes: 3 additions & 0 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct TBDGenOptions;
class VarDecl;
class ModuleDecl;
class SourceFile;
class CASOptions;
struct PrintOptions;
class MemoryBufferSerializedModuleLoader;
namespace Demangle {
Expand Down Expand Up @@ -238,6 +239,8 @@ class SwiftASTContext : public TypeSystemSwift {

swift::symbolgraphgen::SymbolGraphOptions &GetSymbolGraphOptions();

swift::CASOptions &GetCASOptions();

swift::TypeCheckerOptions &GetTypeCheckerOptions();

swift::DiagnosticEngine &GetDiagnosticEngine();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "", {}, {});
Expand Down