From 1cd151d5b9e1fd46590d5e4c3473a86ea9bbe043 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 10 Feb 2009 18:29:55 -0800 Subject: 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. --- staptree.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'staptree.cxx') diff --git a/staptree.cxx b/staptree.cxx index 2b963bc3..9ffbaf09 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -2337,7 +2337,7 @@ update_visitor::visit_hist_op (hist_op* e) } template <> indexable* -update_visitor::require (indexable* src) +update_visitor::require (indexable* src, bool clearok) { indexable *dst = NULL; if (src != NULL) @@ -2351,7 +2351,7 @@ update_visitor::require (indexable* src) dst = require (array_src); else dst = require (hist_src); - assert (dst); + assert(clearok || dst); } return dst; } -- cgit