summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorfche <fche>2005-06-03 21:01:35 +0000
committerfche <fche>2005-06-03 21:01:35 +0000
commit553d27a587615e4b242a89bf1a7af93b71f050f0 (patch)
tree1ca4e5d35908208e5d533bb32e22b6aa567221b8 /main.cxx
parent63a7c90e365874972925e886ed50941f5620bdfe (diff)
downloadsystemtap-steved-553d27a587615e4b242a89bf1a7af93b71f050f0.tar.gz
systemtap-steved-553d27a587615e4b242a89bf1a7af93b71f050f0.tar.xz
systemtap-steved-553d27a587615e4b242a89bf1a7af93b71f050f0.zip
2005-06-03 Frank Ch. Eigler <fche@redhat.com>
* TODO: Removed entries already represented in bugzilla. * elaborate.cxx: Rewrite type inference for several operators. * main.cxx (main): For -p2 runs, print types of function/probe locals. * parse.cxx (scan): Identify more two-character operators. (parse_comparison): Support the whole suite. * translate.cxx (visit_unary_expression, logical_or_expr, logical_and_expr, comparison,ternary_expression): New support. * testsuite/parseok/semok.stp: Clever new test. * testsuite/transok/four.stp: New test. * testsuite/*: Some tweaked tests for syntax changes.
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx29
1 files changed, 26 insertions, 3 deletions
diff --git a/main.cxx b/main.cxx
index 1de14576..6a9b70dc 100644
--- a/main.cxx
+++ b/main.cxx
@@ -175,26 +175,49 @@ main (int argc, char * const argv [])
rc = semantic_pass (s);
if (last_pass == 2 && rc == 0)
{
- s.op->line() << "# globals";
+ if (s.globals.size() > 0)
+ s.op->line() << "# globals";
for (unsigned i=0; i<s.globals.size(); i++)
{
vardecl* v = s.globals[i];
v->printsig (s.op->newline());
}
- s.op->newline() << "# functions";
+ if (s.functions.size() > 0)
+ s.op->newline() << "# functions";
for (unsigned i=0; i<s.functions.size(); i++)
{
functiondecl* f = s.functions[i];
f->printsig (s.op->newline());
+ s.op->indent(1);
+ if (f->locals.size() > 0)
+ s.op->newline(1) << "# locals";
+ for (unsigned j=0; j<f->locals.size(); j++)
+ {
+ vardecl* v = f->locals[j];
+ v->printsig (s.op->newline());
+ }
+ s.op->indent(-1);
}
- s.op->newline() << "# probes";
+ if (s.probes.size() > 0)
+ s.op->newline() << "# probes";
for (unsigned i=0; i<s.probes.size(); i++)
{
derived_probe* p = s.probes[i];
p->printsig (s.op->newline());
+ s.op->indent(1);
+ if (p->locals.size() > 0)
+ s.op->newline() << "# locals";
+ for (unsigned j=0; j<p->locals.size(); j++)
+ {
+ vardecl* v = p->locals[j];
+ v->printsig (s.op->newline());
+ }
+ s.op->indent(-1);
}
+
+ s.op->newline();
}
// PASS 3: TRANSLATION