Skip to content

Commit 28b9ec2

Browse files
CodaFiJDevlieghere
authored andcommitted
Absorb TypeCheckerFlags into the Swift Frontend
Supports swiftlang/swift#28173
1 parent 44da625 commit 28b9ec2

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
@@ -166,6 +166,8 @@ class SwiftASTContext : public TypeSystem {
166166

167167
swift::LangOptions &GetLanguageOptions();
168168

169+
swift::TypeCheckerOptions &GetTypeCheckerOptions();
170+
169171
swift::DiagnosticEngine &GetDiagnosticEngine();
170172

171173
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
@@ -2695,6 +2695,10 @@ swift::LangOptions &SwiftASTContext::GetLanguageOptions() {
26952695
return GetCompilerInvocation().getLangOptions();
26962696
}
26972697

2698+
swift::TypeCheckerOptions &SwiftASTContext::GetTypeCheckerOptions() {
2699+
return GetCompilerInvocation().getTypeCheckerOptions();
2700+
}
2701+
26982702
swift::DiagnosticEngine &SwiftASTContext::GetDiagnosticEngine() {
26992703
if (!m_diagnostic_engine_ap) {
27002704
m_diagnostic_engine_ap.reset(
@@ -3394,7 +3398,8 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
33943398
return m_ast_context_ap.get();
33953399

33963400
m_ast_context_ap.reset(
3397-
swift::ASTContext::get(GetLanguageOptions(), GetSearchPathOptions(),
3401+
swift::ASTContext::get(GetLanguageOptions(), GetTypeCheckerOptions(),
3402+
GetSearchPathOptions(),
33983403
GetSourceManager(), GetDiagnosticEngine()));
33993404
m_diagnostic_consumer_ap.reset(new StoringDiagnosticConsumer(*this));
34003405

0 commit comments

Comments
 (0)