Skip to content

Commit dee0a4c

Browse files
fredrissTeemperor
authored andcommitted
Merge commit '4a06c1974892' from apple/stable/20200108 into swift/master
Conflicts: lldb/include/lldb/Symbol/TypeSystem.h lldb/source/DataFormatters/FormatManager.cpp lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp lldb/source/Plugins/Language/ObjC/CMakeLists.txt lldb/source/Symbol/CMakeLists.txt lldb/source/Symbol/CompilerType.cpp
2 parents 5b39556 + 4a06c19 commit dee0a4c

File tree

156 files changed

+269
-219
lines changed

Some content is hidden

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

156 files changed

+269
-219
lines changed

lldb/include/lldb/Symbol/TypeSystem.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,8 @@ class TypeSystem : public PluginInterface {
217217

218218
virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type) = 0;
219219

220-
// Defaults to GetTypeName(type). Override if your language desires
221-
// specialized behavior.
222-
// \param sc An optional symbol context of the function the type appears in.
223220
virtual ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type,
224-
const SymbolContext *sc = nullptr);
221+
const SymbolContext *sc = nullptr) = 0;
225222

226223
// Defaults to GetTypeName(type). Override if your language desires
227224
// specialized behavior.

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,7 @@ def expect_expr(
24022402
"Unexpected failure with msg: " + eval_result.GetError().GetCString())
24032403

24042404
if result_type:
2405-
self.assertEqual(result_type, eval_result.GetTypeName())
2405+
self.assertEqual(result_type, eval_result.GetDisplayTypeName())
24062406

24072407
if result_value:
24082408
self.assertEqual(result_value, eval_result.GetValue())

lldb/source/API/SBTarget.cpp

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

1212
#include "lldb/lldb-public.h"
1313

14+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1415
#include "lldb/API/SBBreakpoint.h"
1516
#include "lldb/API/SBDebugger.h"
1617
#include "lldb/API/SBEvent.h"
@@ -43,7 +44,6 @@
4344
#include "lldb/Core/ValueObjectList.h"
4445
#include "lldb/Core/ValueObjectVariable.h"
4546
#include "lldb/Host/Host.h"
46-
#include "lldb/Symbol/TypeSystemClang.h"
4747
#include "lldb/Symbol/DeclVendor.h"
4848
#include "lldb/Symbol/ObjectFile.h"
4949
#include "lldb/Symbol/SymbolFile.h"

lldb/source/API/SystemInitializerFull.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "lldb/Host/Host.h"
2323
#include "lldb/Initialization/SystemInitializerCommon.h"
2424
#include "lldb/Interpreter/CommandInterpreter.h"
25-
#include "lldb/Symbol/TypeSystemClang.h"
2625
#include "lldb/Utility/Timer.h"
2726

2827
#include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h"
@@ -95,6 +94,7 @@
9594
#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h"
9695
#include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h"
9796
#include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h"
97+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
9898
#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h"
9999
#include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h"
100100

lldb/source/Core/ValueObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "lldb/DataFormatters/ValueObjectPrinter.h"
2727
#include "lldb/Expression/ExpressionVariable.h"
2828
#include "lldb/Host/Config.h"
29-
#include "lldb/Symbol/TypeSystemClang.h"
3029
#include "lldb/Symbol/CompileUnit.h"
3130
#include "lldb/Symbol/CompilerType.h"
3231
#include "lldb/Symbol/Declaration.h"
@@ -51,6 +50,7 @@
5150
#include "lldb/Utility/Stream.h"
5251
#include "lldb/Utility/StreamString.h"
5352
#include "lldb/lldb-private-types.h"
53+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
5454

5555
// BEGIN SWIFT
5656
#include "lldb/Symbol/SwiftASTContext.h"

lldb/source/DataFormatters/FormatManager.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "lldb/Target/Language.h"
1919
#include "lldb/Utility/Log.h"
2020

