Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a01bdfb

Browse files
authored
Merge pull request swiftlang#2231 from apple/lldb-Implement-TypeSystemSwiftTypeRef-ShouldPrintAsOneLiner
[lldb] Implement TypeSystemSwiftTypeRef::ShouldPrintAsOneLiner
2 parents b7c73a4 + afd92b3 commit a01bdfb

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

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

+19-2
Original file line numberDiff line numberDiff line change
@@ -2327,12 +2327,29 @@ CompilerType
23272327
TypeSystemSwiftTypeRef::GetTypeForFormatters(opaque_compiler_type_t type) {
23282328
return m_swift_ast_context->GetTypeForFormatters(ReconstructType(type));
23292329
}
2330+
23302331
LazyBool
23312332
TypeSystemSwiftTypeRef::ShouldPrintAsOneLiner(opaque_compiler_type_t type,
23322333
ValueObject *valobj) {
2333-
return m_swift_ast_context->ShouldPrintAsOneLiner(ReconstructType(type),
2334-
valobj);
2334+
auto impl = [&]() {
2335+
if (type) {
2336+
if (IsImportedType(type, nullptr))
2337+
return eLazyBoolNo;
2338+
}
2339+
if (valobj) {
2340+
if (valobj->IsBaseClass())
2341+
return eLazyBoolNo;
2342+
if ((valobj->GetLanguageFlags() & LanguageFlags::eIsIndirectEnumCase) ==
2343+
LanguageFlags::eIsIndirectEnumCase)
2344+
return eLazyBoolNo;
2345+
}
2346+
2347+
return eLazyBoolCalculate;
2348+
};
2349+
VALIDATE_AND_RETURN(impl, ShouldPrintAsOneLiner, type,
2350+
(ReconstructType(type), valobj));
23352351
}
2352+
23362353
bool TypeSystemSwiftTypeRef::IsMeaninglessWithoutDynamicResolution(
23372354
opaque_compiler_type_t type) {
23382355
auto impl = [&]() {

0 commit comments

Comments
 (0)