Skip to content

Commit 134eb0b

Browse files
authored
Merge pull request #2235 from apple/lldb-Implement-TypeSystemSwiftTypeRef-ShouldPrintAsOneLiner-next
[lldb] Implement TypeSystemSwiftTypeRef::ShouldPrintAsOneLiner
2 parents 57f5088 + fc95b68 commit 134eb0b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,12 +2324,29 @@ CompilerType
23242324
TypeSystemSwiftTypeRef::GetTypeForFormatters(opaque_compiler_type_t type) {
23252325
return m_swift_ast_context->GetTypeForFormatters(ReconstructType(type));
23262326
}
2327+
23272328
LazyBool
23282329
TypeSystemSwiftTypeRef::ShouldPrintAsOneLiner(opaque_compiler_type_t type,
23292330
ValueObject *valobj) {
2330-
return m_swift_ast_context->ShouldPrintAsOneLiner(ReconstructType(type),
2331-
valobj);
2331+
auto impl = [&]() {
2332+
if (type) {
2333+
if (IsImportedType(type, nullptr))
2334+
return eLazyBoolNo;
2335+
}
2336+
if (valobj) {
2337+
if (valobj->IsBaseClass())
2338+
return eLazyBoolNo;
2339+
if ((valobj->GetLanguageFlags() & LanguageFlags::eIsIndirectEnumCase) ==
2340+
LanguageFlags::eIsIndirectEnumCase)
2341+
return eLazyBoolNo;
2342+
}
2343+
2344+
return eLazyBoolCalculate;
2345+
};
2346+
VALIDATE_AND_RETURN(impl, ShouldPrintAsOneLiner, type,
2347+
(ReconstructType(type), valobj));
23322348
}
2349+
23332350
bool TypeSystemSwiftTypeRef::IsMeaninglessWithoutDynamicResolution(
23342351
opaque_compiler_type_t type) {
23352352
auto impl = [&]() {

0 commit comments

Comments
 (0)