[flang-commits] [flang] [flang] Implement !DIR$ VECTOR ALWAYS (PR #93830)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Sat Jun 8 03:43:49 PDT 2024


================
@@ -2508,8 +2531,30 @@ class FirConverter : public Fortran::lower::AbstractConverter {
     }
   }
 
-  void genFIR(const Fortran::parser::CompilerDirective &) {
-    // TODO
+  void attachLoopDirective(const Fortran::parser::CompilerDirective &dir,
+                           Fortran::lower::pft::Evaluation *e) {
+    while (e->isDirective()) {
+      e = e->lexicalSuccessor;
+    }
+
+    if (e->isA<Fortran::parser::NonLabelDoStmt>()) {
+      e->dirs.push_back(&dir);
+    } else {
+      fir::emitFatalError(toLocation(),
+                          "loop directive must appear before a loop");
----------------
kiranchandramohan wrote:

I have seen usage of loop related directives with OpenMP. If we are not fixing it here, can you add a TODO or "Not Yet Implemented message" for this case of mixing OpenMP and directives?

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


More information about the flang-commits mailing list