[flang] [llvm] [FLANG][OpenMP]Add frontend support for ASSUME and ASSUMES (PR #120770)

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 12:00:04 PST 2025


================
@@ -4174,6 +4215,49 @@ struct OmpClauseList {
 
 // --- Directives and constructs
 
+// Ref: [5.2: 213-216]
+//
+// assume-construct ->
+//   ASSUME absent-clause | contains-clause | holds-clause | no-openmp-clause |
+//          no-openmp-routines-clause | no-parallelism-clause
+struct OpenMPAssumeConstruct {
+  TUPLE_CLASS_BOILERPLATE(OpenMPAssumeConstruct);
+  std::tuple<Verbatim, OmpClauseList> t;
+  CharBlock source;
+};
+
+struct OpenMPDeclarativeAssumes {
+  TUPLE_CLASS_BOILERPLATE(OpenMPDeclarativeAssumes);
+  std::tuple<Verbatim, OmpClauseList> t;
+  CharBlock source;
+};
+
+struct OmpAssumesDirective {
+  TUPLE_CLASS_BOILERPLATE(OmpAssumesDirective);
+  std::tuple<Verbatim, OmpClauseList> t;
+  CharBlock source;
+};
+
+struct OmpEndAssumesDirective {
+  WRAPPER_CLASS_BOILERPLATE(OmpEndAssumesDirective, Verbatim);
+  CharBlock source;
+};
+
+//    structured-block
+// ...
+struct OmpAssumesPartConstruct {
+  WRAPPER_CLASS_BOILERPLATE(OmpAssumesPartConstruct, Block);
+  CharBlock source;
+};
----------------
kparzysz wrote:

Do we need this class?  Could we just have a `Block` in the construct?

https://github.com/llvm/llvm-project/pull/120770


More information about the llvm-commits mailing list