diff options
author | Enrico Granata <egranata@apple.com> | 2015-11-09 21:28:55 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2015-11-09 21:28:55 +0000 |
commit | 6500061e928aa4027a506a041d7d94166eefc501 (patch) | |
tree | dae721e209b0c5509932428725e76c397a510ea6 /lldb/source/DataFormatters/FormatManager.cpp | |
parent | 32538d68117772c93c059a35523ea974397a8c56 (diff) | |
download | bcm5719-llvm-6500061e928aa4027a506a041d7d94166eefc501.tar.gz bcm5719-llvm-6500061e928aa4027a506a041d7d94166eefc501.zip |
Extend the TypeSystem's ShouldPrintAsOneLiner implementation so that the ValueObject itself also gets a say in the process; NFC
llvm-svn: 252516
Diffstat (limited to 'lldb/source/DataFormatters/FormatManager.cpp')
-rw-r--r-- | lldb/source/DataFormatters/FormatManager.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 12838931f2b..2362ba52526 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -568,7 +568,7 @@ FormatManager::ShouldPrintAsOneLiner (ValueObject& valobj) CompilerType compiler_type(valobj.GetCompilerType()); if (compiler_type.IsValid()) { - switch (compiler_type.ShouldPrintAsOneLiner()) + switch (compiler_type.ShouldPrintAsOneLiner(&valobj)) { case eLazyBoolNo: return false; @@ -590,6 +590,23 @@ FormatManager::ShouldPrintAsOneLiner (ValueObject& valobj) // something is wrong here - bail out if (!child_sp) return false; + + // also ask the child's type if it has any opinion + CompilerType child_compiler_type(child_sp->GetCompilerType()); + if (child_compiler_type.IsValid()) + { + switch (child_compiler_type.ShouldPrintAsOneLiner(child_sp.get())) + { + case eLazyBoolYes: + // an opinion of yes is only binding for the child, so keep going + case eLazyBoolCalculate: + break; + case eLazyBoolNo: + // but if the child says no, then it's a veto on the whole thing + return false; + } + } + // if we decided to define synthetic children for a type, we probably care enough // to show them, but avoid nesting children in children if (child_sp->GetSyntheticChildren().get() != nullptr) |