Skip to content

Commit 3361426

Browse files
committed
Adapt Swift plugin for upstream changes
1 parent 126b74c commit 3361426

File tree

9 files changed

+15
-21
lines changed

9 files changed

+15
-21
lines changed

lldb/include/lldb/Symbol/SymbolFile.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,6 @@ class SymbolFile : public PluginInterface {
239239
GetCompilerContextForUID(lldb::user_id_t uid) {
240240
return {};
241241
}
242-
virtual void
243-
GetDeclContextForUID(llvm::SmallVectorImpl<CompilerContext> &context,
244-
lldb::user_id_t uid) {}
245242
virtual uint32_t ResolveSymbolContext(const Address &so_addr,
246243
lldb::SymbolContextItem resolve_scope,
247244
SymbolContext &sc) = 0;

lldb/include/lldb/Symbol/Type.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ class Type : public std::enable_shared_from_this<Type>, public UserID {
175175

176176
const lldb_private::Declaration &GetDeclaration() const;
177177

178-
void GetDeclContext(
179-
llvm::SmallVectorImpl<lldb_private::CompilerContext> &context) const;
178+
std::vector<lldb_private::CompilerContext> GetDeclContext() const;
180179

181180
// Get the clang type, and resolve definitions for any
182181
// class/struct/union/enum types completely.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
using namespace lldb;
3838
using namespace lldb_private;
3939
using namespace lldb_private::dwarf;
40+
using namespace lldb_private::plugin::dwarf;
4041

4142
DWARFASTParserSwift::DWARFASTParserSwift(
4243
TypeSystemSwiftTypeRef &swift_typesystem)

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
#include "DWARFASTParser.h"
1717
#include "DWARFDIE.h"
1818

19-
class DWARFDebugInfoEntry;
20-
class DWARFDIECollection;
21-
2219
namespace lldb_private { class TypeSystemSwiftTypeRef; }
2320

24-
class DWARFASTParserSwift : public DWARFASTParser {
21+
class DWARFASTParserSwift : public lldb_private::plugin::dwarf::DWARFASTParser {
2522
public:
23+
using DWARFDIE = lldb_private::plugin::dwarf::DWARFDIE;
2624
DWARFASTParserSwift(lldb_private::TypeSystemSwiftTypeRef &swift_typesystem);
2725

2826
virtual ~DWARFASTParserSwift();

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ namespace llvm {
4545
class DWARFDebugAbbrev;
4646
} // namespace llvm
4747

48+
namespace lldb_private {
49+
class ClangASTImporter;
50+
class SwiftASTContext;
51+
}
52+
4853
namespace lldb_private::plugin {
4954
namespace dwarf {
5055
// Forward Declarations for this DWARF plugin
@@ -62,11 +67,6 @@ class SymbolFileDWARFDebugMap;
6267
class SymbolFileDWARFDwo;
6368
class SymbolFileDWARFDwp;
6469

65-
namespace lldb_private {
66-
class ClangASTImporter;
67-
class SwiftASTContext;
68-
}
69-
7070
#define DIE_IS_BEING_PARSED ((Type *)1)
7171

7272
class SymbolFileDWARF : public SymbolFileCommon {

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "UniqueDWARFASTType.h"
2222

2323
class DWARFASTParserClang;
24+
class DWARFASTParserSwift;
2425

2526
namespace lldb_private::plugin {
2627
namespace dwarf {

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8036,7 +8036,7 @@ void SwiftASTContext::DumpTypeDescription(opaque_compiler_type_t type,
80368036
s->Printf("<could not resolve type>");
80378037
}
80388038

8039-
DWARFASTParser *SwiftASTContext::GetDWARFParser() {
8039+
plugin::dwarf::DWARFASTParser *SwiftASTContext::GetDWARFParser() {
80408040
return GetTypeSystemSwiftTypeRef().GetDWARFParser();
80418041
}
80428042

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,7 @@ TypeSystemSwiftTypeRef::GetSwiftified(swift::Demangle::Demangler &dem,
930930
return node;
931931

932932
// Extract the toplevel Clang module name from the debug info.
933-
llvm::SmallVector<CompilerContext, 4> DeclCtx;
934-
clang_type->GetDeclContext(DeclCtx);
933+
std::vector<CompilerContext> DeclCtx = clang_type->GetDeclContext();
935934
StringRef toplevel_module;
936935
if (resolve_objc_module) {
937936
for (auto &Context : DeclCtx)
@@ -1592,7 +1591,7 @@ void TypeSystemSwiftTypeRef::DiagnoseWarnings(Process &process,
15921591
swift_ast_context->DiagnoseWarnings(process, module);
15931592
}
15941593

1595-
DWARFASTParser *TypeSystemSwiftTypeRef::GetDWARFParser() {
1594+
plugin::dwarf::DWARFASTParser *TypeSystemSwiftTypeRef::GetDWARFParser() {
15961595
if (!m_dwarf_ast_parser_up)
15971596
m_dwarf_ast_parser_up.reset(new DWARFASTParserSwift(*this));
15981597
return m_dwarf_ast_parser_up.get();

lldb/source/Symbol/Type.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,8 @@ uint32_t Type::GetEncodingMask() {
656656
return encoding_mask;
657657
}
658658

659-
void Type::GetDeclContext(
660-
llvm::SmallVectorImpl<lldb_private::CompilerContext> &context) const {
661-
m_symbol_file->GetDeclContextForUID(context, GetID());
659+
std::vector<lldb_private::CompilerContext> Type::GetDeclContext() const {
660+
return m_symbol_file->GetCompilerContextForUID(GetID());
662661
}
663662

664663
CompilerType Type::GetFullCompilerType() {

0 commit comments

Comments
 (0)