diff options
| author | Enrico Granata <egranata@apple.com> | 2015-10-27 01:17:28 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2015-10-27 01:17:28 +0000 |
| commit | e7cbaf3e0e49ef487c38df5ec74b0c50c666e7fe (patch) | |
| tree | 446adf81c7972aeb951311e4431c0f7a22718a1a /lldb/source/API | |
| parent | 9e9cf54eb2e0f27d10d8d00f1427da507e508d43 (diff) | |
| download | bcm5719-llvm-e7cbaf3e0e49ef487c38df5ec74b0c50c666e7fe.tar.gz bcm5719-llvm-e7cbaf3e0e49ef487c38df5ec74b0c50c666e7fe.zip | |
Minor cleanup of SBTypeSummary::CreateWithCallback to take an optional description argument
llvm-svn: 251377
Diffstat (limited to 'lldb/source/API')
| -rw-r--r-- | lldb/source/API/SBTypeSummary.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lldb/source/API/SBTypeSummary.cpp b/lldb/source/API/SBTypeSummary.cpp index 6abedc0750e..7c06bdafbf8 100644 --- a/lldb/source/API/SBTypeSummary.cpp +++ b/lldb/source/API/SBTypeSummary.cpp @@ -147,22 +147,25 @@ SBTypeSummary::CreateWithScriptCode (const char* data, uint32_t options) } SBTypeSummary -SBTypeSummary::CreateWithCallback (FormatCallback cb, uint32_t options) -{ - return SBTypeSummary( - TypeSummaryImplSP( - cb ? new CXXFunctionSummaryFormat(options, - [cb] (ValueObject& valobj, Stream& stm, const TypeSummaryOptions& opt) -> bool { - SBStream stream; - if (!cb(SBValue(valobj.GetSP()), SBTypeSummaryOptions(&opt), stream)) - return false; - stm.Write(stream.GetData(), stream.GetSize()); - return true; - }, - "SBTypeSummary formatter callback" - ) : nullptr - ) - ); +SBTypeSummary::CreateWithCallback (FormatCallback cb, uint32_t options, const char* description) +{ + SBTypeSummary retval; + if (cb) + { + retval.SetSP(TypeSummaryImplSP(new CXXFunctionSummaryFormat(options, + [cb] (ValueObject& valobj, Stream& stm, const TypeSummaryOptions& opt) -> bool { + SBStream stream; + SBValue sb_value(valobj.GetSP()); + SBTypeSummaryOptions options(&opt); + if (!cb(sb_value, options, stream)) + return false; + stm.Write(stream.GetData(), stream.GetSize()); + return true; + }, + description ? description : "callback summary formatter"))); + } + + return retval; } SBTypeSummary::SBTypeSummary (const lldb::SBTypeSummary &rhs) : |

