brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 48aa36f Raw
30 lines · cpp
1//===-- flang/lib/Semantics/openmp-dsa.cpp ----------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "flang/Semantics/openmp-dsa.h"10 11namespace Fortran::semantics {12 13Symbol::Flags GetSymbolDSA(const Symbol &symbol) {14  Symbol::Flags dsaFlags{Symbol::Flag::OmpPrivate,15      Symbol::Flag::OmpFirstPrivate, Symbol::Flag::OmpLastPrivate,16      Symbol::Flag::OmpShared, Symbol::Flag::OmpLinear,17      Symbol::Flag::OmpReduction};18  Symbol::Flags dsa{symbol.flags() & dsaFlags};19  if (dsa.any()) {20    return dsa;21  }22  // If no DSA are set use those from the host associated symbol, if any.23  if (const auto *details{symbol.detailsIf<HostAssocDetails>()}) {24    return GetSymbolDSA(details->symbol());25  }26  return {};27}28 29} // namespace Fortran::semantics30