21+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
22+
2123
using namespace lldb;
2224
using namespace lldb_private;
2325
using namespace lldb_private::formatters;
@@ -193,14 +195,17 @@ void FormatManager::GetPossibleMatches(
193195
entries.push_back(
194196
{type_name, reason, did_strip_ptr, did_strip_ref, did_strip_typedef});
195197

196-
const SymbolContext *sc = nullptr;
197-
if (valobj.GetFrameSP())
198-
sc = &valobj.GetFrameSP()->GetSymbolContext(eSymbolContextFunction);
198+
TypeSystem *ts = compiler_type.GetTypeSystem();
199+
if (ts && !llvm::isa<TypeSystemClang>(ts)) {
200+
const SymbolContext *sc = nullptr;
201+
if (valobj.GetFrameSP())
202+
sc = &valobj.GetFrameSP()->GetSymbolContext(eSymbolContextFunction);
199203

200-
ConstString display_type_name(compiler_type.GetDisplayTypeName(sc));
201-
if (display_type_name != type_name)
202-
entries.push_back({display_type_name, reason, did_strip_ptr,
203-
did_strip_ref, did_strip_typedef});
204+
ConstString display_type_name(compiler_type.GetDisplayTypeName(sc));
205+
if (display_type_name != type_name)
206+
entries.push_back({display_type_name, reason, did_strip_ptr,
207+
did_strip_ref, did_strip_typedef});
208+
}
204209
}
205210

