summaryrefslogtreecommitdiffstats
path: root/staptree.h
diff options
context:
space:
mode:
Diffstat (limited to 'staptree.h')
-rw-r--r--staptree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/staptree.h b/staptree.h
index bc479559..c9b2bdce 100644
--- a/staptree.h
+++ b/staptree.h
@@ -874,6 +874,11 @@ struct update_visitor: public visitor
targets.push(static_cast<void*>(src));
}
+ template <typename T> void replace (T*& src, bool clearok=false)
+ {
+ src = require(src, clearok);
+ }
+
virtual ~update_visitor() { assert(targets.empty()); }
virtual void visit_block (block *s);