Skip to content

Commit 54c0d11

Browse files
committed
Absorb TypeCheckerFlags into the Swift Frontend
Supports swiftlang/swift#28173
1 parent 674f314 commit 54c0d11

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

lldb/include/lldb/Core/SwiftForward.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class TupleTypeElt;
6464
class Type;
6565
class TypeAliasType;
6666
class TypeBase;
67+
class TypeCheckerOptions;
6768
class TypeDecl;
6869
class TypeInfo;
6970
class UnionElementDecl;

lldb/include/lldb/Symbol/SwiftASTContext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ class SwiftASTContext : public TypeSystem {
162162

163163
swift::LangOptions &GetLanguageOptions();
164164

165+
swift::TypeCheckerOptions &GetTypeCheckerOptions();
166+
165167
swift::DiagnosticEngine &GetDiagnosticEngine();
166168

167169
swift::SearchPathOptions &GetSearchPathOptions();

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,10 +1465,7 @@ unsigned SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager,
14651465

14661466
// Not persistent because we're building source files one at a time.
14671467
swift::TopLevelContext top_level_context;
1468-
swift::OptionSet<swift::TypeCheckingFlags> type_checking_options;
1469-
1470-
swift::performTypeChecking(parsed_expr->source_file, top_level_context,
1471-
type_checking_options);
1468+
swift::performTypeChecking(parsed_expr->source_file, top_level_context);
14721469

14731470
if (swift_ast_ctx->HasErrors()) {
14741471
DiagnoseSwiftASTContextError();

lldb/source/Symbol/SwiftASTContext.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2629,6 +2629,10 @@ swift::LangOptions &SwiftASTContext::GetLanguageOptions() {
26292629
return GetCompilerInvocation().getLangOptions();
26302630
}
26312631

2632+
swift::TypeCheckerOptions &SwiftASTContext::GetTypeCheckerOptions() {
2633+
return GetCompilerInvocation().getTypeCheckerOptions();
2634+
}
2635+
26322636
swift::DiagnosticEngine &SwiftASTContext::GetDiagnosticEngine() {
26332637
if (!m_diagnostic_engine_ap) {
26342638
m_diagnostic_engine_ap.reset(
@@ -3322,7 +3326,8 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
33223326
return m_ast_context_ap.get();
33233327

33243328
m_ast_context_ap.reset(
3325-
swift::ASTContext::get(GetLanguageOptions(), GetSearchPathOptions(),
3329+
swift::ASTContext::get(GetLanguageOptions(), GetTypeCheckerOptions(),
3330+
GetSearchPathOptions(),
33263331
GetSourceManager(), GetDiagnosticEngine()));
33273332
m_diagnostic_consumer_ap.reset(new StoringDiagnosticConsumer(*this));
33283333

0 commit comments

Comments
 (0)