[Sema] Fix SR-1681: spurious "unused result" warning in Swift 3An OptionalEvaluationExpr can have a CallExpr directly as its SubExpr,
if the CallExpr already has optional type.
extends ea52d4fbc7093582eef84c57b3906e9d7e274fe8
[Scope map] Explicitly model pattern bindings and their initializers.Consistently model all pattern bindings in the scope map, as well as
having specific nodes for their initializers. This provides us with
more consistency (the declarations are represented) as well as giving
us a scope we can use to extract the DeclContext for a non-local
initializer.
[Scope map] Always introduce a node for AbstractFunctionDecls.Part of making the scope map subsume the DeclContext change, so we can
identify the nearest enclosing DeclContext.
[Scope map] Cache the source range for a scope node, once computed.Source ranges are non-trivial to compute, small to store, and used often. Cache 'em.
[Scope map] Introduce an operation to find the innermost scope based on a given source location.Given a source location, we can find the innermost enclosing scope
that describes that source location. Introduce this operation into the
scope map, then add a testing mode where we probe the scope map at
specifi locations to see what we find. Test for:
1) Finding the right innermost enclosing scope, and
2) That we're only expanding the part of the scope map that is needed
to identify that scope.
Split guard statement into three non-overlapping children: * A child to evaluate the conditions, which covers expressions in the conditions * A child for the 'else' body, which does not have access to the names in the conditions * A child for the continuation, which re-introduces the names in the conditions for the rest of the bodyNow we can assert that the only out-of-order case is for accessors.
[WIP Name binding] Introduce a basic 'scope map' to model scopes in the AST.The scope map models all of the name lookup scopes within a source
file. It can be queried by source location to find the innermost scope
that contains that source location. Then, one can follow the parent
pointers in the scope to enumerate the enclosing scopes.
The scope map itself is lazily constructed, only creating scope map
nodes when required implicitly (e.g, when searching for a particu...