[flang-commits] [flang] [flang][openmp]Add UserReductionDetails and use in DECLARE REDUCTION (PR #131628)
Mats Petersson via flang-commits
flang-commits at lists.llvm.org
Thu Apr 10 11:32:25 PDT 2025
================
@@ -701,14 +703,41 @@ class GenericDetails {
};
llvm::raw_ostream &operator<<(llvm::raw_ostream &, const GenericDetails &);
+// Used for OpenMP DECLARE REDUCTION, it holds the information
+// needed to resolve which declaration (there could be multiple
+// with the same name) to use for a given type.
+class UserReductionDetails {
+public:
+ using TypeVector = std::vector<const DeclTypeSpec *>;
+ using DeclInfo = std::variant<const parser::OpenMPDeclareReductionConstruct *,
+ const parser::OmpMetadirectiveDirective *>;
+ using DeclVector = std::vector<DeclInfo>;
+
+ UserReductionDetails() = default;
+
+ void AddType(const DeclTypeSpec *type) { typeList_.push_back(type); }
----------------
Leporacanthicus wrote:
:+1:
https://github.com/llvm/llvm-project/pull/131628
More information about the flang-commits
mailing list