From 553d27a587615e4b242a89bf1a7af93b71f050f0 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 3 Jun 2005 21:01:35 +0000 Subject: 2005-06-03 Frank Ch. Eigler * 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. --- main.cxx | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'main.cxx') 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; iprintsig (s.op->newline()); } - s.op->newline() << "# functions"; + if (s.functions.size() > 0) + s.op->newline() << "# functions"; for (unsigned i=0; iprintsig (s.op->newline()); + s.op->indent(1); + if (f->locals.size() > 0) + s.op->newline(1) << "# locals"; + for (unsigned j=0; jlocals.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; iprintsig (s.op->newline()); + s.op->indent(1); + if (p->locals.size() > 0) + s.op->newline() << "# locals"; + for (unsigned j=0; jlocals.size(); j++) + { + vardecl* v = p->locals[j]; + v->printsig (s.op->newline()); + } + s.op->indent(-1); } + + s.op->newline(); } // PASS 3: TRANSLATION -- cgit