Skip to content

Commit fc24aff

Browse files
authored
Merge pull request #3467 from augusto2112/tsstyperef-forwarding-functions
[lldb] Add message to functions not worth implementing in tss-typeref
2 parents c89e744 + 860affe commit fc24aff

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,13 +2262,21 @@ TypeSystemSwiftTypeRef::GetFunctionReturnType(opaque_compiler_type_t type) {
22622262
}
22632263
size_t
22642264
TypeSystemSwiftTypeRef::GetNumMemberFunctions(opaque_compiler_type_t type) {
2265+
// We forward the call to SwiftASTContext because an implementation of
2266+
// this function would require it to have an execution context being passed
2267+
// in. Given the purpose of TypeSystemSwiftTypeRef, it's unlikely this
2268+
// function will be called much.
22652269
if (auto *swift_ast_context = GetSwiftASTContext())
22662270
return swift_ast_context->GetNumMemberFunctions(ReconstructType(type));
22672271
return {};
22682272
}
22692273
TypeMemberFunctionImpl
22702274
TypeSystemSwiftTypeRef::GetMemberFunctionAtIndex(opaque_compiler_type_t type,
22712275
size_t idx) {
2276+
// We forward the call to SwiftASTContext because an implementation of
2277+
// this function would require it to have an execution context being passed
2278+
// in. Given the purpose of TypeSystemSwiftTypeRef, it's unlikely this
2279+
// function will be called much.
22722280
if (auto *swift_ast_context = GetSwiftASTContext())
22732281
return swift_ast_context->GetMemberFunctionAtIndex(ReconstructType(type),
22742282
idx);
@@ -2564,6 +2572,10 @@ CompilerType TypeSystemSwiftTypeRef::GetFieldAtIndex(
25642572
opaque_compiler_type_t type, size_t idx, std::string &name,
25652573
uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr,
25662574
bool *is_bitfield_ptr) {
2575+
// We forward the call to SwiftASTContext because an implementation of
2576+
// this function would require it to have an execution context being passed
2577+
// in. Given the purpose of TypeSystemSwiftTypeRef, it's unlikely this
2578+
// function will be called much.
25672579
LLDB_SCOPED_TIMER();
25682580
if (auto *swift_ast_context = GetSwiftASTContext())
25692581
return swift_ast_context->GetFieldAtIndex(
@@ -3528,12 +3540,20 @@ TypeSystemSwiftTypeRef::GetFullyUnqualifiedType(opaque_compiler_type_t type) {
35283540
}
35293541
uint32_t
35303542
TypeSystemSwiftTypeRef::GetNumDirectBaseClasses(opaque_compiler_type_t type) {
3543+
// We forward the call to SwiftASTContext because an implementation of
3544+
// this function would require it to have an execution context being passed
3545+
// in. Given the purpose of TypeSystemSwiftTypeRef, it's unlikely this
3546+
// function will be called much.
35313547
if (auto *swift_ast_context = GetSwiftASTContext())
35323548
return swift_ast_context->GetNumDirectBaseClasses(ReconstructType(type));
35333549
return {};
35343550
}
35353551
CompilerType TypeSystemSwiftTypeRef::GetDirectBaseClassAtIndex(
35363552
opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr) {
3553+
// We forward the call to SwiftASTContext because an implementation of
3554+
// this function would require it to have an execution context being passed
3555+
// in. Given the purpose of TypeSystemSwiftTypeRef, it's unlikely this
3556+
// function will be called much.
35373557
if (auto *swift_ast_context = GetSwiftASTContext())
35383558
return swift_ast_context->GetDirectBaseClassAtIndex(ReconstructType(type),
35393559
idx, bit_offset_ptr);

0 commit comments

Comments
 (0)