Skip to content

Commit 006268a

Browse files
authored
Merge pull request #2191 from apple/lldb-Implement-TypeSystemSwiftTypeRef-IsMeaninglessWithoutDynamicResolution
[lldb] Implement TypeSystemSwiftTypeRef::IsMeaninglessWithoutDynamicResolution
2 parents 2919e1a + af41e99 commit 006268a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,8 @@ bool TypeSystemSwiftTypeRef::IsFunctionType(opaque_compiler_type_t type,
16741674
using namespace swift::Demangle;
16751675
Demangler dem;
16761676
NodePointer node = DemangleCanonicalType(dem, type);
1677+
// Note: There are a number of other candidates, and this list may need
1678+
// updating. Ex: `NoEscapeFunctionType`, `ThinFunctionType`, etc.
16771679
return node && (node->getKind() == Node::Kind::FunctionType ||
16781680
node->getKind() == Node::Kind::ImplFunctionType);
16791681
};
@@ -2306,8 +2308,14 @@ TypeSystemSwiftTypeRef::ShouldPrintAsOneLiner(opaque_compiler_type_t type,
23062308
}
23072309
bool TypeSystemSwiftTypeRef::IsMeaninglessWithoutDynamicResolution(
23082310
opaque_compiler_type_t type) {
2309-
return m_swift_ast_context->IsMeaninglessWithoutDynamicResolution(
2310-
ReconstructType(type));
2311+
auto impl = [&]() {
2312+
using namespace swift::Demangle;
2313+
Demangler dem;
2314+
auto *node = DemangleCanonicalType(dem, type);
2315+
return ContainsGenericTypeParameter(node) && !IsFunctionType(type, nullptr);
2316+
};
2317+
VALIDATE_AND_RETURN(impl, IsMeaninglessWithoutDynamicResolution, type,
2318+
(ReconstructType(type)));
23112319
}
23122320

23132321
CompilerType TypeSystemSwiftTypeRef::GetAsClangTypeOrNull(

0 commit comments

Comments
 (0)