From 1b07c728305a32a8d1fa1bb5da9d428e34dddf4e Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 25 Apr 2006 17:40:53 +0000 Subject: 2006-04-25 Frank Ch. Eigler PR 2427. * staptree.cxx (varuse_collecting_visitor::visit_embeddedcode): Support /* pure */ declaration. Stop using __tvar_ naming hack. (v_c_u::visit_print_format): Mark sprint and sprintf as side-effect-free. (deep_copy_visitor::visit_print_format): Propagate raw_components. * stap.1.in: Document declaration. * elaborate.cxx (semantic_pass_opt2): Verbose message tweak. (dead_stmtexpr_remover): Extend for more aggressive optimization. * tapsets.cxx (dwarf,mark_var_expanding_copy_visotor): Add /* pure */ declaration to rvalue expansions. * tapset/*.stp: Added /* pure */ declarations to many functions. * testsuite/parseok/unparsers.stp: Propagate guru mode flag. * testsuite/buildok/twentyfour.stp: New test. --- tapsets.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index 07daf865..50386480 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2598,9 +2598,7 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e) if (lvalue && !q.sess.guru_mode) throw semantic_error("write to target variable not permitted", e->tok); - // NB: This naming convention is used by varuse_collecting_visitor - // to make elision of these functions possible. - string fname = (string(lvalue ? "_tvar_set" : "_tvar_get") + string fname = (string(lvalue ? "_dwarf_tvar_set" : "_dwarf_tvar_get") + "_" + e->base_name.substr(1) + "_" + lex_cast(tick++)); @@ -2615,6 +2613,8 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e) e->components, lvalue, fdecl->type); + if (! lvalue) + ec->code += "/* pure */"; } catch (const semantic_error& er) { @@ -3454,18 +3454,18 @@ mark_var_expanding_copy_visitor::visit_target_symbol (target_symbol* e) fdecl->tok = e->tok; embeddedcode *ec = new embeddedcode; ec->tok = e->tok; - bool lvalue = is_active_lvalue(e); - if (lvalue) throw semantic_error("write to marker parameter not permitted", e->tok); + if (is_active_lvalue (e)) + throw semantic_error("write to marker parameter not permitted", e->tok); - // NB: This naming convention is used by varuse_collecting_visitor - // to make elision of these functions possible. - string fname = (string(lvalue ? "_tvar_set" : "_tvar_get") - + "_" + e->base_name.substr(1) - + "_" + lex_cast(tick++)); + string fname = string("_mark_tvar_get") + + "_" + e->base_name.substr(1) + + "_" + lex_cast(tick++); - ec->code = string("THIS->__retvalue = CONTEXT->locals[0].") + probe_name - + string(".__mark_arg") + lex_cast(argnum) + string (";"); + ec->code = string("THIS->__retvalue = CONTEXT->locals[0].") + + probe_name + string(".__mark_arg") + + lex_cast(argnum) + string (";"); + ec->code += "/* pure */"; fdecl->name = fname; fdecl->body = ec; fdecl->type = (argtype == 'N' ? pe_long : -- cgit