From cbfbbf6996cbe3b9fe57ac2014aa7262bb6890d6 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 24 Jan 2006 17:58:02 +0000 Subject: 2006-01-24 Frank Ch. Eigler PR 2060 etc. * tapsets.cxx (visit_target_symbol): Tolerate failed resolution by letting target_symbol instance pass through to optimizer and type checker. * elaborate.cxx (semantic_pass_optimize): New family of functions and associated visitor classes. (visit_for_loop): Tolerate absent init/incr clauses. (semantic_pass): Invoke unless unoptimized (-u) option given. * main.cxx, session.h: Add support for flag. * staptree.cxx (visit_for_loop): Tolerate absent init/incr clauses. (traversing_visitor::visit_arrayindex): Visit the index expressions. (functioncall_traversing_visitor): New class. (varuse_tracking_visitor): New class. * staptree.h: Corresponding changes. * parse.cxx (parse_for_loop): Represent absent init/incr expressions with null statement pointer instead of optimized-out dummy numbers. * stap.1.in: Document optimization. * testsuite/{semko,transko}/*.stp: Added "-u" or other code to many tests to check bad code without optimizer elision. * testsuite/semok/optimize.stp: New test. * elaborate.cxx (unresolved, invalid, mismatch): Standardize error message wording. * stapfuncs.5.in: Tweak print/printf docs. * tapset/logging.stp: Remove redundant "print" auxiliary function, since it's a translator built-in. * testsuite/transok/five.stp: Extend test. * translate.cxx (emit_symbol_data): Put symbol table into a separate temporary header file, to make "-p3" output easier on the eyes. * buildrun.cxx (compile_pass): Eliminate test-mode support throughout. * main.cxx, session.h, translate.cxx: Ditto. * main.cxx (main): For last-pass=2 runs, print post-optimization ASTs. --- testsuite/semko/eleven.stp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'testsuite/semko/eleven.stp') diff --git a/testsuite/semko/eleven.stp b/testsuite/semko/eleven.stp index 34dfa225..f76c2df9 100755 --- a/testsuite/semko/eleven.stp +++ b/testsuite/semko/eleven.stp @@ -1,15 +1,15 @@ -#! stap -p2 +#! stap -up2 global arr,rra - +global s,n probe begin { arr[0]="value" rra["key"]=0 } probe end { # confirm that typechecking works the same way for all array indexing - if (k in arr) { k.""; arr[k]+0 } - foreach (l in arr) { l.""; arr[l]+0 } - if (m in rra) { m+1; rra[m]."" } - foreach (n in rra) { n+0; rra[n]."" } + if (k in arr) { s=k.""; i=arr[k]+0 } + foreach (l in arr) { s=l.""; i=arr[l]+0 } + if (m in rra) { i=m+1; s=rra[m]."" } + foreach (n in rra) { i=n+0; s=rra[n]."" } } -- cgit