summaryrefslogtreecommitdiffstats
path: root/parse.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-10-13 16:57:38 -0700
committerJosh Stone <jistone@redhat.com>2009-10-13 16:57:38 -0700
commitd5e178c1d6eb0e7c1a317b925687050aa1cb6c1b (patch)
tree0d46cafccc4518b81b6462b59333dca0fe5eca63 /parse.cxx
parent42b2e52658603d3e1384a909ad816d05529fc1d3 (diff)
downloadsystemtap-steved-d5e178c1d6eb0e7c1a317b925687050aa1cb6c1b.tar.gz
systemtap-steved-d5e178c1d6eb0e7c1a317b925687050aa1cb6c1b.tar.xz
systemtap-steved-d5e178c1d6eb0e7c1a317b925687050aa1cb6c1b.zip
Consolidate print_format creation
We almost had a factory in print_format::parse_print, so let's take that the rest of the way. This way we don't have so much duplication in initializing the print flags. * staptree.cxx (print_format::parse_print): Replaced with... (print_format::create): New factory to parse and create print_formats. * elaborate.cxx (add_global_var_display): Use this factory. * parse.cxx (parser::parse_symbol): Ditto. * tapset-mark.cxx (mark_var_expanding_visitor::visit_target_symbol_context): Ditto. * tapset-utrace.cxx (utrace_var_expanding_visitor::visit_target_symbol_arg): Ditto. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_context): Ditto. (tracepoint_var_expanding_visitor::visit_target_symbol_context) Ditto.
Diffstat (limited to 'parse.cxx')
-rw-r--r--parse.cxx13
1 files changed, 1 insertions, 12 deletions
diff --git a/parse.cxx b/parse.cxx
index 1496e9b8..cfefa12d 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -2352,8 +2352,6 @@ parser::parse_symbol ()
// now scrutinize this identifier for the various magic forms of identifier
// (printf, @stat_op, and $var...)
- bool pf_stream, pf_format, pf_delim, pf_newline, pf_char;
-
if (name == "@cast")
{
// type-punning time
@@ -2410,17 +2408,8 @@ parser::parse_symbol ()
return sop;
}
- else if (print_format::parse_print(name,
- pf_stream, pf_format, pf_delim, pf_newline, pf_char))
+ else if (print_format *fmt = print_format::create(t))
{
- print_format *fmt = new print_format;
- fmt->tok = t;
- fmt->print_to_stream = pf_stream;
- fmt->print_with_format = pf_format;
- fmt->print_with_delim = pf_delim;
- fmt->print_with_newline = pf_newline;
- fmt->print_char = pf_char;
-
expect_op("(");
if ((name == "print" || name == "println" ||
name == "sprint" || name == "sprintln") &&