13#ifndef FORTRAN_SEMANTICS_OPENMP_UTILS_H
14#define FORTRAN_SEMANTICS_OPENMP_UTILS_H
16#include "flang/Common/indirection.h"
17#include "flang/Evaluate/type.h"
18#include "flang/Parser/char-block.h"
19#include "flang/Parser/parse-tree.h"
20#include "flang/Parser/tools.h"
21#include "flang/Semantics/tools.h"
23#include "llvm/ADT/ArrayRef.h"
30namespace Fortran::semantics {
37template <
typename T,
typename U = std::remove_const_t<T>> U AsRvalue(T &t) {
41template <
typename T> T &&AsRvalue(T &&t) {
return std::move(t); }
43const Scope &GetScopingUnit(
const Scope &scope);
44const Scope &GetProgramUnit(
const Scope &scope);
53 operator bool()
const {
return stmt !=
nullptr; }
59std::string ThisVersion(
unsigned version);
60std::string TryVersion(
unsigned version);
67std::optional<parser::CharBlock> GetObjectSource(
72bool IsCommonBlock(
const Symbol &sym);
73bool IsExtendedListItem(
const Symbol &sym);
74bool IsVariableListItem(
const Symbol &sym);
75bool IsTypeParamInquiry(
const Symbol &sym);
76bool IsStructureComponent(
const Symbol &sym);
77bool IsVarOrFunctionRef(
const MaybeExpr &expr);
79bool IsMapEnteringType(parser::OmpMapType::Value type);
80bool IsMapExitingType(parser::OmpMapType::Value type);
82MaybeExpr GetEvaluateExpr(
const parser::Expr &parserExpr);
83template <
typename T> MaybeExpr GetEvaluateExpr(
const T &inp) {
84 return GetEvaluateExpr(parser::UnwrapRef<parser::Expr>(inp));
87std::optional<evaluate::DynamicType> GetDynamicType(
90std::optional<bool> GetLogicalValue(
const SomeExpr &expr);
92std::optional<bool> IsContiguous(
95std::vector<SomeExpr> GetAllDesignators(
const SomeExpr &expr);
96const SomeExpr *HasStorageOverlap(
Definition expression.h:878
Definition char-block.h:28
Definition semantics.h:67
Definition parse-tree.h:496
Definition parse-tree.h:1921
Definition parse-tree.h:1828
Definition parse-tree.h:1867
Definition parse-tree.h:554
Definition parse-tree.h:1710
Definition parse-tree.h:3549
Definition parse-tree.h:3680
Definition openmp-utils.h:49