Skip to content

Absorb TypeCheckerFlags into the Swift Frontend #240

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
merged 1 commit into from
Nov 12, 2019
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
1 change: 1 addition & 0 deletions lldb/include/lldb/Core/SwiftForward.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class TupleTypeElt;
class Type;
class TypeAliasType;
class TypeBase;
class TypeCheckerOptions;
class TypeDecl;
class TypeInfo;
class UnionElementDecl;
Expand Down
2 changes: 2 additions & 0 deletions lldb/include/lldb/Symbol/SwiftASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ class SwiftASTContext : public TypeSystem {

swift::LangOptions &GetLanguageOptions();

swift::TypeCheckerOptions &GetTypeCheckerOptions();

swift::DiagnosticEngine &GetDiagnosticEngine();

swift::SearchPathOptions &GetSearchPathOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1465,10 +1465,7 @@ unsigned SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager,

// Not persistent because we're building source files one at a time.
swift::TopLevelContext top_level_context;
swift::OptionSet<swift::TypeCheckingFlags> type_checking_options;

swift::performTypeChecking(parsed_expr->source_file, top_level_context,
type_checking_options);
swift::performTypeChecking(parsed_expr->source_file, top_level_context);

if (swift_ast_ctx->HasErrors()) {
DiagnoseSwiftASTContextError();
Expand Down
7 changes: 6 additions & 1 deletion lldb/source/Symbol/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,10 @@ swift::LangOptions &SwiftASTContext::GetLanguageOptions() {
return GetCompilerInvocation().getLangOptions();
}

swift::TypeCheckerOptions &SwiftASTContext::GetTypeCheckerOptions() {
return GetCompilerInvocation().getTypeCheckerOptions();
}

swift::DiagnosticEngine &SwiftASTContext::GetDiagnosticEngine() {
if (!m_diagnostic_engine_ap) {
m_diagnostic_engine_ap.reset(
Expand Down Expand Up @@ -3322,7 +3326,8 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
return m_ast_context_ap.get();

m_ast_context_ap.reset(
swift::ASTContext::get(GetLanguageOptions(), GetSearchPathOptions(),
swift::ASTContext::get(GetLanguageOptions(), GetTypeCheckerOptions(),
GetSearchPathOptions(),
GetSourceManager(), GetDiagnosticEngine()));
m_diagnostic_consumer_ap.reset(new StoringDiagnosticConsumer(*this));

Expand Down