[flang][NFC] Extract name resolution for OpenACC & OpenMP into new file
authorTim Keith <tkeith@nvidia.com>
Tue, 28 Jul 2020 23:38:34 +0000 (16:38 -0700)
committerTim Keith <tkeith@nvidia.com>
Tue, 28 Jul 2020 23:38:36 +0000 (16:38 -0700)
commit9500d48de367d969dc944445297ae5bdfaa14079
treec453fd46e372c992a296d50dc3807517538ae71c
parent59f17a7d4f42fa330557e36d18f8b5f82a2c5e30
[flang][NFC] Extract name resolution for OpenACC & OpenMP into new file

Move `ResolveAccParts` and `ResolveOmpParts` from resolve-names.cpp to
resolve-directives.{h,cpp}. Move the implementation in the classes
`DirectiveAttributeVisitor`, `AccAttributeVisitor`, and
`OmpAttributeVisitor` to resolve-directives.cpp as well.

To allow this to happen, move `EvaluateIntExpr` and introduce
`EvaluateInt64` to resolve-names-utils.h. The latter is also useful
elsewhere in resolve-names.cpp for converting an Expr to std::int64_t.

The other problem was that `ResolveDesignator` was called from the code
that was moved. At the moment it doesn't seem to be doing anything so I
removed the calls (and no tests failed). If it proves to be needed, we
can either resolve those designators in resolve-names.cpp or pass the
`ResolveDesignator` function in to the code that needs to call it.

Differential Revision: https://reviews.llvm.org/D84768
flang/lib/Semantics/CMakeLists.txt
flang/lib/Semantics/resolve-directives.cpp [new file with mode: 0644]
flang/lib/Semantics/resolve-directives.h [new file with mode: 0644]
flang/lib/Semantics/resolve-names-utils.h
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/acc-resolve01.f90