Make sure to run the test suite after these kinds of changes. You might be surprised.
On Thu, Mar 14, 2019 at 10:21 AM Davide Italiano via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: davide > Date: Thu Mar 14 10:23:08 2019 > New Revision: 356171 > > URL: http://llvm.org/viewvc/llvm-project?rev=356171&view=rev > Log: > [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. > > Modified: > lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h > lldb/trunk/include/lldb/DataFormatters/TypeCategory.h > lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h > lldb/trunk/source/DataFormatters/FormattersHelpers.cpp > lldb/trunk/source/DataFormatters/TypeCategory.cpp > lldb/trunk/source/DataFormatters/TypeSynthetic.cpp > lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp > > Modified: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=356171&r1=356170&r2=356171&view=diff > > ============================================================================== > --- lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h (original) > +++ lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h Thu Mar 14 > 10:23:08 2019 > @@ -36,7 +36,6 @@ void AddOneLineSummary(TypeCategoryImpl: > 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::SharedP > std::vector<std::string> children, const char *description, > ConstString type_name, ScriptedSyntheticChildren::Flags > flags, > bool regex = false); > -#endif > > size_t ExtractIndexFromString(const char *item_name); > > > Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategory.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=356171&r1=356170&r2=356171&view=diff > > ============================================================================== > --- lldb/trunk/include/lldb/DataFormatters/TypeCategory.h (original) > +++ lldb/trunk/include/lldb/DataFormatters/TypeCategory.h Thu Mar 14 > 10:23:08 2019 > @@ -68,10 +68,7 @@ private: > typedef FormatterContainerPair<TypeSummaryImpl> SummaryContainer; > typedef FormatterContainerPair<TypeFilterImpl> FilterContainer; > typedef FormatterContainerPair<TypeValidatorImpl> ValidatorContainer; > - > -#ifndef LLDB_DISABLE_PYTHON > typedef FormatterContainerPair<SyntheticChildren> 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 U = SyntheticChildren> > typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks > &>::type > SetExact(SynthContainer::ExactMatchForEachCallback callback) { > @@ -150,7 +145,6 @@ public: > m_synth_regex = callback; > return *this; > } > -#endif // LLDB_DISABLE_PYTHON > template <typename U = TypeValidatorImpl> > typename std::enable_if<std::is_same<U, T>::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<ConstString, TypeFilterImpl>; > friend class FormattersContainer<lldb::RegularExpressionSP, > TypeFilterImpl>; > > -#ifndef LLDB_DISABLE_PYTHON > friend class FormattersContainer<ConstString, > ScriptedSyntheticChildren>; > friend class FormattersContainer<lldb::RegularExpressionSP, > ScriptedSyntheticChildren>; > -#endif // LLDB_DISABLE_PYTHON > > friend class FormattersContainer<ConstString, TypeValidatorImpl>; > friend class FormattersContainer<lldb::RegularExpressionSP, > > Modified: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=356171&r1=356170&r2=356171&view=diff > > ============================================================================== > --- lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h (original) > +++ lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h Thu Mar 14 > 10:23:08 2019 > @@ -375,8 +375,6 @@ private: > DISALLOW_COPY_AND_ASSIGN(CXXSyntheticChildren); > }; > > -#ifndef LLDB_DISABLE_PYTHON > - > class ScriptedSyntheticChildren : public SyntheticChildren { > std::string m_python_class; > std::string m_python_code; > @@ -452,7 +450,6 @@ public: > private: > DISALLOW_COPY_AND_ASSIGN(ScriptedSyntheticChildren); > }; > -#endif > } // namespace lldb_private > > #endif // lldb_TypeSynthetic_h_ > > Modified: lldb/trunk/source/DataFormatters/FormattersHelpers.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormattersHelpers.cpp?rev=356171&r1=356170&r2=356171&view=diff > > ============================================================================== > --- lldb/trunk/source/DataFormatters/FormattersHelpers.cpp (original) > +++ lldb/trunk/source/DataFormatters/FormattersHelpers.cpp Thu Mar 14 > 10:23:08 2019 > @@ -73,7 +73,6 @@ void lldb_private::formatters::AddOneLin > category_sp->GetTypeSummariesContainer()->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) > > Modified: lldb/trunk/source/DataFormatters/TypeCategory.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategory.cpp?rev=356171&r1=356170&r2=356171&view=diff > > ============================================================================== > --- lldb/trunk/source/DataFormatters/TypeCategory.cpp (original) > +++ lldb/trunk/source/DataFormatters/TypeCategory.cpp Thu Mar 14 10:23:08 > 2019 > @@ -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) > > Modified: lldb/trunk/source/DataFormatters/TypeSynthetic.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSynthetic.cpp?rev=356171&r1=356170&r2=356171&view=diff > > ============================================================================== > --- lldb/trunk/source/DataFormatters/TypeSynthetic.cpp (original) > +++ lldb/trunk/source/DataFormatters/TypeSynthetic.cpp Thu Mar 14 10:23:08 > 2019 > @@ -125,8 +125,6 @@ lldb::ValueObjectSP SyntheticChildrenFro > 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::G > > return sstr.GetString(); > } > - > -#endif // #ifndef LLDB_DISABLE_PYTHON > > Modified: > lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=356171&r1=356170&r2=356171&view=diff > > ============================================================================== > --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp > (original) > +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Thu > Mar 14 10:23:08 2019 > @@ -418,7 +418,6 @@ static void LoadLibCxxFormatters(lldb::T > .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::T > "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 > "std::char_traits<wchar_t>, std::allocator<wchar_t> >"), > 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 > "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::T > .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* (<rdar://problem/12717717>) > AddCXXSummary( > @@ -919,7 +913,6 @@ static void LoadSystemFormatters(lldb::T > AddCXXSummary( > cpp_category_sp, lldb_private::formatters::Char16SummaryProvider, > "unichar summary provider", ConstString("unichar"), widechar_flags); > -#endif > } > > std::unique_ptr<Language::TypeScavenger> > CPlusPlusLanguage::GetTypeScavenger() { > > > _______________________________________________ > lldb-commits mailing list > lldb-commits@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits >
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits