aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/DataFormatters/FormatClasses.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/DataFormatters/FormatClasses.h')
-rw-r--r--include/lldb/DataFormatters/FormatClasses.h84
1 files changed, 75 insertions, 9 deletions
diff --git a/include/lldb/DataFormatters/FormatClasses.h b/include/lldb/DataFormatters/FormatClasses.h
index 6d9a50e8f2c5..651160371c69 100644
--- a/include/lldb/DataFormatters/FormatClasses.h
+++ b/include/lldb/DataFormatters/FormatClasses.h
@@ -10,9 +10,6 @@
#ifndef lldb_FormatClasses_h_
#define lldb_FormatClasses_h_
-// C Includes
-#include <stdint.h>
-
// C++ Includes
#include <string>
#include <vector>
@@ -23,17 +20,86 @@
#include "lldb/lldb-public.h"
#include "lldb/lldb-enumerations.h"
-#include "lldb/Core/ValueObject.h"
-#include "lldb/Interpreter/ScriptInterpreterPython.h"
#include "lldb/Symbol/ClangASTType.h"
#include "lldb/Symbol/Type.h"
-#include "lldb/DataFormatters/TypeFormat.h"
-#include "lldb/DataFormatters/TypeSummary.h"
-#include "lldb/DataFormatters/TypeSynthetic.h"
-
namespace lldb_private {
+class FormattersMatchCandidate
+{
+public:
+
+ FormattersMatchCandidate (ConstString name,
+ uint32_t reason,
+ bool strip_ptr,
+ bool strip_ref,
+ bool strip_tydef) :
+ m_type_name(name),
+ m_reason(reason),
+ m_stripped_pointer(strip_ptr),
+ m_stripped_reference(strip_ref),
+ m_stripped_typedef(strip_tydef)
+ {
+ }
+
+ ~FormattersMatchCandidate ()
+ {}
+
+ ConstString
+ GetTypeName () const
+ {
+ return m_type_name;
+ }
+
+ uint32_t
+ GetReason () const
+ {
+ return m_reason;
+ }
+
+ bool
+ DidStripPointer () const
+ {
+ return m_stripped_pointer;
+ }
+
+ bool
+ DidStripReference () const
+ {
+ return m_stripped_reference;
+ }
+
+ bool
+ DidStripTypedef () const
+ {
+ return m_stripped_typedef;
+ }
+
+ template <class Formatter>
+ bool
+ IsMatch (const std::shared_ptr<Formatter>& formatter_sp) const
+ {
+ if (!formatter_sp)
+ return false;
+ if (formatter_sp->Cascades() == false && DidStripTypedef())
+ return false;
+ if (formatter_sp->SkipsPointers() && DidStripPointer())
+ return false;
+ if (formatter_sp->SkipsReferences() && DidStripReference())
+ return false;
+ return true;
+ }
+
+private:
+ ConstString m_type_name;
+ uint32_t m_reason;
+ bool m_stripped_pointer;
+ bool m_stripped_reference;
+ bool m_stripped_typedef;
+};
+
+typedef std::vector<FormattersMatchCandidate> FormattersMatchVector;
+
class TypeNameSpecifierImpl
{
public: