diff options
author | fche <fche> | 2006-03-06 23:07:56 +0000 |
---|---|---|
committer | fche <fche> | 2006-03-06 23:07:56 +0000 |
commit | d20fd9e99244600c23afae42f73a6457004d434f (patch) | |
tree | 44be9453f66e46a7602cf23166dc4126c159719f /staptree.cxx | |
parent | a3fe9f2d1301ff5a69b6a2a42cfebdcd6df7721a (diff) | |
download | systemtap-steved-d20fd9e99244600c23afae42f73a6457004d434f.tar.gz systemtap-steved-d20fd9e99244600c23afae42f73a6457004d434f.tar.xz systemtap-steved-d20fd9e99244600c23afae42f73a6457004d434f.zip |
2006-03-06 Frank Ch. Eigler <fche@elastic.org>
PR 2425
* staptree.cxx (varuse_collecting_visitor::visit_embeddedcode):
Realize that $var-setter functions have side-effects.
* testsuite/transok/tval-opt.stp: New test.
Diffstat (limited to 'staptree.cxx')
-rw-r--r-- | staptree.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/staptree.cxx b/staptree.cxx index 6669e9ae..708d7b87 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -1480,7 +1480,7 @@ void varuse_collecting_visitor::visit_embeddedcode (embeddedcode *s) { // In order to elide unused but correct functions generated to - // get/set $target variables, we encode our knowledge that such + // get $target variables, we encode our knowledge that such // functions are side-effect-free. We tell them apart from ordinary // tapset embedded-C functions by the naming prefix. XXX Something // apart from this heuristic would be nice. XXX Similarly, some @@ -1489,8 +1489,9 @@ varuse_collecting_visitor::visit_embeddedcode (embeddedcode *s) assert (current_function); // only they get embedded code string name = current_function->name; - if (name.length() > 6 && name.substr(0, 6) == "_tvar_") + if (name.length() > 10 && name.substr(0, 10) == "_tvar_get_") return; + // NB: setter functions naturally have side-effects embedded_seen = true; } @@ -1549,6 +1550,7 @@ varuse_collecting_visitor::visit_symbol (symbol *e) // NB: stat_op need not be overridden, since it will get to // visit_symbol and only as a possible rvalue. + void varuse_collecting_visitor::visit_arrayindex (arrayindex *e) { |