summaryrefslogtreecommitdiffstats
path: root/staptree.h
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-02-10 18:29:55 -0800
committerJosh Stone <jistone@redhat.com>2009-02-10 18:29:55 -0800
commit1cd151d5b9e1fd46590d5e4c3473a86ea9bbe043 (patch)
tree1a9644eeed37df7d16c81a57dd7a8b5c4cf7ab6a /staptree.h
parent8bda649876b523f7733aa547ff86924a90f0e57b (diff)
downloadsystemtap-steved-1cd151d5b9e1fd46590d5e4c3473a86ea9bbe043.tar.gz
systemtap-steved-1cd151d5b9e1fd46590d5e4c3473a86ea9bbe043.tar.xz
systemtap-steved-1cd151d5b9e1fd46590d5e4c3473a86ea9bbe043.zip
Simplify dead_stmtexpr_remover
* staptree.h (update_visitor::require): Add a clearok parameter for optimizing traversers to signal that they're ready for NULL back. * elaborate.cxx (dead_stmtexpr_remover): Convert to an update_visitor.
Diffstat (limited to 'staptree.h')
-rw-r--r--staptree.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/staptree.h b/staptree.h
index 00809ed0..0cd0ee0d 100644
--- a/staptree.h
+++ b/staptree.h
@@ -815,7 +815,7 @@ struct throwing_visitor: public visitor
struct update_visitor: public visitor
{
- template <typename T> T require (T src)
+ template <typename T> T require (T src, bool clearok=false)
{
T dst = NULL;
if (src != NULL)
@@ -824,7 +824,7 @@ struct update_visitor: public visitor
assert(!targets.empty());
dst = static_cast<T>(targets.top());
targets.pop();
- assert(dst);
+ assert(clearok || dst);
}
return dst;
}
@@ -874,7 +874,7 @@ private:
};
template <> indexable*
-update_visitor::require <indexable*> (indexable* src);
+update_visitor::require <indexable*> (indexable* src, bool clearok);
// A visitor which performs a deep copy of the root node it's applied
// to. NB: It does not copy any of the variable or function