[flang-commits] [flang] [Flang][OpenMP][NFC] Track Objects for BlockArgs (PR #197442)
Jack Styles via flang-commits
flang-commits at lists.llvm.org
Fri May 15 02:13:11 PDT 2026
================
@@ -9,25 +9,35 @@
#ifndef FORTRAN_SUPPORT_OPENMP_UTILS_H_
#define FORTRAN_SUPPORT_OPENMP_UTILS_H_
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Semantics/symbol.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/Value.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
namespace Fortran::common::openmp {
/// Structure holding the information needed to create and bind entry block
/// arguments associated to a single clause.
struct EntryBlockArgsEntry {
- llvm::ArrayRef<const Fortran::semantics::Symbol *> syms;
+ llvm::SmallVector<Fortran::lower::omp::Object> objects;
llvm::ArrayRef<mlir::Value> vars;
bool isValid() const {
- // This check allows specifying a smaller number of symbols than values
+ // This check allows specifying a smaller number of objects than values
// because in some case cases a single symbol generates multiple block
// arguments.
- return syms.size() <= vars.size();
+ return objects.size() <= vars.size();
+ }
+
+ llvm::SmallVector<const Fortran::semantics::Symbol *> getSyms() const {
+ llvm::SmallVector<const Fortran::semantics::Symbol *> syms;
+ for (const Fortran::lower::omp::Object &object : objects) {
+ syms.push_back(object.sym());
+ }
----------------
Stylie777 wrote:
Done, but I have used reserve rather than resize.
https://github.com/llvm/llvm-project/pull/197442
More information about the flang-commits
mailing list