[flang] Handle EQUIVALENCE and COMMON in size and offset computations
authorTim Keith <tkeith@nvidia.com>
Wed, 6 May 2020 18:43:06 +0000 (11:43 -0700)
committerTim Keith <tkeith@nvidia.com>
Wed, 6 May 2020 18:45:28 +0000 (11:45 -0700)
commit237d0e3c0416abf9919406bcc92874cfd15f5e0c
tree64ca757ee5e56e4fae6c7c8bbe742380a95023aa
parent26f93d9f373a1e638b621391ef7ba9bdf7b79044
[flang] Handle EQUIVALENCE and COMMON in size and offset computations

Objects in common blocks have offsets relative to the start of the
common block, independent of the enclosing scope, so they are processed
first. Add alignment to CommonBlockDetails to record the required
alignment of the common block.

For equivalence sets, each object depends on the one that is forced to
occur first in memory. The rest are recorded in the dependents_ map and
have offsets assigned after the other symbols are done.

Differential Revision: https://reviews.llvm.org/D79347
flang/include/flang/Semantics/symbol.h
flang/lib/Semantics/compute-offsets.cpp
flang/lib/Semantics/symbol.cpp
flang/test/Semantics/offsets03.f90 [new file with mode: 0644]