From edc22ba9b105fd944f39cf536346ff68c2c8d0aa Mon Sep 17 00:00:00 2001 From: brolley Date: Thu, 24 Jan 2008 16:43:13 +0000 Subject: 2008-01-24 Dave Brolley PR 5017. * staptree.cxx (): #include it. (required ): Remove 'static' from instantiation and move instantiation to here from... * staptree.h: ...here. --- ChangeLog | 11 ++++++++++- staptree.cxx | 28 ++++++++++++++++++++++++++++ staptree.h | 27 ++------------------------- 3 files changed, 40 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d0281f0..956255ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-24 Dave Brolley + + PR 5017. + * staptree.cxx (): #include it. + (required ): Remove 'static' from instantiation and + move instantiation to here from... + * staptree.h: ...here. + 2008-01-23 David Smith PR 5661. @@ -10,6 +18,7 @@ 2008-01-23 Dave Brolley + PR 5613. * translate.cxx (var::fini): New method. (c_unparser::emit_module_init): Call var::fini when deregistering variables without indices. @@ -17,7 +26,7 @@ 2008-01-23 Frank Ch. Eigler - PR 2151 + PR 2151. * tapsets.cxx (dwflpp::setup): Parametrize debuginfo_path. * stap.1.in: Document this. diff --git a/staptree.cxx b/staptree.cxx index ed2bc00e..173314ee 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -18,6 +18,7 @@ #include #include #include +#include using namespace std; @@ -2370,3 +2371,30 @@ deep_copy_visitor::deep_copy (expression* s) require (&v, &n, s); return n; } + +template <> void +require (deep_copy_visitor* v, indexable** dst, indexable* src) +{ + if (src != NULL) + { + symbol *array_src=NULL, *array_dst=NULL; + hist_op *hist_src=NULL, *hist_dst=NULL; + + classify_indexable(src, array_src, hist_src); + + *dst = NULL; + + if (array_src) + { + require (v, &array_dst, array_src); + *dst = array_dst; + } + else + { + require (v, &hist_dst, hist_src); + *dst = hist_dst; + } + assert (*dst); + } +} + diff --git a/staptree.h b/staptree.h index 4584d32d..5b4b56cd 100644 --- a/staptree.h +++ b/staptree.h @@ -846,31 +846,8 @@ require (deep_copy_visitor* v, T* dst, T src) } } -template <> static void -require (deep_copy_visitor* v, indexable** dst, indexable* src) -{ - if (src != NULL) - { - symbol *array_src=NULL, *array_dst=NULL; - hist_op *hist_src=NULL, *hist_dst=NULL; - - classify_indexable(src, array_src, hist_src); - - *dst = NULL; - - if (array_src) - { - require (v, &array_dst, array_src); - *dst = array_dst; - } - else - { - require (v, &hist_dst, hist_src); - *dst = hist_dst; - } - assert (*dst); - } -} +template <> void +require (deep_copy_visitor* v, indexable** dst, indexable* src); template void provide (deep_copy_visitor* v, T src) -- cgit