[flang] Track current statement location in SemanticsVisitor
authorTim Keith <tkeith@nvidia.com>
Tue, 26 Mar 2019 19:40:13 +0000 (12:40 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 26 Mar 2019 19:40:13 +0000 (12:40 -0700)
commit3e8c62b48be0799bcca65ccbff0e15a5e6680794
tree21b17183eb249d9332413b73b16ad1634436748c
parent0574d4f986e49b5732c0b34455cc6334ff4ad74c
[flang] Track current statement location in SemanticsVisitor

Change `SemanticsVisitor` to track the location of the current
statement, if any, so that it's available through
`SemanticsContext::location()`

Add overloading of `SemanticsContext::Say()` that reports the
message at the location of the current statement if a `CharBlock`
is not provided.

Original-commit: flang-compiler/f18@5185c721ee9e2da8adcc4cad5a74acc0bf5c8d2d
Reviewed-on: https://github.com/flang-compiler/f18/pull/357
flang/lib/semantics/mod-file.cc
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/semantics.cc
flang/lib/semantics/semantics.h