parse: allow dereferencing operators on all expressions

If it looks like a @cast, and smells like a @cast, make it a @cast!

* parse.cxx (parser::parse_dwarf_value): New step to parse dereferencing
  operands in a central place.  Add those components to existing
  target_symbol types, or else create a new @cast to contain them.
  (parser::parse_crement): Call parse_dwarf_value as the next step.
  (parser::parse_cast_op,parse_atvar_op): Split from parse_target_symbol.
  (parser::parse_value,parse_symbol): Don't worry about target_symbol
  types now, as parse_dwarf_value will do it.
  (parser::peek_target_symbol_components): Look for dereferences.
  (parser::parse_defined_op): Parse any expression operand, as below.
* staptree.h (defined_op): Take any expression as the operand.
* tapsets.cxx (var_expanding_visitor::visit_defined_op): Adapt to
  @defined's new generalized operand.
parse: don't do auto-@cast promotion for old scripts

There's at least one case that will parse differently now:
  (expression) [index] in array

Before: (expression); [index] in array
i.e. two separate statements

After: [(expression)[index]] in array
i.e. @cast-dereference the expression, then test that in array

I don't see any use for the case before, but it's still valid syntax
that has changed behavior, so we'll be compatible about it.  Guard the
new @cast promotion for stap 2.6 and later only.  (The Future!)
Make autocast distinct from cast

Some dwarf probes try to be helpful and fill in empty @cast modules, but
we don't want that for an automatic @cast that will determine its module
and type from its operand.  So let's just make autocast separate.

* parse.cxx (parser::parse_dwarf_value): Create autocast_op, and assign
  its token as that of the first addressof or peeked component.
* elaborate.cxx (void_statement_reducer::reduce_target_symbol): New,
  collapse any kind of target_symbol to its operand and indexes.  Call
  this in all the void_statement_reducer target_symbol-like visitors.
* [Lots of added visitor::visit_autocast_op...]
Make target_symbol distinct from symbol

A target_symbol doesn't really act like a stap symbol at all, and the
subclass @var/@cast/... definitely don't.  Make target_symbol now a
direct subclass of expression, with no other relation to symbol.
Merge branch 'master' into autocast
Flatten dwflpp in add_unwindsym_ldd

There's no reason to new/delete this dwflpp instance; just create it
directly on the stack with no worries.
Save type details in expressions

* dwflpp.cxx (dwflpp::translate_final_fetch_or_store): Return the final
  typedie in memory provided by the caller.
  (dwflpp::literal_stmt_for_local): Pass through the final typedie.
  (dwflpp::literal_stmt_for_return): Ditto.
  (dwflpp::literal_stmt_for_pointer): Ditto.
* staptree.h (exp_type_details): New, generic type extras.
  (expression): Store optional exp_type_details.
  (expression_visitor): New, simple visitor to ease operating on all
  expressions equally.
* staptree.cxx (expression_visitor): Implement.
* tapsets.cxx (exp_type_dwarf): New DWARF type details.
  (synthetic_embedded_deref_call): Set the DWARF type on the resulting
  functioncall expression.
* elaborate.cxx (expression_build_no_more_visitor): New, clear extra
  type details from all expressions.
  (build_no_more): Clear expression types before calling build_no_more
  in the builders, so dwflpp lives long enough.
elaborate: mark functioncall type errors on the argument
Start expanding autocast during type resolution

There's no real propagation yet, so you can only try directly
transferred types so far, like:

  probe oneshot {
    println( (& @cast(task_current(), "task_struct")) ->pid )
  }

So that captures the task_current() address *with* the type, and then
the "->pid" is working as a separate expression to dereference it.

* elaborate.cxx (semantic_pass_symbols): Move build_no_more from here...
  (semantic_pass): ... to here, well after all types are resolved.
  (autocast_expanding_visitor): New, call on the type_details to expand
  autocast_op into a functioncall, like any $var/@cast would.
  (semantic_pass_types): Use autocast_expanding_visitor whenever the
  normal type resolution indicated there might be something to do.
  (typeresolution_info::visit_autocast_op):  Don't fail immediately;
  just visit the operand, and note when type_details show up.
* tapsets.cxx (exp_type_dwarf::expand): Expand that autocast_op!
  (dwarf_autocast_expanding_visitor): Removed in favor of just having
  autocast_expanding_visitor call exp_type_ptr->expand().
elaborate: turn referent asserts into exceptions

It's a bit nicer to throw an "internal error" semantic error message,
rather than assert and leave dirty tmp et al, especially while I'm working
on (and breaking) type resolution. :)
elaborate: Propagate type_details in limited cases

First there's a new exp_type_null which acts as an explicit marker,
"there be no detailed types here!"  Apply this to globals, and it may
also be used combining disparate type details to degrade to pe_long.

Then there are three expression cases that copy type details around:

* Ternary (?:) - if the true/false branches agree on type details, then
  the expression as a whole carries that type too.

* Plain assignment (=) - the right side propagates to the left, but not
  vice versa.  The assignment itself gets the type details too.

* Symbol to its declaration, and vice versa.  If the details of either
  disagree, then both are demoted to exp_type_null, so that can trickle
  back to all uses of that symbol.
Resolve function refs added by autocast expansion

* elaborate.cxx(autocast_expanding_visitor::resolve_functioncall): New,
  run symresolution and functioncall_traversing to make sure functions
  added by autocasting are resolved.
  (autocast_expanding_visitor::visit_autocast_op): Use it.
Hide the details of target_symbol_setter_functioncalls

This is a somewhat ugly detail of var_expanding_visitor for turning
lvalue assignments into functioncalls, and the manipulation of
target_symbol_setter_functioncalls was duplicated in several places.
Make that manipulation a new method, provide_lvalue_call, and hide that
field as private.
Unify checks for target_symbol::comp_pretty_print

The slightly-complicated check for comp_pretty_print was repeated in a few
places.  These are now done via target_symbol::pretty_print_depth() and
::check_pretty_print(), and the latter handles common lvalue asserts too.
parse: let autocast peeks detect deeper pretty-prints

It already noticed "(expr)$" but "(expr)$$" should be valid too.
dwflpp: Return the value of stores for reuse

This allows assignments to pass their value on to more expressions, e.g.
"$foo = $bar = 42" assigns both to 42, or "println(($foo = $bar)$)" both
assigns "$foo" and pretty-prints the value.
testsuite: Clean up parseok/parseko that used -p2

Many of these tests really are exercising the parser, so should be -p1.
A few were really semantic tests, now moved to semok or semko.  This
also lets them be tested by parseok/semko.stp.
testsuite: Subvert parseko/four.stp for autocast

This formerly-bad syntax is now expected to pass!  So tweak it in a way
that's bad even under autocast, and copy the good style to parseok.
autocast: Avoid duplicating errors

Don't retry an autocast expansion if we already have a saved error, and
wait to print errors until type resolution is in assert_resolvability.
autocast: disallow writes for non-gurus

Like any other deref access, autocast should only allow writes if
guru mode is chosen with stap -g.