206211
for (bool is_rvalue_ref = true, j = true;

lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "llvm/ADT/STLExtras.h"
1212
#include "llvm/ADT/Triple.h"
1313

14+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1415
#include "Utility/PPC64LE_DWARF_Registers.h"
1516
#include "Utility/PPC64_DWARF_Registers.h"
1617
#include "lldb/Core/Module.h"
@@ -19,7 +20,6 @@
1920
#include "lldb/Core/ValueObjectConstResult.h"
2021
#include "lldb/Core/ValueObjectMemory.h"
2122
#include "lldb/Core/ValueObjectRegister.h"
22-
#include "lldb/Symbol/TypeSystemClang.h"
2323
#include "lldb/Symbol/UnwindPlan.h"
2424
#include "lldb/Target/Process.h"
2525
#include "lldb/Target/RegisterContext.h"

lldb/source/Plugins/ABI/SysV-ppc64/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ add_lldb_library(lldbPluginABISysV_ppc64 PLUGIN
55
lldbCore
66
lldbSymbol
77
lldbTarget
8+
lldbPluginTypeSystemClang
89
LINK_COMPONENTS
910
Support
1011
)

lldb/source/Plugins/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ add_subdirectory(StructuredData)
1919
add_subdirectory(SymbolFile)
2020
add_subdirectory(SystemRuntime)
2121
add_subdirectory(SymbolVendor)
22+
add_subdirectory(TypeSystem)
2223
add_subdirectory(UnwindAssembly)

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ add_lldb_library(lldbPluginDynamicLoaderMacOSXDYLD PLUGIN
1111
lldbSymbol
1212
lldbTarget
1313
lldbUtility
14+
lldbPluginTypeSystemClang
1415
LINK_COMPONENTS
1516
Support
1617
)

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "lldb/Core/Section.h"
1717
#include "lldb/Expression/DiagnosticManager.h"
1818
#include "lldb/Host/FileSystem.h"
19-
#include "lldb/Symbol/TypeSystemClang.h"
2019
#include "lldb/Symbol/Function.h"
2120
#include "lldb/Symbol/ObjectFile.h"
2221
#include "lldb/Target/ABI.h"
@@ -32,6 +31,7 @@
3231
#include "lldb/Utility/State.h"
3332

3433
#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
34+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
3535

3636
//#define ENABLE_DEBUG_PRINTF // COMMENT THIS LINE OUT PRIOR TO CHECKIN
3737
#ifdef ENABLE_DEBUG_PRINTF

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "lldb/Core/Module.h"
1212
#include "lldb/Core/PluginManager.h"
1313
#include "lldb/Core/Section.h"
14-
#include "lldb/Symbol/TypeSystemClang.h"
1514
#include "lldb/Symbol/ObjectFile.h"
1615
#include "lldb/Symbol/SymbolVendor.h"
1716
#include "lldb/Target/ABI.h"
@@ -24,6 +23,8 @@
2423
#include "DynamicLoaderDarwin.h"
2524
#include "DynamicLoaderMacOS.h"
2625

26+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
27+
2728
using namespace lldb;
2829
using namespace lldb_private;
2930

lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "lldb/Core/ModuleSpec.h"
1313
#include "lldb/Core/PluginManager.h"
1414
#include "lldb/Core/Section.h"
15-
#include "lldb/Symbol/TypeSystemClang.h"
1615
#include "lldb/Symbol/Function.h"
1716
#include "lldb/Symbol/ObjectFile.h"
1817
#include "lldb/Target/ABI.h"
@@ -30,6 +29,7 @@
3029
#include "DynamicLoaderMacOSXDYLD.h"
3130

3231
#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
32+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
3333

3434
//#define ENABLE_DEBUG_PRINTF // COMMENT THIS LINE OUT PRIOR TO CHECKIN
3535
#ifdef ENABLE_DEBUG_PRINTF

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
#include "ASTResultSynthesizer.h"
1010

11+
#include "ClangASTImporter.h"
1112
#include "ClangPersistentVariables.h"
1213

13-
#include "lldb/Symbol/TypeSystemClang.h"
14-
#include "lldb/Symbol/ClangASTImporter.h"
14+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1515
#include "lldb/Target/Target.h"
1616
#include "lldb/Utility/LLDBAssert.h"
1717
#include "lldb/Utility/Log.h"

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ add_lldb_library(lldbPluginExpressionParserClang PLUGIN
66
ASTResultSynthesizer.cpp
77
ASTStructExtractor.cpp
88
ASTUtils.cpp
9+
ClangASTImporter.cpp
10+
ClangASTMetadata.cpp
911
ClangASTSource.cpp
1012
ClangDeclVendor.cpp
1113
ClangExpressionDeclMap.cpp
1214
ClangExpressionParser.cpp
1315
ClangExpressionSourceCode.cpp
1416
ClangExpressionVariable.cpp
17+
ClangExternalASTSourceCallbacks.cpp
1518
ClangFunctionCaller.cpp
1619
ClangHost.cpp
1720
ClangModulesDeclVendor.cpp
1821
ClangPersistentVariables.cpp
1922
ClangUserExpression.cpp
23+
ClangUtil.cpp
2024
ClangUtilityFunction.cpp
2125
CppModuleConfiguration.cpp
26+
CxxModuleHandler.cpp
2227
IRForTarget.cpp
2328
IRDynamicChecks.cpp
2429

@@ -35,6 +40,8 @@ add_lldb_library(lldbPluginExpressionParserClang PLUGIN
3540
lldbUtility
3641
lldbPluginCPlusPlusLanguage
3742
lldbPluginCPPRuntime
43+
lldbPluginObjCRuntime
44+
lldbPluginTypeSystemClang
3845
CLANG_LIBS
3946
clangAST
4047
clangCodeGen

lldb/source/Symbol/ClangASTImporter.cpp renamed to lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "lldb/Symbol/ClangASTImporter.h"
109
#include "lldb/Core/Module.h"
11-
#include "lldb/Symbol/TypeSystemClang.h"
12-
#include "lldb/Symbol/ClangASTMetadata.h"
13-
#include "lldb/Symbol/ClangUtil.h"
1410
#include "lldb/Utility/LLDBAssert.h"
1511
#include "lldb/Utility/Log.h"
1612
#include "clang/AST/Decl.h"
@@ -20,6 +16,11 @@
2016
#include "clang/Sema/Sema.h"
2117
#include "llvm/Support/raw_ostream.h"
2218

19+
#include "Plugins/ExpressionParser/Clang/ClangASTImporter.h"
20+
#include "Plugins/ExpressionParser/Clang/ClangASTMetadata.h"
21+
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
22+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
23+
2324
#include <memory>
2425

2526
using namespace lldb_private;

lldb/include/lldb/Symbol/ClangASTImporter.h renamed to lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323

2424
#include "lldb/Host/FileSystem.h"
2525
#include "lldb/Symbol/CompilerDeclContext.h"
26-
#include "lldb/Symbol/CxxModuleHandler.h"
2726
#include "lldb/lldb-types.h"
2827

28+
#include "Plugins/ExpressionParser/Clang/CxxModuleHandler.h"
29+
2930
#include "llvm/ADT/DenseMap.h"
3031

3132
namespace lldb_private {

lldb/source/Symbol/ClangASTMetadata.cpp renamed to lldb/source/Plugins/ExpressionParser/Clang/ClangASTMetadata.cpp

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

9-
#include "lldb/Symbol/ClangASTMetadata.h"
9+
#include "Plugins/ExpressionParser/Clang/ClangASTMetadata.h"
1010
#include "lldb/Utility/Stream.h"
1111

1212
using namespace lldb_private;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#include "lldb/Core/Module.h"
1515
#include "lldb/Core/ModuleList.h"
16-
#include "lldb/Symbol/TypeSystemClang.h"
17-
#include "lldb/Symbol/ClangUtil.h"
1816
#include "lldb/Symbol/CompilerDeclContext.h"
1917
#include "lldb/Symbol/Function.h"
2018
#include "lldb/Symbol/SymbolFile.h"
@@ -24,7 +22,9 @@
2422
#include "clang/AST/ASTContext.h"
2523
#include "clang/AST/RecordLayout.h"
2624

25+
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
2726
#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
27+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
2828

2929
#include <memory>
3030
#include <vector>

lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <set>
1313

14-
#include "lldb/Symbol/ClangASTImporter.h"
14+
#include "Plugins/ExpressionParser/Clang/ClangASTImporter.h"
1515
#include "lldb/Symbol/CompilerType.h"
1616
#include "lldb/Target/Target.h"
1717
#include "clang/AST/ExternalASTSource.h"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "Plugins/ExpressionParser/Clang/ClangDeclVendor.h"
10+
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
11+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1012

11-
#include "lldb/Symbol/TypeSystemClang.h"
1213
#include "lldb/Utility/ConstString.h"
1314

1415
using namespace lldb_private;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
#include "ClangASTSource.h"
1212
#include "ClangModulesDeclVendor.h"
1313
#include "ClangPersistentVariables.h"
14+
#include "ClangUtil.h"
1415

16+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1517
#include "lldb/Core/Address.h"
1618
#include "lldb/Core/Module.h"
1719
#include "lldb/Core/ModuleSpec.h"
1820
#include "lldb/Core/ValueObjectConstResult.h"
1921
#include "lldb/Core/ValueObjectVariable.h"
2022
#include "lldb/Expression/Materializer.h"
21-
#include "lldb/Symbol/TypeSystemClang.h"
22-
#include "lldb/Symbol/ClangUtil.h"
2323
#include "lldb/Symbol/CompileUnit.h"
2424
#include "lldb/Symbol/CompilerDecl.h"
2525
#include "lldb/Symbol/CompilerDeclContext.h"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include "IRForTarget.h"
6868
#include "ModuleDependencyCollector.h"
6969

70+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
7071
#include "lldb/Core/Debugger.h"
7172
#include "lldb/Core/Disassembler.h"
7273
#include "lldb/Core/Module.h"
@@ -75,7 +76,6 @@
7576
#include "lldb/Expression/IRInterpreter.h"
7677
#include "lldb/Host/File.h"
7778
#include "lldb/Host/HostInfo.h"
78-
#include "lldb/Symbol/TypeSystemClang.h"
7979
#include "lldb/Symbol/SymbolVendor.h"
8080
#include "lldb/Target/ExecutionContext.h"
8181
#include "lldb/Target/Language.h"

lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp renamed to lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "lldb/Symbol/ClangExternalASTSourceCallbacks.h"
10-
#include "lldb/Symbol/TypeSystemClang.h"
9+
#include "Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.h"
10+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1111

1212
#include "clang/AST/Decl.h"
1313

lldb/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h renamed to lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef liblldb_ClangExternalASTSourceCallbacks_h_
1010
#define liblldb_ClangExternalASTSourceCallbacks_h_
1111

12-
#include "lldb/Symbol/TypeSystemClang.h"
12+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1313
#include "clang/AST/ExternalASTSource.h"
1414

1515
namespace lldb_private {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
#include "llvm/ExecutionEngine/ExecutionEngine.h"
2222
#include "llvm/IR/Module.h"
2323

24+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
2425
#include "lldb/Core/Module.h"
2526
#include "lldb/Core/ValueObject.h"
2627
#include "lldb/Core/ValueObjectList.h"
2728
#include "lldb/Expression/IRExecutionUnit.h"
2829
#include "lldb/Interpreter/CommandReturnObject.h"
29-
#include "lldb/Symbol/TypeSystemClang.h"
3030
#include "lldb/Symbol/Function.h"
3131
#include "lldb/Symbol/Type.h"
3232
#include "lldb/Target/ExecutionContext.h"

0 commit comments

Comments
 (0)