<div dir="ltr">Make sure to run the test suite after these kinds of changes. You might be surprised.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 14, 2019 at 10:21 AM Davide Italiano via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davide<br>
Date: Thu Mar 14 10:23:08 2019<br>
New Revision: 356171<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=356171&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=356171&view=rev</a><br>
Log:<br>
[Python] Start eradicating unneeded LLDB_DISABLE_PYTHON guards.<br>
<br>
While we don't have a bot, I'm testing by hand that this configuration<br>
compiles. We'll probably set up one once I'm done flensing.<br>
<br>
Modified:<br>
lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h<br>
lldb/trunk/include/lldb/DataFormatters/TypeCategory.h<br>
lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h<br>
lldb/trunk/source/DataFormatters/FormattersHelpers.cpp<br>
lldb/trunk/source/DataFormatters/TypeCategory.cpp<br>
lldb/trunk/source/DataFormatters/TypeSynthetic.cpp<br>
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp<br>
<br>
Modified: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=356171&r1=356170&r2=356171&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=356171&r1=356170&r2=356171&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h (original)<br>
+++ lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h Thu Mar 14 10:23:08 2019<br>
@@ -36,7 +36,6 @@ void AddOneLineSummary(TypeCategoryImpl:<br>
ConstString type_name, TypeSummaryImpl::Flags flags,<br>
bool regex = false);<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
void AddCXXSummary(TypeCategoryImpl::SharedPointer category_sp,<br>
CXXFunctionSummaryFormat::Callback funct,<br>
const char *description, ConstString type_name,<br>
@@ -52,7 +51,6 @@ void AddFilter(TypeCategoryImpl::SharedP<br>
std::vector<std::string> children, const char *description,<br>
ConstString type_name, ScriptedSyntheticChildren::Flags flags,<br>
bool regex = false);<br>
-#endif<br>
<br>
size_t ExtractIndexFromString(const char *item_name);<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategory.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=356171&r1=356170&r2=356171&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=356171&r1=356170&r2=356171&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/DataFormatters/TypeCategory.h (original)<br>
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategory.h Thu Mar 14 10:23:08 2019<br>
@@ -68,10 +68,7 @@ private:<br>
typedef FormatterContainerPair<TypeSummaryImpl> SummaryContainer;<br>
typedef FormatterContainerPair<TypeFilterImpl> FilterContainer;<br>
typedef FormatterContainerPair<TypeValidatorImpl> ValidatorContainer;<br>
-<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
typedef FormatterContainerPair<SyntheticChildren> SynthContainer;<br>
-#endif // LLDB_DISABLE_PYTHON<br>
<br>
public:<br>
typedef uint16_t FormatCategoryItems;<br>
@@ -85,10 +82,9 @@ public:<br>
<br>
typedef FilterContainer::ExactMatchContainerSP FilterContainerSP;<br>
typedef FilterContainer::RegexMatchContainerSP RegexFilterContainerSP;<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
+<br>
typedef SynthContainer::ExactMatchContainerSP SynthContainerSP;<br>
typedef SynthContainer::RegexMatchContainerSP RegexSynthContainerSP;<br>
-#endif // LLDB_DISABLE_PYTHON<br>
<br>
typedef ValidatorContainer::ExactMatchContainerSP ValidatorContainerSP;<br>
typedef ValidatorContainer::RegexMatchContainerSP RegexValidatorContainerSP;<br>
@@ -137,7 +133,6 @@ public:<br>
return *this;<br>
}<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
template <typename U = SyntheticChildren><br>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type<br>
SetExact(SynthContainer::ExactMatchForEachCallback callback) {<br>
@@ -150,7 +145,6 @@ public:<br>
m_synth_regex = callback;<br>
return *this;<br>
}<br>
-#endif // LLDB_DISABLE_PYTHON<br>
template <typename U = TypeValidatorImpl><br>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type<br>
SetExact(ValidatorContainer::ExactMatchForEachCallback callback) {<br>
@@ -187,14 +181,12 @@ public:<br>
return m_filter_regex;<br>
}<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
SynthContainer::ExactMatchForEachCallback GetSynthExactCallback() const {<br>
return m_synth_exact;<br>
}<br>
SynthContainer::RegexMatchForEachCallback GetSynthRegexCallback() const {<br>
return m_synth_regex;<br>
}<br>
-#endif // LLDB_DISABLE_PYTHON<br>
<br>
ValidatorContainer::ExactMatchForEachCallback<br>
GetValidatorExactCallback() const {<br>
@@ -215,10 +207,8 @@ public:<br>
FilterContainer::ExactMatchForEachCallback m_filter_exact;<br>
FilterContainer::RegexMatchForEachCallback m_filter_regex;<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
SynthContainer::ExactMatchForEachCallback m_synth_exact;<br>
SynthContainer::RegexMatchForEachCallback m_synth_regex;<br>
-#endif // LLDB_DISABLE_PYTHON<br>
<br>
ValidatorContainer::ExactMatchForEachCallback m_validator_exact;<br>
ValidatorContainer::RegexMatchForEachCallback m_validator_regex;<br>
@@ -238,10 +228,8 @@ public:<br>
GetTypeFiltersContainer()->ForEach(foreach.GetFilterExactCallback());<br>
GetRegexTypeFiltersContainer()->ForEach(foreach.GetFilterRegexCallback());<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
GetTypeSyntheticsContainer()->ForEach(foreach.GetSynthExactCallback());<br>
GetRegexTypeSyntheticsContainer()->ForEach(foreach.GetSynthRegexCallback());<br>
-#endif // LLDB_DISABLE_PYTHON<br>
<br>
GetTypeValidatorsContainer()->ForEach(foreach.GetValidatorExactCallback());<br>
GetRegexTypeValidatorsContainer()->ForEach(<br>
@@ -287,10 +275,8 @@ public:<br>
FilterContainer::MapValueType<br>
GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp);<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
SynthContainer::MapValueType<br>
GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp);<br>
-#endif<br>
<br>
ValidatorContainer::MapValueType<br>
GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp);<br>
@@ -310,7 +296,6 @@ public:<br>
lldb::TypeNameSpecifierImplSP<br>
GetTypeNameSpecifierForFilterAtIndex(size_t index);<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
SynthContainerSP GetTypeSyntheticsContainer() {<br>
return m_synth_cont.GetExactMatch();<br>
}<br>
@@ -325,7 +310,6 @@ public:<br>
<br>
lldb::TypeNameSpecifierImplSP<br>
GetTypeNameSpecifierForSyntheticAtIndex(size_t index);<br>
-#endif // LLDB_DISABLE_PYTHON<br>
<br>
ValidatorContainerSP GetTypeValidatorsContainer() {<br>
return m_validator_cont.GetExactMatch();<br>
@@ -391,9 +375,7 @@ private:<br>
FormatContainer m_format_cont;<br>
SummaryContainer m_summary_cont;<br>
FilterContainer m_filter_cont;<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
SynthContainer m_synth_cont;<br>
-#endif // LLDB_DISABLE_PYTHON<br>
ValidatorContainer m_validator_cont;<br>
<br>
bool m_enabled;<br>
@@ -431,11 +413,9 @@ private:<br>
friend class FormattersContainer<ConstString, TypeFilterImpl>;<br>
friend class FormattersContainer<lldb::RegularExpressionSP, TypeFilterImpl>;<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
friend class FormattersContainer<ConstString, ScriptedSyntheticChildren>;<br>
friend class FormattersContainer<lldb::RegularExpressionSP,<br>
ScriptedSyntheticChildren>;<br>
-#endif // LLDB_DISABLE_PYTHON<br>
<br>
friend class FormattersContainer<ConstString, TypeValidatorImpl>;<br>
friend class FormattersContainer<lldb::RegularExpressionSP,<br>
<br>
Modified: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=356171&r1=356170&r2=356171&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=356171&r1=356170&r2=356171&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h (original)<br>
+++ lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h Thu Mar 14 10:23:08 2019<br>
@@ -375,8 +375,6 @@ private:<br>
DISALLOW_COPY_AND_ASSIGN(CXXSyntheticChildren);<br>
};<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
-<br>
class ScriptedSyntheticChildren : public SyntheticChildren {<br>
std::string m_python_class;<br>
std::string m_python_code;<br>
@@ -452,7 +450,6 @@ public:<br>
private:<br>
DISALLOW_COPY_AND_ASSIGN(ScriptedSyntheticChildren);<br>
};<br>
-#endif<br>
} // namespace lldb_private<br>
<br>
#endif // lldb_TypeSynthetic_h_<br>
<br>
Modified: lldb/trunk/source/DataFormatters/FormattersHelpers.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormattersHelpers.cpp?rev=356171&r1=356170&r2=356171&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormattersHelpers.cpp?rev=356171&r1=356170&r2=356171&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/DataFormatters/FormattersHelpers.cpp (original)<br>
+++ lldb/trunk/source/DataFormatters/FormattersHelpers.cpp Thu Mar 14 10:23:08 2019<br>
@@ -73,7 +73,6 @@ void lldb_private::formatters::AddOneLin<br>
category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);<br>
}<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
void lldb_private::formatters::AddCXXSummary(<br>
TypeCategoryImpl::SharedPointer category_sp,<br>
CXXFunctionSummaryFormat::Callback funct, const char *description,<br>
@@ -117,7 +116,6 @@ void lldb_private::formatters::AddFilter<br>
else<br>
category_sp->GetTypeFiltersContainer()->Add(type_name, filter_sp);<br>
}<br>
-#endif<br>
<br>
size_t lldb_private::formatters::ExtractIndexFromString(const char *item_name) {<br>
if (!item_name || !*item_name)<br>
<br>
Modified: lldb/trunk/source/DataFormatters/TypeCategory.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategory.cpp?rev=356171&r1=356170&r2=356171&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategory.cpp?rev=356171&r1=356170&r2=356171&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/DataFormatters/TypeCategory.cpp (original)<br>
+++ lldb/trunk/source/DataFormatters/TypeCategory.cpp Thu Mar 14 10:23:08 2019<br>
@@ -19,9 +19,7 @@ TypeCategoryImpl::TypeCategoryImpl(<br>
: m_format_cont("format", "regex-format", clist),<br>
m_summary_cont("summary", "regex-summary", clist),<br>
m_filter_cont("filter", "regex-filter", clist),<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
m_synth_cont("synth", "regex-synth", clist),<br>
-#endif<br>
m_validator_cont("validator", "regex-validator", clist), m_enabled(false),<br>
m_change_listener(clist), m_mutex(), m_name(name), m_languages() {<br>
for (const lldb::LanguageType lang : langs)<br>
<br>
Modified: lldb/trunk/source/DataFormatters/TypeSynthetic.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSynthetic.cpp?rev=356171&r1=356170&r2=356171&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSynthetic.cpp?rev=356171&r1=356170&r2=356171&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/DataFormatters/TypeSynthetic.cpp (original)<br>
+++ lldb/trunk/source/DataFormatters/TypeSynthetic.cpp Thu Mar 14 10:23:08 2019<br>
@@ -125,8 +125,6 @@ lldb::ValueObjectSP SyntheticChildrenFro<br>
return valobj_sp;<br>
}<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
-<br>
ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass,<br>
ValueObject &backend)<br>
: SyntheticChildrenFrontEnd(backend), m_python_class(pclass),<br>
@@ -218,5 +216,3 @@ std::string ScriptedSyntheticChildren::G<br>
<br>
return sstr.GetString();<br>
}<br>
-<br>
-#endif // #ifndef LLDB_DISABLE_PYTHON<br>
<br>
Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=356171&r1=356170&r2=356171&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=356171&r1=356170&r2=356171&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Thu Mar 14 10:23:08 2019<br>
@@ -418,7 +418,6 @@ static void LoadLibCxxFormatters(lldb::T<br>
.SetShowMembersOneLiner(false)<br>
.SetHideItemNames(false);<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
AddCXXSummary(cpp_category_sp,<br>
lldb_private::formatters::LibcxxStringSummaryProviderASCII,<br>
"std::string summary provider",<br>
@@ -680,7 +679,6 @@ static void LoadLibCxxFormatters(lldb::T<br>
"std::map iterator synthetic children",<br>
ConstString("^std::__[[:alnum:]]+::__map_iterator<.+>$"), stl_synth_flags,<br>
true);<br>
-#endif<br>
}<br>
<br>
static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {<br>
@@ -751,8 +749,6 @@ static void LoadLibStdcppFormatters(lldb<br>
"std::char_traits<wchar_t>, std::allocator<wchar_t> >"),<br>
cxx11_wstring_summary_sp);<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
-<br>
SyntheticChildren::Flags stl_synth_flags;<br>
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(<br>
false);<br>
@@ -841,7 +837,6 @@ static void LoadLibStdcppFormatters(lldb<br>
"libstdc++ std::weak_ptr summary provider",<br>
ConstString("^std::weak_ptr<.+>(( )?&)?$"), stl_summary_flags,<br>
true);<br>
-#endif<br>
}<br>
<br>
static void LoadSystemFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {<br>
@@ -866,7 +861,6 @@ static void LoadSystemFormatters(lldb::T<br>
.SetShowMembersOneLiner(false)<br>
.SetHideItemNames(false);<br>
<br>
-#ifndef LLDB_DISABLE_PYTHON<br>
// FIXME because of a bug in the FormattersContainer we need to add a summary<br>
// for both X* and const X* (<rdar://problem/12717717>)<br>
AddCXXSummary(<br>
@@ -919,7 +913,6 @@ static void LoadSystemFormatters(lldb::T<br>
AddCXXSummary(<br>
cpp_category_sp, lldb_private::formatters::Char16SummaryProvider,<br>
"unichar summary provider", ConstString("unichar"), widechar_flags);<br>
-#endif<br>
}<br>
<br>
std::unique_ptr<Language::TypeScavenger> CPlusPlusLanguage::GetTypeScavenger() {<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>