llvm-project/flang/lib/Semantics/resolve-directives.h
Tim Keith 9500d48de3 [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
2020-07-28 16:38:36 -07:00

27 lines
854 B
C++

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef FORTRAN_SEMANTICS_RESOLVE_DIRECTIVES_H_
#define FORTRAN_SEMANTICS_RESOLVE_DIRECTIVES_H_
namespace Fortran::parser {
struct Name;
struct ProgramUnit;
} // namespace Fortran::parser
namespace Fortran::semantics {
class SemanticsContext;
// Name resolution for OpenACC and OpenMP directives
void ResolveAccParts(SemanticsContext &, const parser::ProgramUnit &);
void ResolveOmpParts(SemanticsContext &, const parser::ProgramUnit &);
} // namespace Fortran::semantics
#endif