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

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Sat Dec 28 01:17:47 PST 2024


================
@@ -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 OpenMPAssumesConstruct {
+  TUPLE_CLASS_BOILERPLATE(OpenMPAssumesConstruct);
+  std::tuple<Verbatim, OmpClauseList> t;
+  CharBlock source;
+};
+
+struct OmpBeginAssumesDirective {
+  TUPLE_CLASS_BOILERPLATE(OmpBeginAssumesDirective);
+  std::tuple<Verbatim, OmpClauseList> t;
+  CharBlock source;
+};
+
+struct OmpEndAssumesDirective {
+  WRAPPER_CLASS_BOILERPLATE(OmpEndAssumesDirective, Verbatim);
+  CharBlock source;
+};
+
+//    structured-block
+// ...
+struct OpenMPAssumesPartConstruct {
+  WRAPPER_CLASS_BOILERPLATE(OpenMPAssumesPartConstruct, Block);
+  CharBlock source;
+};
+
+struct OpenMPBeginAssumesConstruct {
+  TUPLE_CLASS_BOILERPLATE(OpenMPBeginAssumesConstruct);
+  std::tuple<OmpBeginAssumesDirective, OpenMPAssumesPartConstruct,
+      OmpEndAssumesDirective>
+      t;
+  CharBlock source;
+};
----------------
kiranchandramohan wrote:

In the standard `begin assumes` looks it is only for C++.

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


More information about the flang-commits mailing list