Skip to content

Commit 92fc3bf

Browse files
committed
Move SwiftASTContext & TypeSystemSwift* into Plugins/TypeSystem/Swift
to mirror a similar move spearheaded by the Clang typesystem. (cherry picked from commit 9161b3cb453064096ccb92d181d996154d24ada7) Conflicts: lldb/source/API/SystemInitializerFull.cpp lldb/source/Core/Module.cpp lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp lldb/source/Plugins/Language/Swift/SwiftDictionary.cpp lldb/source/Plugins/Language/Swift/SwiftSet.cpp lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h lldb/source/Target/Target.cpp lldb/unittests/Symbol/CMakeLists.txt (cherry picked from commit a794ee1)
1 parent 7449a58 commit 92fc3bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+641
-557
lines changed

lldb/include/lldb/Target/SwiftLanguageRuntime.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,21 @@
1313
#ifndef liblldb_SwiftLanguageRuntime_h_
1414
#define liblldb_SwiftLanguageRuntime_h_
1515

16-
// C Includes
17-
// C++ Includes
18-
#include <mutex>
19-
#include <tuple>
20-
#include <vector>
21-
// Other libraries and framework includes
22-
// Project includes
2316
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
17+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
2418
#include "lldb/Breakpoint/BreakpointPrecondition.h"
2519
#include "lldb/Core/PluginInterface.h"
26-
#include "lldb/Symbol/SwiftASTContext.h"
2720
#include "lldb/Target/LanguageRuntime.h"
2821
#include "lldb/lldb-private.h"
2922

3023
#include "llvm/ADT/Optional.h"
3124
#include "llvm/ADT/StringSet.h"
3225
#include "llvm/Support/Casting.h"
3326

