[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
This commit is contained in:
Davide Italiano 2019-03-14 17:23:08 +00:00
parent 70d156991c
commit f6a84ed30b
7 changed files with 1 additions and 41 deletions

View File

@ -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<std::string> children, const char *description,
ConstString type_name, ScriptedSyntheticChildren::Flags flags,
bool regex = false);
#endif
size_t ExtractIndexFromString(const char *item_name);

View File

@ -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,

View File

@ -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_

View File

@ -73,7 +73,6 @@ void lldb_private::formatters::AddOneLineSummary(
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)

View File

@ -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)

View File

@ -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

View File

@ -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<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::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* (<rdar://problem/12717717>)
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<Language::TypeScavenger> CPlusPlusLanguage::GetTypeScavenger() {