summaryrefslogtreecommitdiffstats
path: root/lldb/include
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-12-10 13:22:03 -0800
committerAdrian Prantl <aprantl@apple.com>2019-12-10 16:11:10 -0800
commitb3801de7c50faa2b730e62e1cfabeec8c5cebae2 (patch)
tree8ae2140b5ef6b31d93b45a96b9d0cc5f6863011b /lldb/include
parent636c93ed11a5f98b5c3ff88241460d61cb7785bb (diff)
downloadbcm5719-llvm-b3801de7c50faa2b730e62e1cfabeec8c5cebae2.tar.gz
bcm5719-llvm-b3801de7c50faa2b730e62e1cfabeec8c5cebae2.zip
Replace redundant code in LanguageCategory with templates (NFC)
Differential Revision: https://reviews.llvm.org/D71296
Diffstat (limited to 'lldb/include')
-rw-r--r--lldb/include/lldb/DataFormatters/LanguageCategory.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/lldb/include/lldb/DataFormatters/LanguageCategory.h b/lldb/include/lldb/DataFormatters/LanguageCategory.h
index f109d46194a..c6604ec80fa 100644
--- a/lldb/include/lldb/DataFormatters/LanguageCategory.h
+++ b/lldb/include/lldb/DataFormatters/LanguageCategory.h
@@ -25,27 +25,11 @@ public:
LanguageCategory(lldb::LanguageType lang_type);
- bool Get(FormattersMatchData &match_data, lldb::TypeFormatImplSP &format_sp);
-
- bool Get(FormattersMatchData &match_data, lldb::TypeSummaryImplSP &format_sp);
-
- bool Get(FormattersMatchData &match_data,
- lldb::SyntheticChildrenSP &format_sp);
-
- bool Get(FormattersMatchData &match_data,
- lldb::TypeValidatorImplSP &format_sp);
-
- bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
- lldb::TypeFormatImplSP &format_sp);
-
+ template <typename ImplSP>
+ bool Get(FormattersMatchData &match_data, ImplSP &format_sp);
+ template <typename ImplSP>
bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
- lldb::TypeSummaryImplSP &format_sp);
-
- bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
- lldb::SyntheticChildrenSP &format_sp);
-
- bool GetHardcoded(FormatManager &fmt_mgr, FormattersMatchData &match_data,
- lldb::TypeValidatorImplSP &format_sp);
+ ImplSP &format_sp);
lldb::TypeCategoryImplSP GetCategory() const;
@@ -65,6 +49,9 @@ private:
HardcodedFormatters::HardcodedSyntheticFinder m_hardcoded_synthetics;
HardcodedFormatters::HardcodedValidatorFinder m_hardcoded_validators;
+ template <typename ImplSP>
+ auto &GetHardcodedFinder();
+
lldb_private::FormatCache m_format_cache;
bool m_enabled;
OpenPOWER on IntegriCloud