diff options
author | graydon <graydon> | 2005-07-08 03:11:36 +0000 |
---|---|---|
committer | graydon <graydon> | 2005-07-08 03:11:36 +0000 |
commit | 85365d1b9cfd2d75cb847be4ced3de583f91865b (patch) | |
tree | 66ed4360c2114dd8ad4c316a14cde3d474f09976 /elaborate.cxx | |
parent | 26a23e7acee698ac38349f19d1a9602ed0f6a4fd (diff) | |
download | systemtap-steved-85365d1b9cfd2d75cb847be4ced3de583f91865b.tar.gz systemtap-steved-85365d1b9cfd2d75cb847be4ced3de583f91865b.tar.xz systemtap-steved-85365d1b9cfd2d75cb847be4ced3de583f91865b.zip |
2005-07-07 Graydon Hoare <graydon@redhat.com>
* staptree.{h,cxx} (deep_copy_visitor): New visitor.
* elaborate.cxx
(derived_probe::derived_probe):
(alias_expansion_builder::build): Use it.
* testsuite/semok/fifteen.stp: New test which relies on deep copy.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r-- | elaborate.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/elaborate.cxx b/elaborate.cxx index 37d43ee1..e38cef51 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -37,8 +37,7 @@ derived_probe::derived_probe (probe *p): { this->locations = p->locations; this->tok = p->tok; - this->body = p->body; - this->locals = p->locals; + this->body = deep_copy_visitor::deep_copy(p->body); } @@ -47,8 +46,7 @@ derived_probe::derived_probe (probe *p, probe_point *l): { this->locations.push_back (l); this->tok = p->tok; - this->body = p->body; - this->locals = p->locals; + this->body = deep_copy_visitor::deep_copy(p->body); } // ------------------------------------------------------------------------ @@ -262,12 +260,17 @@ alias_expansion_builder // there's concatenated code here and we only want one vardecl per // resulting variable. - copy(alias->body->statements.begin(), - alias->body->statements.end(), - back_inserter(n->body->statements)); - copy(use->body->statements.begin(), - use->body->statements.end(), - back_inserter(n->body->statements)); + for (unsigned i = 0; i < alias->body->statements.size(); ++i) + { + statement *s = deep_copy_visitor::deep_copy(alias->body->statements[i]); + n->body->statements.push_back(s); + } + + for (unsigned i = 0; i < use->body->statements.size(); ++i) + { + statement *s = deep_copy_visitor::deep_copy(use->body->statements[i]); + n->body->statements.push_back(s); + } results_to_expand_further.push_back(n); } |