27+
#include <mutex>
28+
#include <tuple>
29+
#include <vector>
30+
3431
namespace swift {
3532
namespace remote {
3633
class MemoryReader;

lldb/source/API/SystemInitializerFull.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
#include "lldb/Utility/Timer.h"
1818
#include "llvm/Support/TargetSelect.h"
1919

20+
// BEGIN SWIFT
21+
#include "Plugins/ExpressionParser/Swift/SwiftREPL.h"
22+
#include "Plugins/InstrumentationRuntime/SwiftRuntimeReporting/SwiftRuntimeReporting.h"
23+
#include "Plugins/Language/Swift/SwiftLanguage.h"
24+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
25+
#include "lldb/Target/SwiftLanguageRuntime.h"
26+
// END SWIFT
27+
2028
#pragma clang diagnostic push
2129
#pragma clang diagnostic ignored "-Wglobal-constructors"
2230
#include "llvm/ExecutionEngine/MCJIT.h"

lldb/source/Core/Module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#include "Plugins/Language/ObjC/ObjCLanguage.h"
5555

5656
#ifdef LLDB_ENABLE_SWIFT
57-
#include "lldb/Symbol/SwiftASTContext.h"
57+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
5858
#include "lldb/Target/SwiftLanguageRuntime.h"
5959
#endif // LLDB_ENABLE_SWIFT
6060

lldb/source/Core/ValueObject.cpp

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

5454
// BEGIN SWIFT
55-
#include "lldb/Symbol/SwiftASTContext.h"
55+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
5656
// END SWIFT
5757

5858
#include "llvm/Support/Compiler.h"

lldb/source/Core/ValueObjectDynamicValue.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "lldb/Core/Value.h"
1111
#include "lldb/Core/ValueObject.h"
1212
#include "lldb/Symbol/CompilerType.h"
13-
#include "lldb/Symbol/SwiftASTContext.h"
1413
#include "lldb/Symbol/Type.h"
1514
#include "lldb/Target/ExecutionContext.h"
1615
#include "lldb/Target/LanguageRuntime.h"
@@ -23,6 +22,8 @@
2322
#include "lldb/Utility/Status.h"
2423
#include "lldb/lldb-types.h"
2524

25+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
26+
2627
#include <string.h>
2728
namespace lldb_private {
2829
class Declaration;

lldb/source/Core/ValueObjectVariable.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "lldb/Symbol/Declaration.h"
1717
#include "lldb/Symbol/Function.h"
1818
#include "lldb/Symbol/ObjectFile.h"
19-
#include "lldb/Symbol/SwiftASTContext.h"
2019
#include "lldb/Symbol/SymbolContext.h"
2120
#include "lldb/Symbol/SymbolContextScope.h"
2221
#include "lldb/Symbol/Type.h"
@@ -33,6 +32,8 @@
3332
#include "lldb/lldb-private-enumerations.h"
3433
#include "lldb/lldb-types.h"
3534

35+
#include "Plugins/TypeSystem/Swift/TypeSystemSwift.h"
36+
3637
#include "llvm/ADT/StringRef.h"
3738

3839
#include <assert.h>

lldb/source/Expression/Materializer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "lldb/Core/ValueObjectVariable.h"
1313
#include "lldb/Expression/ExpressionVariable.h"
1414
#include "lldb/Symbol/Symbol.h"
15-
#include "lldb/Symbol/SwiftASTContext.h"
1615
#include "lldb/Symbol/Type.h"
1716
#include "lldb/Symbol/Variable.h"
1817
#include "lldb/Target/ExecutionContext.h"
@@ -24,6 +23,8 @@
2423
#include "lldb/Utility/Log.h"
2524
#include "lldb/Utility/RegisterValue.h"
2625

26+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
27+
2728
#include <memory>
2829

2930
using namespace lldb_private;

lldb/source/Expression/UserExpression.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "lldb/Symbol/Block.h"
3131
#include "lldb/Symbol/Function.h"
3232
#include "lldb/Symbol/ObjectFile.h"
33-
#include "lldb/Symbol/SwiftASTContext.h"
3433
#include "lldb/Symbol/SymbolVendor.h"
3534
#include "lldb/Symbol/Type.h"
3635
#include "lldb/Symbol/TypeSystem.h"
@@ -45,6 +44,8 @@
4544
#include "lldb/Utility/Log.h"
4645
#include "lldb/Utility/StreamString.h"
4746

47+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
48+
4849
using namespace lldb_private;
4950

5051
char UserExpression::ID;

lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "lldb/Utility/StreamString.h"
1919

2020
#ifdef LLDB_ENABLE_SWIFT
21-
#include "lldb/Symbol/SwiftASTContext.h" // Needed for llvm::isa<SwiftASTContext>(...)
21+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h" // Needed for llvm::isa<SwiftASTContext>(...)
2222
#include "lldb/Symbol/TypeSystem.h"
2323
#include "swift/AST/Decl.h"
2424
#include "swift/AST/Pattern.h"

lldb/source/Plugins/ExpressionParser/Swift/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ add_lldb_library(lldbPluginExpressionParserSwift PLUGIN
2626
lldbSymbol
2727
lldbTarget
2828
lldbUtility
29+
lldbPluginTypeSystemSwift
2930
swiftAST
3031
swiftBasic
3132
swiftClangImporter

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
#include "SwiftASTManipulator.h"
1414

15+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1516
#include "lldb/Expression/ExpressionParser.h"
1617
#include "lldb/Expression/ExpressionSourceCode.h"
17-
#include "lldb/Symbol/SwiftASTContext.h"
1818
#include "lldb/Target/Target.h"
1919
#include "lldb/Utility/ConstString.h"
2020
#include "lldb/Utility/Log.h"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "SwiftExpressionSourceCode.h"
1010

1111
#include "Plugins/ExpressionParser/Swift/SwiftASTManipulator.h"
12-
#include "lldb/Symbol/SwiftASTContext.h"
12+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1313
#include "lldb/Target/Language.h"
1414
#include "lldb/Target/Platform.h"
1515
#include "lldb/Target/Target.h"

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212

1313
#include "SwiftPersistentExpressionState.h"
1414
#include "SwiftExpressionVariable.h"
15-
#include "lldb/Expression/IRExecutionUnit.h"
1615

16+
#include "lldb/Expression/IRExecutionUnit.h"
1717
#include "lldb/Core/Value.h"
18-
19-
#include "lldb/Symbol/SwiftASTContext.h" // Needed for llvm::isa<SwiftASTContext>(...)
2018
#include "lldb/Symbol/TypeSystem.h"
21-
2219
#include "lldb/Utility/DataExtractor.h"
2320
#include "lldb/Utility/Log.h"
2421
#include "lldb/Utility/StreamString.h"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "SwiftExpressionVariable.h"
1616

17+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1718
#include "lldb/Core/Debugger.h"
1819
#include "lldb/Core/Module.h"
1920
#include "lldb/Core/PluginManager.h"
@@ -25,7 +26,6 @@
2526
#include "lldb/Interpreter/CommandInterpreter.h"
2627
#include "lldb/Interpreter/CommandReturnObject.h"
2728
#include "lldb/Symbol/ObjectFile.h"
28-
#include "lldb/Symbol/SwiftASTContext.h"
2929
#include "lldb/Symbol/SymbolVendor.h"
3030
#include "lldb/Target/Process.h"
3131
#include "lldb/Target/Target.h"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
#ifndef liblldb_SwiftREPL_h_
1414
#define liblldb_SwiftREPL_h_
1515

16-
#include "lldb/Symbol/SwiftASTContext.h"
17-
#include "lldb/Utility/Status.h"
1816
#include "lldb/Expression/REPL.h"
17+
#include "lldb/Utility/Status.h"
1918
#include "lldb/lldb-public.h"
2019

2120
#include <string>
@@ -24,6 +23,7 @@
2423
namespace lldb_private {
2524

2625
class IRExecutionUnit;
26+
class SwiftASTContextForExpressions;
2727

2828
//----------------------------------------------------------------------
2929
/// @class SwiftREPL SwiftREPL.h "lldb/Expression/SwiftREPL.h"

lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
#include "lldb/Target/Thread.h"
2525
#include "lldb/Utility/RegularExpression.h"
2626
#ifdef LLDB_ENABLE_SWIFT
27-
#include "lldb/Symbol/SwiftASTContext.h"
27+
#include "Plugins/Process/Utility/HistoryThread.h"
28+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
2829
#include "swift/AST/ASTContext.h"
2930
#include "swift/AST/NameLookup.h"
3031
#include "swift/ClangImporter/ClangImporter.h"

lldb/source/Plugins/Language/Swift/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ add_lldb_library(lldbPluginSwiftLanguage PLUGIN
2323
lldbTarget
2424
lldbUtility
2525
lldbPluginObjCLanguage
26+
lldbPluginTypeSystemSwift
2627
swiftAST
2728
swiftClangImporter
2829
clangAST

lldb/source/Plugins/Language/Swift/SwiftArray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "SwiftArray.h"
1414

1515
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
16+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1617
#include "lldb/Core/ValueObjectConstResult.h"
1718
#include "lldb/DataFormatters/FormattersHelpers.h"
18-
#include "lldb/Symbol/SwiftASTContext.h"
1919
#include "lldb/Target/Process.h"
2020
#include "lldb/Target/SwiftLanguageRuntime.h"
2121
#include "lldb/Target/Target.h"

lldb/source/Plugins/Language/Swift/SwiftDictionary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include "SwiftDictionary.h"
1414

1515
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
16+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1617
#include "lldb/DataFormatters/FormattersHelpers.h"
17-
#include "lldb/Symbol/SwiftASTContext.h"
1818
#include "lldb/Target/Process.h"
1919
#include "lldb/Target/SwiftLanguageRuntime.h"
2020

lldb/source/Plugins/Language/Swift/SwiftHashedContainer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
1616
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
17+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1718
#include "lldb/Core/ValueObjectConstResult.h"
1819
#include "lldb/DataFormatters/FormattersHelpers.h"
19-
#include "lldb/Symbol/SwiftASTContext.h"
2020
#include "lldb/Target/Process.h"
2121
#include "lldb/Target/SwiftLanguageRuntime.h"
2222
#include "lldb/Utility/DataBufferHeap.h"

lldb/source/Plugins/Language/Swift/SwiftOptionSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "SwiftOptionSet.h"
1414

1515
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
16+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1617
#include "lldb/Core/ValueObject.h"
1718
#include "lldb/Symbol/CompilerType.h"
18-
#include "lldb/Symbol/SwiftASTContext.h"
1919
#include "lldb/Utility/StreamString.h"
2020

2121
#include "swift/AST/Decl.h"

lldb/source/Plugins/Language/Swift/SwiftOptional.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "SwiftOptional.h"
14+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1415
#include "lldb/DataFormatters/DataVisualization.h"
1516
#include "lldb/DataFormatters/TypeSummary.h"
1617
#include "lldb/DataFormatters/ValueObjectPrinter.h"
17-
#include "lldb/Symbol/SwiftASTContext.h"
1818
#include "lldb/Target/Process.h"
1919
#include "lldb/Target/SwiftLanguageRuntime.h"
2020
#include "lldb/Utility/DataBufferHeap.h"

lldb/source/Plugins/Language/Swift/SwiftSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include "SwiftSet.h"
1414

1515
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
16+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
1617
#include "lldb/DataFormatters/FormattersHelpers.h"
17-
#include "lldb/Symbol/SwiftASTContext.h"
1818
#include "lldb/Target/Process.h"
1919
#include "lldb/Target/SwiftLanguageRuntime.h"
2020

lldb/source/Plugins/Language/Swift/SwiftUnsafeTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "SwiftUnsafeTypes.h"
22

3+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
34
#include "lldb/DataFormatters/TypeSynthetic.h"
4-
#include "lldb/Symbol/SwiftASTContext.h"
55
#include "lldb/Target/SwiftLanguageRuntime.h"
66
#include "lldb/Utility/Log.h"
77
#include "lldb/Utility/Logging.h"

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserSwift.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
#include "clang/AST/DeclObjC.h"
2727

2828
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
29+
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
2930
#include "lldb/Core/Module.h"
3031
#include "lldb/Symbol/CompileUnit.h"
3132
#include "lldb/Symbol/Function.h"
3233
#include "lldb/Symbol/ObjectFile.h"
33-
#include "lldb/Symbol/SwiftASTContext.h"
3434
#include "lldb/Symbol/SymbolVendor.h"
3535
#include "lldb/Symbol/Type.h"
3636
#include "lldb/Symbol/TypeMap.h"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
add_subdirectory(Clang)
2+
3+
if (LLDB_ENABLE_SWIFT_SUPPORT)
4+
add_subdirectory(Swift)
5+
endif()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
add_lldb_library(lldbPluginTypeSystemSwift PLUGIN
2+
TypeSystemSwift.cpp
3+
TypeSystemSwiftTypeRef.cpp
4+
SwiftASTContext.cpp
5+
6+
LINK_LIBS
7+
lldbCore
8+
lldbSymbol
9+
lldbTarget
10+
lldbUtility
11+
12+
LINK_COMPONENTS
13+
Support
14+
)

0 commit comments

Comments
 (0)