[flang] Special handling for VOLATILE and ASYNCHRONOUS
authorTim Keith <tkeith@nvidia.com>
Tue, 13 Aug 2019 20:50:24 +0000 (13:50 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 13 Aug 2019 20:50:24 +0000 (13:50 -0700)
commitff768d92dd68426385db1623ba2c336803c25ede
treee2fd3178fe4f4a5acfffc4f4afe2f73dba146c2d
parent43cfeb75b3e598c14ae7bbb9ae5c281bd9c49fa1
[flang] Special handling for VOLATILE and ASYNCHRONOUS

The VOLATILE and ASYNCHRONOUS attributes are special in two ways:
- they can be applied to use-associated variables
- if they are applied to a host-associated variable in a block, that
  variable has the attribute only within the scope of the block

The latter is implemented by making a new `HostAssocDetails` symbol
within the block where the attribute can be set without affecting the
variable in the outer scope. This is similar to how the SHARED locality
spec is implemented.

Fixes flang-compiler/f18#649.

Original-commit: flang-compiler/f18@471aba451341a65ff6014bbe30cb2c64cf905da6
Reviewed-on: https://github.com/flang-compiler/f18/pull/655
flang/lib/semantics/resolve-names.cc
flang/test/semantics/symbol05.f90