diff options
Diffstat (limited to 'lldb/include')
| -rw-r--r-- | lldb/include/lldb/API/SBValue.h | 2 | ||||
| -rw-r--r-- | lldb/include/lldb/Core/ValueObject.h | 17 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/DataVisualization.h | 6 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/FormatCache.h | 6 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/FormatClasses.h | 2 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/FormatManager.h | 6 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/FormattersContainer.h | 1 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/LanguageCategory.h | 1 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/TypeCategory.h | 55 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/TypeValidator.h | 201 | ||||
| -rw-r--r-- | lldb/include/lldb/DataFormatters/ValueObjectPrinter.h | 7 | ||||
| -rw-r--r-- | lldb/include/lldb/Target/Language.h | 3 | ||||
| -rw-r--r-- | lldb/include/lldb/lldb-forward.h | 2 |
13 files changed, 0 insertions, 309 deletions
diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index c36ba20297f..5f8d17f8642 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -75,8 +75,6 @@ public: const char *GetObjectDescription(); - const char *GetTypeValidatorResult(); - lldb::SBValue GetDynamicValue(lldb::DynamicValueType use_dynamic); lldb::SBValue GetStaticValue(); diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index 3ad17364fd8..1b000e617f0 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -179,7 +179,6 @@ public: eClearUserVisibleDataItemsLocation = 1u << 3, eClearUserVisibleDataItemsDescription = 1u << 4, eClearUserVisibleDataItemsSyntheticChildren = 1u << 5, - eClearUserVisibleDataItemsValidator = 1u << 6, eClearUserVisibleDataItemsAllStrings = eClearUserVisibleDataItemsValue | eClearUserVisibleDataItemsSummary | eClearUserVisibleDataItemsLocation | @@ -510,8 +509,6 @@ public: std::string &destination, const TypeSummaryOptions &options); - std::pair<TypeValidatorResult, std::string> GetValidationStatus(); - const char *GetObjectDescription(); bool HasSpecialPrintableRepresentation( @@ -711,16 +708,6 @@ public: ClearUserVisibleData(eClearUserVisibleDataItemsSummary); } - lldb::TypeValidatorImplSP GetValidator() { - UpdateFormatsIfNeeded(); - return m_type_validator_sp; - } - - void SetValidator(lldb::TypeValidatorImplSP format) { - m_type_validator_sp = format; - ClearUserVisibleData(eClearUserVisibleDataItemsValidator); - } - void SetValueFormat(lldb::TypeFormatImplSP format) { m_type_format_sp = format; ClearUserVisibleData(eClearUserVisibleDataItemsValue); @@ -857,9 +844,6 @@ protected: // differs from the summary // in that the summary is consed up by us, the object_desc_string is builtin. - llvm::Optional<std::pair<TypeValidatorResult, std::string>> - m_validation_result; - CompilerType m_override_type; // If the type of the value object should be // overridden, the type to impose. @@ -888,7 +872,6 @@ protected: lldb::TypeSummaryImplSP m_type_summary_sp; lldb::TypeFormatImplSP m_type_format_sp; lldb::SyntheticChildrenSP m_synthetic_children_sp; - lldb::TypeValidatorImplSP m_type_validator_sp; ProcessModID m_user_id_of_forced_summary; AddressType m_address_type_of_ptr_or_ref_children; diff --git a/lldb/include/lldb/DataFormatters/DataVisualization.h b/lldb/include/lldb/DataFormatters/DataVisualization.h index cdb2eab995f..f5c3487bcb3 100644 --- a/lldb/include/lldb/DataFormatters/DataVisualization.h +++ b/lldb/include/lldb/DataFormatters/DataVisualization.h @@ -51,12 +51,6 @@ public: static lldb::SyntheticChildrenSP GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic); - static lldb::TypeValidatorImplSP - GetValidator(ValueObject &valobj, lldb::DynamicValueType use_dynamic); - - static lldb::TypeValidatorImplSP - GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp); - static bool AnyMatches(ConstString type_name, TypeCategoryImpl::FormatCategoryItems items = diff --git a/lldb/include/lldb/DataFormatters/FormatCache.h b/lldb/include/lldb/DataFormatters/FormatCache.h index e8be01e55d4..f9dbe414640 100644 --- a/lldb/include/lldb/DataFormatters/FormatCache.h +++ b/lldb/include/lldb/DataFormatters/FormatCache.h @@ -24,12 +24,10 @@ private: bool m_format_cached : 1; bool m_summary_cached : 1; bool m_synthetic_cached : 1; - bool m_validator_cached : 1; lldb::TypeFormatImplSP m_format_sp; lldb::TypeSummaryImplSP m_summary_sp; lldb::SyntheticChildrenSP m_synthetic_sp; - lldb::TypeValidatorImplSP m_validator_sp; public: Entry(); @@ -38,17 +36,14 @@ private: bool IsFormatCached(); bool IsSummaryCached(); bool IsSyntheticCached(); - bool IsValidatorCached(); void Get(lldb::TypeFormatImplSP &); void Get(lldb::TypeSummaryImplSP &); void Get(lldb::SyntheticChildrenSP &); - void Get(lldb::TypeValidatorImplSP &); void Set(lldb::TypeFormatImplSP); void Set(lldb::TypeSummaryImplSP); void Set(lldb::SyntheticChildrenSP); - void Set(lldb::TypeValidatorImplSP); }; typedef std::map<ConstString, Entry> CacheMap; CacheMap m_map; @@ -66,7 +61,6 @@ public: void Set(ConstString type, lldb::TypeFormatImplSP &format_sp); void Set(ConstString type, lldb::TypeSummaryImplSP &summary_sp); void Set(ConstString type, lldb::SyntheticChildrenSP &synthetic_sp); - void Set(ConstString type, lldb::TypeValidatorImplSP &synthetic_sp); void Clear(); diff --git a/lldb/include/lldb/DataFormatters/FormatClasses.h b/lldb/include/lldb/DataFormatters/FormatClasses.h index 5144bc6079a..91ce444244c 100644 --- a/lldb/include/lldb/DataFormatters/FormatClasses.h +++ b/lldb/include/lldb/DataFormatters/FormatClasses.h @@ -17,7 +17,6 @@ #include "lldb/DataFormatters/TypeFormat.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" -#include "lldb/DataFormatters/TypeValidator.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/Type.h" #include "lldb/lldb-enumerations.h" @@ -40,7 +39,6 @@ public: typedef HardcodedFormatterFinders<TypeFormatImpl> HardcodedFormatFinder; typedef HardcodedFormatterFinders<TypeSummaryImpl> HardcodedSummaryFinder; typedef HardcodedFormatterFinders<SyntheticChildren> HardcodedSyntheticFinder; - typedef HardcodedFormatterFinders<TypeValidatorImpl> HardcodedValidatorFinder; }; class FormattersMatchCandidate { diff --git a/lldb/include/lldb/DataFormatters/FormatManager.h b/lldb/include/lldb/DataFormatters/FormatManager.h index c57b8c8c64a..dd522c487c8 100644 --- a/lldb/include/lldb/DataFormatters/FormatManager.h +++ b/lldb/include/lldb/DataFormatters/FormatManager.h @@ -118,9 +118,6 @@ public: lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp); - lldb::TypeValidatorImplSP - GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp); - lldb::TypeFormatImplSP GetFormat(ValueObject &valobj, lldb::DynamicValueType use_dynamic); @@ -130,9 +127,6 @@ public: lldb::SyntheticChildrenSP GetSyntheticChildren(ValueObject &valobj, lldb::DynamicValueType use_dynamic); - lldb::TypeValidatorImplSP GetValidator(ValueObject &valobj, - lldb::DynamicValueType use_dynamic); - bool AnyMatches(ConstString type_name, TypeCategoryImpl::FormatCategoryItems items = diff --git a/lldb/include/lldb/DataFormatters/FormattersContainer.h b/lldb/include/lldb/DataFormatters/FormattersContainer.h index de2edb10315..86023dd9bf0 100644 --- a/lldb/include/lldb/DataFormatters/FormattersContainer.h +++ b/lldb/include/lldb/DataFormatters/FormattersContainer.h @@ -22,7 +22,6 @@ #include "lldb/DataFormatters/TypeFormat.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" -#include "lldb/DataFormatters/TypeValidator.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/StringLexer.h" diff --git a/lldb/include/lldb/DataFormatters/LanguageCategory.h b/lldb/include/lldb/DataFormatters/LanguageCategory.h index c6604ec80fa..1cffff91c19 100644 --- a/lldb/include/lldb/DataFormatters/LanguageCategory.h +++ b/lldb/include/lldb/DataFormatters/LanguageCategory.h @@ -47,7 +47,6 @@ private: HardcodedFormatters::HardcodedFormatFinder m_hardcoded_formats; HardcodedFormatters::HardcodedSummaryFinder m_hardcoded_summaries; HardcodedFormatters::HardcodedSyntheticFinder m_hardcoded_synthetics; - HardcodedFormatters::HardcodedValidatorFinder m_hardcoded_validators; template <typename ImplSP> auto &GetHardcodedFinder(); diff --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h index 513e859815f..d5aab6dc3a5 100644 --- a/lldb/include/lldb/DataFormatters/TypeCategory.h +++ b/lldb/include/lldb/DataFormatters/TypeCategory.h @@ -67,7 +67,6 @@ private: typedef FormatterContainerPair<TypeFormatImpl> FormatContainer; typedef FormatterContainerPair<TypeSummaryImpl> SummaryContainer; typedef FormatterContainerPair<TypeFilterImpl> FilterContainer; - typedef FormatterContainerPair<TypeValidatorImpl> ValidatorContainer; typedef FormatterContainerPair<SyntheticChildren> SynthContainer; public: @@ -86,9 +85,6 @@ public: typedef SynthContainer::ExactMatchContainerSP SynthContainerSP; typedef SynthContainer::RegexMatchContainerSP RegexSynthContainerSP; - typedef ValidatorContainer::ExactMatchContainerSP ValidatorContainerSP; - typedef ValidatorContainer::RegexMatchContainerSP RegexValidatorContainerSP; - template <typename T> class ForEachCallbacks { public: ForEachCallbacks() = default; @@ -145,18 +141,6 @@ public: m_synth_regex = callback; return *this; } - template <typename U = TypeValidatorImpl> - typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type - SetExact(ValidatorContainer::ExactMatchForEachCallback callback) { - m_validator_exact = callback; - return *this; - } - template <typename U = TypeValidatorImpl> - typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type - SetWithRegex(ValidatorContainer::RegexMatchForEachCallback callback) { - m_validator_regex = callback; - return *this; - } FormatContainer::ExactMatchForEachCallback GetFormatExactCallback() const { return m_format_exact; @@ -188,15 +172,6 @@ public: return m_synth_regex; } - ValidatorContainer::ExactMatchForEachCallback - GetValidatorExactCallback() const { - return m_validator_exact; - } - ValidatorContainer::RegexMatchForEachCallback - GetValidatorRegexCallback() const { - return m_validator_regex; - } - private: FormatContainer::ExactMatchForEachCallback m_format_exact; FormatContainer::RegexMatchForEachCallback m_format_regex; @@ -209,9 +184,6 @@ public: SynthContainer::ExactMatchForEachCallback m_synth_exact; SynthContainer::RegexMatchForEachCallback m_synth_regex; - - ValidatorContainer::ExactMatchForEachCallback m_validator_exact; - ValidatorContainer::RegexMatchForEachCallback m_validator_regex; }; TypeCategoryImpl(IFormatChangeListener *clist, ConstString name); @@ -229,10 +201,6 @@ public: GetTypeSyntheticsContainer()->ForEach(foreach.GetSynthExactCallback()); GetRegexTypeSyntheticsContainer()->ForEach(foreach.GetSynthRegexCallback()); - - GetTypeValidatorsContainer()->ForEach(foreach.GetValidatorExactCallback()); - GetRegexTypeValidatorsContainer()->ForEach( - foreach.GetValidatorRegexCallback()); } FormatContainerSP GetTypeFormatsContainer() { @@ -277,9 +245,6 @@ public: SynthContainer::MapValueType GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp); - ValidatorContainer::MapValueType - GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp); - lldb::TypeNameSpecifierImplSP GetTypeNameSpecifierForFormatAtIndex(size_t index); @@ -310,19 +275,6 @@ public: lldb::TypeNameSpecifierImplSP GetTypeNameSpecifierForSyntheticAtIndex(size_t index); - ValidatorContainerSP GetTypeValidatorsContainer() { - return m_validator_cont.GetExactMatch(); - } - - RegexValidatorContainerSP GetRegexTypeValidatorsContainer() { - return m_validator_cont.GetRegexMatch(); - } - - ValidatorContainer::MapValueType GetValidatorAtIndex(size_t index); - - lldb::TypeNameSpecifierImplSP - GetTypeNameSpecifierForValidatorAtIndex(size_t index); - bool IsEnabled() const { return m_enabled; } uint32_t GetEnabledPosition() { @@ -341,9 +293,6 @@ public: bool Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, lldb::SyntheticChildrenSP &entry, uint32_t *reason = nullptr); - bool Get(lldb::LanguageType lang, const FormattersMatchVector &candidates, - lldb::TypeValidatorImplSP &entry, uint32_t *reason = nullptr); - void Clear(FormatCategoryItems items = ALL_ITEM_TYPES); bool Delete(ConstString name, FormatCategoryItems items = ALL_ITEM_TYPES); @@ -373,7 +322,6 @@ private: SummaryContainer m_summary_cont; FilterContainer m_filter_cont; SynthContainer m_synth_cont; - ValidatorContainer m_validator_cont; bool m_enabled; @@ -414,9 +362,6 @@ private: friend class FormattersContainer<lldb::RegularExpressionSP, ScriptedSyntheticChildren>; - friend class FormattersContainer<ConstString, TypeValidatorImpl>; - friend class FormattersContainer<lldb::RegularExpressionSP, - TypeValidatorImpl>; }; } // namespace lldb_private diff --git a/lldb/include/lldb/DataFormatters/TypeValidator.h b/lldb/include/lldb/DataFormatters/TypeValidator.h deleted file mode 100644 index 531812eeb05..00000000000 --- a/lldb/include/lldb/DataFormatters/TypeValidator.h +++ /dev/null @@ -1,201 +0,0 @@ -//===-- TypeValidator.h ------------------------------------------*- C++ -//-*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef lldb_TypeValidator_h_ -#define lldb_TypeValidator_h_ - - -#include <functional> -#include <string> - - -#include "lldb/lldb-enumerations.h" -#include "lldb/lldb-private-enumerations.h" -#include "lldb/lldb-public.h" - -namespace lldb_private { - -class TypeValidatorImpl { -public: - class Flags { - public: - Flags() : m_flags(lldb::eTypeOptionCascade) {} - - Flags(const Flags &other) : m_flags(other.m_flags) {} - - Flags(uint32_t value) : m_flags(value) {} - - Flags &operator=(const Flags &rhs) { - if (&rhs != this) - m_flags = rhs.m_flags; - - return *this; - } - - Flags &operator=(const uint32_t &rhs) { - m_flags = rhs; - return *this; - } - - Flags &Clear() { - m_flags = 0; - return *this; - } - - bool GetCascades() const { - return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade; - } - - Flags &SetCascades(bool value = true) { - if (value) - m_flags |= lldb::eTypeOptionCascade; - else - m_flags &= ~lldb::eTypeOptionCascade; - return *this; - } - - bool GetSkipPointers() const { - return (m_flags & lldb::eTypeOptionSkipPointers) == - lldb::eTypeOptionSkipPointers; - } - - Flags &SetSkipPointers(bool value = true) { - if (value) - m_flags |= lldb::eTypeOptionSkipPointers; - else - m_flags &= ~lldb::eTypeOptionSkipPointers; - return *this; - } - - bool GetSkipReferences() const { - return (m_flags & lldb::eTypeOptionSkipReferences) == - lldb::eTypeOptionSkipReferences; - } - - Flags &SetSkipReferences(bool value = true) { - if (value) - m_flags |= lldb::eTypeOptionSkipReferences; - else - m_flags &= ~lldb::eTypeOptionSkipReferences; - return *this; - } - - bool GetNonCacheable() const { - return (m_flags & lldb::eTypeOptionNonCacheable) == - lldb::eTypeOptionNonCacheable; - } - - Flags &SetNonCacheable(bool value = true) { - if (value) - m_flags |= lldb::eTypeOptionNonCacheable; - else - m_flags &= ~lldb::eTypeOptionNonCacheable; - return *this; - } - - uint32_t GetValue() { return m_flags; } - - void SetValue(uint32_t value) { m_flags = value; } - - private: - uint32_t m_flags; - }; - - TypeValidatorImpl(const Flags &flags = Flags()); - - typedef std::shared_ptr<TypeValidatorImpl> SharedPointer; - - virtual ~TypeValidatorImpl(); - - bool Cascades() const { return m_flags.GetCascades(); } - bool SkipsPointers() const { return m_flags.GetSkipPointers(); } - bool SkipsReferences() const { return m_flags.GetSkipReferences(); } - bool NonCacheable() const { return m_flags.GetNonCacheable(); } - - void SetCascades(bool value) { m_flags.SetCascades(value); } - - void SetSkipsPointers(bool value) { m_flags.SetSkipPointers(value); } - - void SetSkipsReferences(bool value) { m_flags.SetSkipReferences(value); } - - void SetNonCacheable(bool value) { m_flags.SetNonCacheable(value); } - - uint32_t GetOptions() { return m_flags.GetValue(); } - - void SetOptions(uint32_t value) { m_flags.SetValue(value); } - - uint32_t &GetRevision() { return m_my_revision; } - - enum class Type { eTypeUnknown, eTypeCXX }; - - struct ValidationResult { - TypeValidatorResult m_result; - std::string m_message; - }; - - virtual Type GetType() { return Type::eTypeUnknown; } - - // we are using a ValueObject* instead of a ValueObjectSP because we do not - // need to hold on to this for extended periods of time and we trust the - // ValueObject to stay around for as long as it is required for us to - // generate its value - virtual ValidationResult FormatObject(ValueObject *valobj) const = 0; - - virtual std::string GetDescription() = 0; - - static ValidationResult Success(); - - static ValidationResult Failure(std::string message); - -protected: - Flags m_flags; - uint32_t m_my_revision; - -private: - DISALLOW_COPY_AND_ASSIGN(TypeValidatorImpl); -}; - -class TypeValidatorImpl_CXX : public TypeValidatorImpl { -public: - typedef std::function<TypeValidatorImpl::ValidationResult( - ValueObject *valobj)> - ValidatorFunction; - - TypeValidatorImpl_CXX(ValidatorFunction f, std::string d, - const TypeValidatorImpl::Flags &flags = Flags()); - - typedef std::shared_ptr<TypeValidatorImpl_CXX> SharedPointer; - - ~TypeValidatorImpl_CXX() override; - - ValidatorFunction GetValidatorFunction() const { - return m_validator_function; - } - - void SetValidatorFunction(ValidatorFunction f) { m_validator_function = f; } - - TypeValidatorImpl::Type GetType() override { - return TypeValidatorImpl::Type::eTypeCXX; - } - - ValidationResult FormatObject(ValueObject *valobj) const override; - - std::string GetDescription() override; - -protected: - std::string m_description; - ValidatorFunction m_validator_function; - -private: - DISALLOW_COPY_AND_ASSIGN(TypeValidatorImpl_CXX); -}; - -} // namespace lldb_private - -#endif // lldb_TypeValidator_h_ diff --git a/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h b/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h index 41adc2d2b5b..33813b38701 100644 --- a/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h +++ b/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h @@ -62,8 +62,6 @@ protected: bool ShouldPrintValueObject(); - bool ShouldPrintValidation(); - bool IsNil(); bool IsUninitialized(); @@ -76,10 +74,6 @@ protected: bool IsAggregate(); - bool PrintValidationMarkerIfNeeded(); - - bool PrintValidationErrorIfNeeded(); - bool PrintLocationIfNeeded(); void PrintDecl(); @@ -145,7 +139,6 @@ private: std::string m_summary; std::string m_error; bool m_val_summary_ok; - std::pair<TypeValidatorResult, std::string> m_validation; friend struct StringSummaryFormat; diff --git a/lldb/include/lldb/Target/Language.h b/lldb/include/lldb/Target/Language.h index b49e96eeac1..e00b042ac25 100644 --- a/lldb/include/lldb/Target/Language.h +++ b/lldb/include/lldb/Target/Language.h @@ -176,9 +176,6 @@ public: virtual HardcodedFormatters::HardcodedSyntheticFinder GetHardcodedSynthetics(); - virtual HardcodedFormatters::HardcodedValidatorFinder - GetHardcodedValidators(); - virtual std::vector<ConstString> GetPossibleFormattersMatches(ValueObject &valobj, lldb::DynamicValueType use_dynamic); diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index 8315fbb2734..d2371f94f4b 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -260,7 +260,6 @@ class TypeEnumMemberImpl; class TypeEnumMemberListImpl; class TypeFormatImpl; class TypeNameSpecifierImpl; -class TypeValidatorImpl; class UUID; class UnixSignals; class Unwind; @@ -461,7 +460,6 @@ typedef std::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP; typedef std::shared_ptr<lldb_private::TypeSummaryImpl> TypeSummaryImplSP; typedef std::shared_ptr<lldb_private::TypeSummaryOptions> TypeSummaryOptionsSP; -typedef std::shared_ptr<lldb_private::TypeValidatorImpl> TypeValidatorImplSP; typedef std::shared_ptr<lldb_private::ScriptedSyntheticChildren> ScriptedSyntheticChildrenSP; typedef std::shared_ptr<lldb_private::UnixSignals> UnixSignalsSP; |

