Skip to content
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
13 changes: 5 additions & 8 deletions lldb/include/lldb/Target/SwiftLanguageRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,21 @@
#ifndef liblldb_SwiftLanguageRuntime_h_
#define liblldb_SwiftLanguageRuntime_h_

// C Includes
// C++ Includes
#include <mutex>
#include <tuple>
#include <vector>
// Other libraries and framework includes
// Project includes
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Breakpoint/BreakpointPrecondition.h"
#include "lldb/Core/PluginInterface.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/LanguageRuntime.h"
#include "lldb/lldb-private.h"

#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Casting.h"

#include <mutex>
#include <tuple>
#include <vector>

namespace swift {
namespace remote {
class MemoryReader;
Expand Down
8 changes: 8 additions & 0 deletions lldb/source/API/SystemInitializerFull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
#include "lldb/Utility/Timer.h"
#include "llvm/Support/TargetSelect.h"

// BEGIN SWIFT
#include "Plugins/ExpressionParser/Swift/SwiftREPL.h"
#include "Plugins/InstrumentationRuntime/SwiftRuntimeReporting/SwiftRuntimeReporting.h"
#include "Plugins/Language/Swift/SwiftLanguage.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Target/SwiftLanguageRuntime.h"
// END SWIFT

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#include "llvm/ExecutionEngine/MCJIT.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include "Plugins/Language/ObjC/ObjCLanguage.h"

#ifdef LLDB_ENABLE_SWIFT
#include "lldb/Symbol/SwiftASTContext.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Target/SwiftLanguageRuntime.h"
#endif // LLDB_ENABLE_SWIFT

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include "lldb/lldb-private-types.h"

// BEGIN SWIFT
#include "lldb/Symbol/SwiftASTContext.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
// END SWIFT

#include "llvm/Support/Compiler.h"
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Core/ValueObjectDynamicValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "lldb/Core/Value.h"
#include "lldb/Core/ValueObject.h"
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/LanguageRuntime.h"
Expand All @@ -23,6 +22,8 @@
#include "lldb/Utility/Status.h"
#include "lldb/lldb-types.h"

#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"

#include <string.h>
namespace lldb_private {
class Declaration;
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Core/ValueObjectVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "lldb/Symbol/Declaration.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/SymbolContextScope.h"
#include "lldb/Symbol/Type.h"
Expand All @@ -33,6 +32,8 @@
#include "lldb/lldb-private-enumerations.h"
#include "lldb/lldb-types.h"

#include "Plugins/TypeSystem/Swift/TypeSystemSwift.h"

#include "llvm/ADT/StringRef.h"

#include <assert.h>
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Expression/Materializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Expression/ExpressionVariable.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Symbol/Variable.h"
#include "lldb/Target/ExecutionContext.h"
Expand All @@ -24,6 +23,8 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"

#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"

#include <memory>

using namespace lldb_private;
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Expression/UserExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Symbol/TypeSystem.h"
Expand All @@ -45,6 +44,8 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"

#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"

using namespace lldb_private;

char UserExpression::ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "lldb/Utility/StreamString.h"

#ifdef LLDB_ENABLE_SWIFT
#include "lldb/Symbol/SwiftASTContext.h" // Needed for llvm::isa<SwiftASTContext>(...)
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h" // Needed for llvm::isa<SwiftASTContext>(...)
#include "lldb/Symbol/TypeSystem.h"
#include "swift/AST/Decl.h"
#include "swift/AST/Pattern.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Plugins/ExpressionParser/Swift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ add_lldb_library(lldbPluginExpressionParserSwift PLUGIN
lldbSymbol
lldbTarget
lldbUtility
lldbPluginTypeSystemSwift
swiftAST
swiftBasic
swiftClangImporter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

#include "SwiftASTManipulator.h"

#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Expression/ExpressionParser.h"
#include "lldb/Expression/ExpressionSourceCode.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Log.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "SwiftExpressionSourceCode.h"

#include "Plugins/ExpressionParser/Swift/SwiftASTManipulator.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Target.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@

#include "SwiftPersistentExpressionState.h"
#include "SwiftExpressionVariable.h"
#include "lldb/Expression/IRExecutionUnit.h"

#include "lldb/Expression/IRExecutionUnit.h"
#include "lldb/Core/Value.h"

#include "lldb/Symbol/SwiftASTContext.h" // Needed for llvm::isa<SwiftASTContext>(...)
#include "lldb/Symbol/TypeSystem.h"

#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "SwiftExpressionVariable.h"

#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
Expand All @@ -25,7 +26,6 @@
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
#ifndef liblldb_SwiftREPL_h_
#define liblldb_SwiftREPL_h_

#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Utility/Status.h"
#include "lldb/Expression/REPL.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-public.h"

#include <string>
Expand All @@ -24,6 +23,7 @@
namespace lldb_private {

class IRExecutionUnit;
class SwiftASTContextForExpressions;

//----------------------------------------------------------------------
/// @class SwiftREPL SwiftREPL.h "lldb/Expression/SwiftREPL.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include "lldb/Target/Thread.h"
#include "lldb/Utility/RegularExpression.h"
#ifdef LLDB_ENABLE_SWIFT
#include "lldb/Symbol/SwiftASTContext.h"
#include "Plugins/Process/Utility/HistoryThread.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "swift/AST/ASTContext.h"
#include "swift/AST/NameLookup.h"
#include "swift/ClangImporter/ClangImporter.h"
Expand Down
1 change: 1 addition & 0 deletions lldb/source/Plugins/Language/Swift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ add_lldb_library(lldbPluginSwiftLanguage PLUGIN
lldbTarget
lldbUtility
lldbPluginObjCLanguage
lldbPluginTypeSystemSwift
swiftAST
swiftClangImporter
clangAST
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/Swift/SwiftArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "SwiftArray.h"

#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/DataFormatters/FormattersHelpers.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SwiftLanguageRuntime.h"
#include "lldb/Target/Target.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/Swift/SwiftDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "SwiftDictionary.h"

#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/DataFormatters/FormattersHelpers.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SwiftLanguageRuntime.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/DataFormatters/FormattersHelpers.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SwiftLanguageRuntime.h"
#include "lldb/Utility/DataBufferHeap.h"
Expand Down
4 changes: 4 additions & 0 deletions lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,10 @@ SwiftLanguage::GetHardcodedSynthetics() {
CompilerType type(valobj.GetCompilerType());
Flags type_flags(type.GetTypeInfo());
if (type_flags.AllSet(eTypeIsSwift | eTypeIsEnumeration)) {
// FIXME: The classification of clang-imported enums may
// change based on whether a Swift module is present or not.
if (!valobj.GetValueAsCString())
return nullptr;
if (!swift_enum_synth)
swift_enum_synth = lldb::SyntheticChildrenSP(new CXXSyntheticChildren(
SyntheticChildren::Flags()
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/Swift/SwiftOptionSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "SwiftOptionSet.h"

#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Core/ValueObject.h"
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Utility/StreamString.h"

#include "swift/AST/Decl.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/Swift/SwiftOptional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
//===----------------------------------------------------------------------===//

#include "SwiftOptional.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/DataFormatters/DataVisualization.h"
#include "lldb/DataFormatters/TypeSummary.h"
#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SwiftLanguageRuntime.h"
#include "lldb/Utility/DataBufferHeap.h"
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/Swift/SwiftSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "SwiftSet.h"

#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/DataFormatters/FormattersHelpers.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SwiftLanguageRuntime.h"

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/Swift/SwiftUnsafeTypes.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "SwiftUnsafeTypes.h"

#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/DataFormatters/TypeSynthetic.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Target/SwiftLanguageRuntime.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
#include "clang/AST/DeclObjC.h"

#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SwiftASTContext.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Symbol/TypeMap.h"
Expand Down
4 changes: 4 additions & 0 deletions lldb/source/Plugins/TypeSystem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
add_subdirectory(Clang)

if (LLDB_ENABLE_SWIFT_SUPPORT)
add_subdirectory(Swift)
endif()
14 changes: 14 additions & 0 deletions lldb/source/Plugins/TypeSystem/Swift/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_lldb_library(lldbPluginTypeSystemSwift PLUGIN
TypeSystemSwift.cpp
TypeSystemSwiftTypeRef.cpp
SwiftASTContext.cpp

LINK_LIBS
lldbCore
lldbSymbol
lldbTarget
lldbUtility

LINK_COMPONENTS
Support
)
Loading