diff options
author | Josh Stone <jistone@redhat.com> | 2009-09-02 16:14:08 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-09-02 16:14:08 -0700 |
commit | aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9 (patch) | |
tree | 0e8f39ae14f5793b37b0565c4a17811b696c9f9b /tapset-mark.cxx | |
parent | d185503c723ded087ff987e8fa08c2418e60006b (diff) | |
download | systemtap-steved-aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9.tar.gz systemtap-steved-aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9.tar.xz systemtap-steved-aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9.zip |
Unify lex_cast* and avoid string copies
We always use lex_cast either to string or from string, so I made that
explicit, and got rid of some string copies in the process. There was
also stringify(), which was redundant to lex_cast<string>.
We also always used lex_cast_hex to string, so that's now hard-coded and
again eliminated a string copy.
For lex_cast_qstring<string>, there's no need to write the streamify the
input, so a specialization now operates directly on the input.
Hopefully this is a bit cleaner, and I do measure it to be a little
faster on scripts with many probes.
Diffstat (limited to 'tapset-mark.cxx')
-rw-r--r-- | tapset-mark.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tapset-mark.cxx b/tapset-mark.cxx index 6b4f47c5..b70098e3 100644 --- a/tapset-mark.cxx +++ b/tapset-mark.cxx @@ -108,7 +108,7 @@ mark_var_expanding_visitor::visit_target_symbol_arg (target_symbol* e) // Remember that we've seen a target variable. target_symbol_seen = true; - e->probe_context_var = "__mark_arg" + lex_cast<string>(argnum); + e->probe_context_var = "__mark_arg" + lex_cast(argnum); e->type = mark_args[argnum-1]->stp_type; provide (e); } @@ -156,10 +156,10 @@ mark_var_expanding_visitor::visit_target_symbol_context (target_symbol* e) { if (i > 0) pf->raw_components += " "; - pf->raw_components += "$arg" + lex_cast<string>(i+1); + pf->raw_components += "$arg" + lex_cast(i+1); target_symbol *tsym = new target_symbol; tsym->tok = e->tok; - tsym->base_name = "$arg" + lex_cast<string>(i+1); + tsym->base_name = "$arg" + lex_cast(i+1); tsym->saved_conversion_error = 0; expression *texp = require (tsym); //same treatment as tracepoint @@ -414,7 +414,7 @@ mark_derived_probe::emit_probe_context_vars (translator_output* o) for (unsigned i = 0; i < mark_args.size(); i++) { - string localname = "__mark_arg" + lex_cast<string>(i+1); + string localname = "__mark_arg" + lex_cast(i+1); switch (mark_args[i]->stp_type) { case pe_long: @@ -441,7 +441,7 @@ mark_derived_probe::initialize_probe_context_vars (translator_output* o) bool deref_fault_needed = false; for (unsigned i = 0; i < mark_args.size(); i++) { - string localname = "l->__mark_arg" + lex_cast<string>(i+1); + string localname = "l->__mark_arg" + lex_cast(i+1); switch (mark_args[i]->stp_type) { case pe_long: @@ -475,7 +475,7 @@ mark_derived_probe::printargs(std::ostream &o) const { for (unsigned i = 0; i < mark_args.size(); i++) { - string localname = "$arg" + lex_cast<string>(i+1); + string localname = "$arg" + lex_cast(i+1); switch (mark_args[i]->stp_type) { case pe_long: |