Skip to content

Commit 558fee5

Browse files
authored
Merge pull request #2199 from apple/lldb-Implement-TypeSystemSwiftTypeRef-IsMeaninglessWithoutDynamicResolution-next
[lldb] Implement TypeSystemSwiftTypeRef::IsMeaninglessWithoutDynamicResolution
2 parents 0ab2163 + 9ab334b commit 558fee5

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
};
@@ -2305,8 +2307,14 @@ TypeSystemSwiftTypeRef::ShouldPrintAsOneLiner(opaque_compiler_type_t type,
23052307
}
23062308
bool TypeSystemSwiftTypeRef::IsMeaninglessWithoutDynamicResolution(
23072309
opaque_compiler_type_t type) {
2308-
return m_swift_ast_context->IsMeaninglessWithoutDynamicResolution(
2309-
ReconstructType(type));
2310+
auto impl = [&]() {
2311+
using namespace swift::Demangle;
2312+
Demangler dem;
2313+
auto *node = DemangleCanonicalType(dem, type);
2314+
return ContainsGenericTypeParameter(node) && !IsFunctionType(type, nullptr);
2315+
};
2316+
VALIDATE_AND_RETURN(impl, IsMeaninglessWithoutDynamicResolution, type,
2317+
(ReconstructType(type)));
23102318
}
23112319

23122320
CompilerType TypeSystemSwiftTypeRef::GetAsClangTypeOrNull(

0 commit comments

Comments
 (0)