From f6a84ed30b2839a67ffdbf3771d4610d305669d5 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Thu, 14 Mar 2019 17:23:08 +0000 Subject: [PATCH] [Python] Start eradicating unneeded LLDB_DISABLE_PYTHON guards. While we don't have a bot, I'm testing by hand that this configuration compiles. We'll probably set up one once I'm done flensing. llvm-svn: 356171 --- .../lldb/DataFormatters/FormattersHelpers.h | 2 -- .../lldb/DataFormatters/TypeCategory.h | 22 +------------------ .../lldb/DataFormatters/TypeSynthetic.h | 3 --- .../DataFormatters/FormattersHelpers.cpp | 2 -- lldb/source/DataFormatters/TypeCategory.cpp | 2 -- lldb/source/DataFormatters/TypeSynthetic.cpp | 4 ---- .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 7 ------ 7 files changed, 1 insertion(+), 41 deletions(-) diff --git a/lldb/include/lldb/DataFormatters/FormattersHelpers.h b/lldb/include/lldb/DataFormatters/FormattersHelpers.h index 35f1f946c3c8..79bd376c76eb 100644 --- a/lldb/include/lldb/DataFormatters/FormattersHelpers.h +++ b/lldb/include/lldb/DataFormatters/FormattersHelpers.h @@ -36,7 +36,6 @@ void AddOneLineSummary(TypeCategoryImpl::SharedPointer category_sp, ConstString type_name, TypeSummaryImpl::Flags flags, bool regex = false); -#ifndef LLDB_DISABLE_PYTHON void AddCXXSummary(TypeCategoryImpl::SharedPointer category_sp, CXXFunctionSummaryFormat::Callback funct, const char *description, ConstString type_name, @@ -52,7 +51,6 @@ void AddFilter(TypeCategoryImpl::SharedPointer category_sp, std::vector children, const char *description, ConstString type_name, ScriptedSyntheticChildren::Flags flags, bool regex = false); -#endif size_t ExtractIndexFromString(const char *item_name); diff --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h index 431af32feb8d..bdb393abd848 100644 --- a/lldb/include/lldb/DataFormatters/TypeCategory.h +++ b/lldb/include/lldb/DataFormatters/TypeCategory.h @@ -68,10 +68,7 @@ private: typedef FormatterContainerPair SummaryContainer; typedef FormatterContainerPair FilterContainer; typedef FormatterContainerPair ValidatorContainer; - -#ifndef LLDB_DISABLE_PYTHON typedef FormatterContainerPair SynthContainer; -#endif // LLDB_DISABLE_PYTHON public: typedef uint16_t FormatCategoryItems; @@ -85,10 +82,9 @@ public: typedef FilterContainer::ExactMatchContainerSP FilterContainerSP; typedef FilterContainer::RegexMatchContainerSP RegexFilterContainerSP; -#ifndef LLDB_DISABLE_PYTHON + typedef SynthContainer::ExactMatchContainerSP SynthContainerSP; typedef SynthContainer::RegexMatchContainerSP RegexSynthContainerSP; -#endif // LLDB_DISABLE_PYTHON typedef ValidatorContainer::ExactMatchContainerSP ValidatorContainerSP; typedef ValidatorContainer::RegexMatchContainerSP RegexValidatorContainerSP; @@ -137,7 +133,6 @@ public: return *this; } -#ifndef LLDB_DISABLE_PYTHON template typename std::enable_if::value, ForEachCallbacks &>::type SetExact(SynthContainer::ExactMatchForEachCallback callback) { @@ -150,7 +145,6 @@ public: m_synth_regex = callback; return *this; } -#endif // LLDB_DISABLE_PYTHON template typename std::enable_if::value, ForEachCallbacks &>::type SetExact(ValidatorContainer::ExactMatchForEachCallback callback) { @@ -187,14 +181,12 @@ public: return m_filter_regex; } -#ifndef LLDB_DISABLE_PYTHON SynthContainer::ExactMatchForEachCallback GetSynthExactCallback() const { return m_synth_exact; } SynthContainer::RegexMatchForEachCallback GetSynthRegexCallback() const { return m_synth_regex; } -#endif // LLDB_DISABLE_PYTHON ValidatorContainer::ExactMatchForEachCallback GetValidatorExactCallback() const { @@ -215,10 +207,8 @@ public: FilterContainer::ExactMatchForEachCallback m_filter_exact; FilterContainer::RegexMatchForEachCallback m_filter_regex; -#ifndef LLDB_DISABLE_PYTHON SynthContainer::ExactMatchForEachCallback m_synth_exact; SynthContainer::RegexMatchForEachCallback m_synth_regex; -#endif // LLDB_DISABLE_PYTHON ValidatorContainer::ExactMatchForEachCallback m_validator_exact; ValidatorContainer::RegexMatchForEachCallback m_validator_regex; @@ -238,10 +228,8 @@ public: GetTypeFiltersContainer()->ForEach(foreach.GetFilterExactCallback()); GetRegexTypeFiltersContainer()->ForEach(foreach.GetFilterRegexCallback()); -#ifndef LLDB_DISABLE_PYTHON GetTypeSyntheticsContainer()->ForEach(foreach.GetSynthExactCallback()); GetRegexTypeSyntheticsContainer()->ForEach(foreach.GetSynthRegexCallback()); -#endif // LLDB_DISABLE_PYTHON GetTypeValidatorsContainer()->ForEach(foreach.GetValidatorExactCallback()); GetRegexTypeValidatorsContainer()->ForEach( @@ -287,10 +275,8 @@ public: FilterContainer::MapValueType GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp); -#ifndef LLDB_DISABLE_PYTHON SynthContainer::MapValueType GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp); -#endif ValidatorContainer::MapValueType GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp); @@ -310,7 +296,6 @@ public: lldb::TypeNameSpecifierImplSP GetTypeNameSpecifierForFilterAtIndex(size_t index); -#ifndef LLDB_DISABLE_PYTHON SynthContainerSP GetTypeSyntheticsContainer() { return m_synth_cont.GetExactMatch(); } @@ -325,7 +310,6 @@ public: lldb::TypeNameSpecifierImplSP GetTypeNameSpecifierForSyntheticAtIndex(size_t index); -#endif // LLDB_DISABLE_PYTHON ValidatorContainerSP GetTypeValidatorsContainer() { return m_validator_cont.GetExactMatch(); @@ -391,9 +375,7 @@ private: FormatContainer m_format_cont; SummaryContainer m_summary_cont; FilterContainer m_filter_cont; -#ifndef LLDB_DISABLE_PYTHON SynthContainer m_synth_cont; -#endif // LLDB_DISABLE_PYTHON ValidatorContainer m_validator_cont; bool m_enabled; @@ -431,11 +413,9 @@ private: friend class FormattersContainer; friend class FormattersContainer; -#ifndef LLDB_DISABLE_PYTHON friend class FormattersContainer; friend class FormattersContainer; -#endif // LLDB_DISABLE_PYTHON friend class FormattersContainer; friend class FormattersContainerGetTypeSummariesContainer()->Add(type_name, summary_sp); } -#ifndef LLDB_DISABLE_PYTHON void lldb_private::formatters::AddCXXSummary( TypeCategoryImpl::SharedPointer category_sp, CXXFunctionSummaryFormat::Callback funct, const char *description, @@ -117,7 +116,6 @@ void lldb_private::formatters::AddFilter( else category_sp->GetTypeFiltersContainer()->Add(type_name, filter_sp); } -#endif size_t lldb_private::formatters::ExtractIndexFromString(const char *item_name) { if (!item_name || !*item_name) diff --git a/lldb/source/DataFormatters/TypeCategory.cpp b/lldb/source/DataFormatters/TypeCategory.cpp index 4dd487450cd1..8ed0ccd35771 100644 --- a/lldb/source/DataFormatters/TypeCategory.cpp +++ b/lldb/source/DataFormatters/TypeCategory.cpp @@ -19,9 +19,7 @@ TypeCategoryImpl::TypeCategoryImpl( : m_format_cont("format", "regex-format", clist), m_summary_cont("summary", "regex-summary", clist), m_filter_cont("filter", "regex-filter", clist), -#ifndef LLDB_DISABLE_PYTHON m_synth_cont("synth", "regex-synth", clist), -#endif m_validator_cont("validator", "regex-validator", clist), m_enabled(false), m_change_listener(clist), m_mutex(), m_name(name), m_languages() { for (const lldb::LanguageType lang : langs) diff --git a/lldb/source/DataFormatters/TypeSynthetic.cpp b/lldb/source/DataFormatters/TypeSynthetic.cpp index ccc5d198b226..89ebd919727f 100644 --- a/lldb/source/DataFormatters/TypeSynthetic.cpp +++ b/lldb/source/DataFormatters/TypeSynthetic.cpp @@ -125,8 +125,6 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromData( return valobj_sp; } -#ifndef LLDB_DISABLE_PYTHON - ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass, ValueObject &backend) : SyntheticChildrenFrontEnd(backend), m_python_class(pclass), @@ -218,5 +216,3 @@ std::string ScriptedSyntheticChildren::GetDescription() { return sstr.GetString(); } - -#endif // #ifndef LLDB_DISABLE_PYTHON diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 2e451f444259..32562451c8cb 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -418,7 +418,6 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { .SetShowMembersOneLiner(false) .SetHideItemNames(false); -#ifndef LLDB_DISABLE_PYTHON AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxStringSummaryProviderASCII, "std::string summary provider", @@ -680,7 +679,6 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "std::map iterator synthetic children", ConstString("^std::__[[:alnum:]]+::__map_iterator<.+>$"), stl_synth_flags, true); -#endif } static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { @@ -751,8 +749,6 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "std::char_traits, std::allocator >"), cxx11_wstring_summary_sp); -#ifndef LLDB_DISABLE_PYTHON - SyntheticChildren::Flags stl_synth_flags; stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences( false); @@ -841,7 +837,6 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { "libstdc++ std::weak_ptr summary provider", ConstString("^std::weak_ptr<.+>(( )?&)?$"), stl_summary_flags, true); -#endif } static void LoadSystemFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { @@ -866,7 +861,6 @@ static void LoadSystemFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { .SetShowMembersOneLiner(false) .SetHideItemNames(false); -#ifndef LLDB_DISABLE_PYTHON // FIXME because of a bug in the FormattersContainer we need to add a summary // for both X* and const X* () AddCXXSummary( @@ -919,7 +913,6 @@ static void LoadSystemFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { AddCXXSummary( cpp_category_sp, lldb_private::formatters::Char16SummaryProvider, "unichar summary provider", ConstString("unichar"), widechar_flags); -#endif } std::unique_ptr CPlusPlusLanguage::GetTypeScavenger() {