SI-5314 - CPS transform of return statement fails

Enable return expressions in CPS code if they are in tail position. Note that tail returns are
only removed in methods that do not call `shift` or `reset` (otherwise, an error is reported).

Addresses the issues pointed out in a previous pull request:
https://github.com/scala/scala/pull/720

- Addresses all issues mentioned here:
  https://github.com/scala/scala/pull/720#issuecomment-6429705

- Move transformation methods to SelectiveANFTransform.scala:
  https://github.com/scala/scala/pull/720#commitcomment-1477497

- Do not keep a list of tail returns.

Tests:
- continuations-neg/t5314-missing-result-type.scala
- continuations-neg/t5314-type-error.scala
- continuations-neg/t5314-npe.scala
- continuations-neg/t5314-return-reset.scala
- continuations-run/t5314.scala
- continuations-run/t5314-2.scala
- continuations-run/t5314-3.scala
Replace CheckCPSMethodTraverser with additional parameter on transformer methods

Other fixes:

- remove CPSUtils.allCPSMethods
- add clarifying comment about adding a plus marker to a return expression
Add missing cases in tail return transform

Disabled warnings that no longer apply because of tail returns.
Add several test cases.
Revert "Add missing cases in tail return transform"

This reverts commit 8d020fab9758ced93eb18fa51c906b95ec104aed.
Simplify the adaptation of types of return expressions

Add `adaptTypeOfReturn` hook to `AnnotationCheckers`.
Move adaptation of types of return expressions from `addAnnotations`
to `typedReturn` via `adaptTypeOfReturn` hook.

This resolves an inconsistency where previously types could have
a plus marker without additional CPS annotations. This also adds
additional test cases.
Improve doc comment on adaptTypeOfReturn in CPSAnnotationChecker
SI-6380 #1 Add @throws[Exception]

This change allows an additional notation of the @throws annotation:

  Old-style: @throws(classOf[Exception])
  New-style: @throws[Exception]

The optional String argument moves @throws in line with @deprecated,
@migration, etc. and prevents confusion caused by the default inheritance
of ScalaDoc comments and the non-inheritance of annotations.

  Before: /** This method does ...
            * @throws IllegalArgumentException if `a` is less than 0. */
          @throws(classOf[IllegalArgumentException])
          def foo(a: Int) = ...

  Now:    /** This method does ... */
          @throws[IllegalArgumentException]("if `a` is less than 0")
          def foo(a: Int) = ...

ScalaDoc @throws tags remain supported for cases where documentation of
thrown exceptions is needed, but are not supposed to be added to the
exception attribute of the class file.

In this commit the necessary compiler support is added.
The code to extract exceptions from annotations is now shared instead
of being duplicated all over the place.

The change is completely source and binary compatible, except that the code
is now enforcing that the type thrown is a subtype of Throwable as mandated
by the JVM spec  instead of allowing something like @throws(classOf[String]).

Not in this commit:
  - ScalaDoc support to add the String argument to ScalaDoc's exception list
  - Adaption of the library
Removes discrepancy between SIP 15 and compiler

There was a discrepancy in that the compiler alternatively accepts a val parameter or an unbox method for a value class but SIP 15 does not mention the unbox method. I commented out the line in the compiler that does it.
Move checkCheckable out of Infer.

Preparing for separate file with checkability logic.
Added exists3 to fast collections.
Moved isVariableName to StdNames where it belong.s
Pass a more precise type to checkCheckable when it's available.

Without it, one cannot assess the checkability of any
aspect of the pattern for which static verifiability
depends on knowledge of the scrutinee.
Improvements to unchecked warnings.

Closes SI-6275, SI-5762.

The comment says is better than I can.

/** On pattern matcher checkability:
 *
 *  Consider a pattern match of this form: (x: X) match { case _: P => }
 *
 *  There are four possibilities to consider:
 *     [P1] X will always conform to P
 *     [P2] x will never conform to P
 *     [P3] X <: P if some runtime test is true
 *     [P4] X cannot be checked against P
 *
 *  The first two cases correspond to those when there is enough static
 *  information to say X <: P or that !(X <: P) for all X and P.
 *  The fourth case includes unknown abstract types or structural
 *  refinements appearing within a pattern.
 *
 *  The third case is the interesting one.  We designate another type, XR,
 *  which is essentially the intersection of X and |P|, where |P| is
 *  the erasure of P.  If XR <: P, then no warning is emitted.
 *
 *  Examples of how this info is put to use:
 *  sealed trait A[T] ; class B[T] extends A[T]
 *    def f(x: B[Int]) = x match { case _: A[Int] if true => }
 *    def g(x: A[Int]) = x match { case _: B[Int] => }
 *
 *  `f` requires no warning because X=B[Int], P=A[Int], and B[Int] <:< A[Int].
 *  `g` requires no warning because X=A[Int], P=B[Int], XR=B[Int], and B[Int] <:< B[Int].
 *      XR=B[Int] because a value of type A[Int] which is tested to be a B can
 *      only be a B[Int], due to the definition of B (B[T] extends A[T].)
 *
 *  This is something like asSeenFrom, only rather than asking what a type looks
 *  like from the point of view of one of its base classes, we ask what it looks
 *  like from the point of view of one of its subclasses.
 */
Additional new tests for unchecked warnings.
Annotate non local returns with @unchecked.

Newly available @unchecked annotation enables removing the
special case from the unchecked logic.
Yet more tests for unchecked warnings.
Restored warning for impossible type tests.

I had this in before, then removed it since it is sometimes
redundant with an error message later issued by the pattern
matcher (e.g. scrutinee is incompatible with pattern type.)
However it also catches a lot of cases which are not errors,
so I think the modest redundancy is tolerable for now.

I also enhanced the logic for recognizing impossible
type tests, taking sealedness into account.
SI-6412 alleviates leaks in toolboxes, attempt #2

Turns importer caches into fully weak hash maps, and also applies
manual cleanup to toolboxes every time they are used.

It's not enough, because reflection-mem-typecheck test is still leaking
at a rate of ~100kb per typecheck, but it's much better than it was before.
We'll fix the rest later, after 2.10.0-final.

For more information, see https://issues.scala-lang.org/browse/SI-6412 and
http://groups.google.com/group/scala-internals/browse_thread/thread/eabcf3d406dab8b2

In comparison with https://github.com/scala/scala/commit/b403c1d,
the original commit that implemented the fix, this one doesn't crash tests.
The problem with the original commit was that it called tryFixup() before
updating the cache, leading to stack overflows.
Merge pull request #1393 from scalamacros/topic/leaks-in-toolboxes

SI-6412 alleviates leaks in toolboxes, attempt #2
no longer docs internal scala.reflect packages