Skip to content

Commit 3d37c33

Browse files
committed
Move the ownership of SwiftPersistentExpressionState to TypeSystemSwiftTypeRefFE
This allows result variables to persist across SwiftASTContexts. User declarations become invisible in other contexts (NFC) User imports also don't affect other contexts (NFC)
1 parent 9ede895 commit 3d37c33

18 files changed

+38
-30
lines changed

lldb/source/Core/ValueObject.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "lldb/lldb-private-types.h"
5353

5454
#ifdef LLDB_ENABLE_SWIFT
55+
#include "Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h"
5556
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
5657
#endif //LLDB_ENABLE_SWIFT
5758

lldb/source/Expression/Materializer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#ifdef LLDB_ENABLE_SWIFT
2929
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
30+
#include "Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h"
3031
#endif //LLDB_ENABLE_SWIFT
3132

3233
#include <memory>

lldb/source/Expression/UserExpression.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
#ifdef LLDB_ENABLE_SWIFT
4646
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
47+
#include "Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h"
4748
#endif //LLDB_ENABLE_SWIFT
4849

4950
using namespace lldb_private;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
#include "SwiftExpressionParser.h"
1414

1515
#include "SwiftASTManipulator.h"
16+
#include "SwiftDiagnostic.h"
1617
#include "SwiftExpressionSourceCode.h"
18+
#include "SwiftExpressionVariable.h"
19+
#include "SwiftPersistentExpressionState.h"
1720
#include "SwiftREPLMaterializer.h"
1821
#include "SwiftSILManipulator.h"
1922
#include "SwiftUserExpression.h"
2023

21-
#include "Plugins/ExpressionParser/Swift/SwiftDiagnostic.h"
22-
#include "Plugins/ExpressionParser/Swift/SwiftExpressionVariable.h"
2324
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
2425
#include "lldb/Core/Module.h"
2526
#include "lldb/Core/ModuleList.h"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "SwiftExpressionSourceCode.h"
10+
#include "SwiftPersistentExpressionState.h"
1011

1112
#include "Plugins/ExpressionParser/Swift/SwiftASTManipulator.h"
1213
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"

lldb/source/Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
#include "llvm/ADT/StringMap.h"
2121
#include "llvm/ADT/StringRef.h"
2222

23-
#include <set>
2423
#include <string>
25-
#include <unordered_map>
2624

2725
namespace lldb_private {
2826

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "SwiftREPLMaterializer.h"
1414
#include "SwiftASTManipulator.h"
15+
#include "SwiftPersistentExpressionState.h"
1516

1617
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
1718
#include "lldb/Core/DumpDataExtractor.h"

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "SwiftASTManipulator.h"
14+
#include "SwiftExpressionParser.h"
15+
#include "SwiftExpressionSourceCode.h"
16+
#include "SwiftPersistentExpressionState.h"
17+
#include "SwiftREPLMaterializer.h"
18+
1319
#include "swift/AST/ASTContext.h"
1420
#include "swift/AST/GenericEnvironment.h"
1521
#include "swift/Demangling/Demangler.h"
16-
#include <stdio.h>
1722
#if HAVE_SYS_TYPES_H
1823
#include <sys/types.h>
1924
#endif
2025

21-
#include "SwiftASTManipulator.h"
22-
#include "SwiftExpressionParser.h"
23-
#include "SwiftExpressionSourceCode.h"
24-
#include "SwiftREPLMaterializer.h"
25-
#include "SwiftASTManipulator.h"
26-
2726
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
2827
#include "lldb/Core/Module.h"
2928
#include "lldb/Expression/DiagnosticManager.h"
@@ -46,8 +45,6 @@
4645
#include "swift/Demangling/Demangler.h"
4746
#include "swift/AST/GenericEnvironment.h"
4847

49-
50-
#include <cstdlib>
5148
#include <map>
5249
#include <string>
5350

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "SwiftLanguageRuntimeImpl.h"
1616
#include "SwiftMetadataCache.h"
1717

18+
#include "Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h"
1819
#include "Plugins/Process/Utility/RegisterContext_x86.h"
1920
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
2021
#include "Utility/ARM64_DWARF_Registers.h"

lldb/source/Plugins/TypeSystem/Swift/StoringDiagnosticConsumer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include "Plugins/ExpressionParser/Swift/SwiftDiagnostic.h"
1717

18+
#include "lldb/Utility/StreamString.h"
19+
1820
#include "swift/AST/DiagnosticEngine.h"
1921
#include "swift/AST/DiagnosticsClangImporter.h"
2022
#include "swift/AST/DiagnosticsSema.h"

0 commit comments

Comments
 (0)