summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-12-05 01:25:20 +0000
committerEnrico Granata <egranata@apple.com>2013-12-05 01:25:20 +0000
commit315133710d270db3486a583e1ed6f885dfff07b8 (patch)
tree78671184f142e4319d24f46531cca5073a623a8d
parent0503a870a94c28ab32fa461e175f8cb387c8718e (diff)
downloadbcm5719-llvm-315133710d270db3486a583e1ed6f885dfff07b8.tar.gz
bcm5719-llvm-315133710d270db3486a583e1ed6f885dfff07b8.zip
Provide an easy way for synthetic child provider front ends to declare themselves “invalid”
This is not being used yet, and in practice, more refactoring would be required to make this fully practical In practice, the way this should work is that CalculateNumChildren(), GetChildAtIndex(), GetIndexOfChildWithName() and MightHaveChildren() should all default to failure values when m_valid == false. Update() should be the only function actually setting/clearing the flag upon inspecting the backend ValueObject, if it determines it to be in an incongruent state Given refactoring of the FrontEnd APIs, this work could be automatically performed without the individual providers having to replicate this logic The way this works now is that each front end picks one or more “key ivars” and keys off those to detect invalidity This is a baby step 0 to a better world llvm-svn: 196452
-rw-r--r--lldb/include/lldb/DataFormatters/TypeSynthetic.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
index 18b9d011e96..a25f11d6439 100644
--- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
@@ -32,10 +32,24 @@ namespace lldb_private {
{
protected:
ValueObject &m_backend;
+
+ void
+ SetValid (bool valid)
+ {
+ m_valid = valid;
+ }
+
+ bool
+ IsValid ()
+ {
+ return m_valid;
+ }
+
public:
SyntheticChildrenFrontEnd (ValueObject &backend) :
- m_backend(backend)
+ m_backend(backend),
+ m_valid(true)
{}
virtual
@@ -71,6 +85,7 @@ namespace lldb_private {
typedef std::unique_ptr<SyntheticChildrenFrontEnd> AutoPointer;
private:
+ bool m_valid;
DISALLOW_COPY_AND_ASSIGN(SyntheticChildrenFrontEnd);
};
OpenPOWER on IntegriCloud