Skip to content

Commit 2823e28

Browse files
committed
[lldb][Swift] Adjust GetEncoding API to upstream changes
The count parameter was removed in llvm#165702
1 parent aebc282 commit 2823e28

File tree

4 files changed

+9
-23
lines changed

4 files changed

+9
-23
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6775,11 +6775,9 @@ SwiftASTContext::GetTypeBitAlign(opaque_compiler_type_t type,
67756775
return {};
67766776
}
67776777

6778-
lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
6779-
uint64_t &count) {
6778+
lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type) {
67806779
VALID_OR_RETURN_CHECK_TYPE(type, lldb::eEncodingInvalid);
67816780

6782-
count = 1;
67836781
swift::CanType swift_can_type(GetCanonicalSwiftType(type));
67846782

67856783
const swift::TypeKind type_kind = swift_can_type->getKind();
@@ -6842,7 +6840,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
68426840
case swift::TypeKind::UnownedStorage:
68436841
case swift::TypeKind::WeakStorage:
68446842
return ToCompilerType(swift_can_type->getReferenceStorageReferent())
6845-
.GetEncoding(count);
6843+
.GetEncoding();
68466844
break;
68476845

68486846
case swift::TypeKind::ExistentialMetatype:
@@ -6877,7 +6875,6 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
68776875
assert(false && "Not a canonical type");
68786876
break;
68796877
}
6880-
count = 0;
68816878
return lldb::eEncodingInvalid;
68826879
}
68836880

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,7 @@ class SwiftASTContext : public TypeSystemSwift {
727727
GetByteStride(lldb::opaque_compiler_type_t type,
728728
ExecutionContextScope *exe_scope) override;
729729

730-
lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type,
731-
uint64_t &count) override;
730+
lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type) override;
732731

733732
llvm::Expected<uint32_t>
734733
GetNumChildren(lldb::opaque_compiler_type_t type,

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

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4016,14 +4016,12 @@ TypeSystemSwiftTypeRef::GetByteStride(opaque_compiler_type_t type,
40164016
(ReconstructType(type, exe_scope), exe_scope));
40174017
}
40184018

4019-
lldb::Encoding TypeSystemSwiftTypeRef::GetEncoding(opaque_compiler_type_t type,
4020-
uint64_t &count) {
4019+
lldb::Encoding
4020+
TypeSystemSwiftTypeRef::GetEncoding(opaque_compiler_type_t type) {
40214021
auto impl = [&]() -> lldb::Encoding {
40224022
if (!type)
40234023
return lldb::eEncodingInvalid;
40244024

4025-
count = 1;
4026-
40274025
using namespace swift::Demangle;
40284026
Demangler dem;
40294027
auto *node = DemangleCanonicalOutermostType(dem, type);
@@ -4045,13 +4043,10 @@ lldb::Encoding TypeSystemSwiftTypeRef::GetEncoding(opaque_compiler_type_t type,
40454043
node->getText() == swift::BUILTIN_TYPE_NAME_BRIDGEOBJECT ||
40464044
node->getText() == swift::BUILTIN_TYPE_NAME_RAWUNSAFECONTINUATION)
40474045
return lldb::eEncodingUint;
4048-
if (node->getText().starts_with(swift::BUILTIN_TYPE_NAME_VEC)) {
4049-
count = 0;
4046+
if (node->getText().starts_with(swift::BUILTIN_TYPE_NAME_VEC))
40504047
return lldb::eEncodingInvalid;
4051-
}
40524048

40534049
assert(false && "Unhandled builtin");
4054-
count = 0;
40554050
return lldb::eEncodingInvalid;
40564051
}
40574052

@@ -4077,23 +4072,19 @@ lldb::Encoding TypeSystemSwiftTypeRef::GetEncoding(opaque_compiler_type_t type,
40774072
const auto *mangled_name = AsMangledName(type);
40784073
auto flavor = SwiftLanguageRuntime::GetManglingFlavor(mangled_name);
40794074
auto referent_type = RemangleAsType(dem, referent_node, flavor);
4080-
return referent_type.GetEncoding(count);
4075+
return referent_type.GetEncoding();
40814076
}
40824077
default:
40834078
LLDB_LOGF(GetLog(LLDBLog::Types), "No encoding for type %s",
40844079
AsMangledName(type));
40854080
break;
40864081
}
40874082

4088-
count = 0;
40894083
return lldb::eEncodingInvalid;
40904084
};
40914085

4092-
#ifndef NDEBUG
4093-
uint64_t validation_count = 0;
4094-
#endif
40954086
VALIDATE_AND_RETURN(impl, GetEncoding, type, g_no_exe_ctx,
4096-
(ReconstructType(type), validation_count));
4087+
(ReconstructType(type)));
40974088
}
40984089

40994090
llvm::Expected<uint32_t>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,7 @@ class TypeSystemSwiftTypeRef : public TypeSystemSwift {
215215
std::optional<uint64_t>
216216
GetByteStride(lldb::opaque_compiler_type_t type,
217217
ExecutionContextScope *exe_scope) override;
218-
lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type,
219-
uint64_t &count) override;
218+
lldb::Encoding GetEncoding(lldb::opaque_compiler_type_t type) override;
220219
llvm::Expected<uint32_t>
221220
GetNumChildren(lldb::opaque_compiler_type_t type,
222221
bool omit_empty_base_classes,

0 commit comments

Comments
 (0)