[flang][lowering] Ignore compiler directives
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Fri, 10 Jun 2022 15:26:13 +0000 (15:26 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Fri, 10 Jun 2022 15:26:49 +0000 (15:26 +0000)
This patch simply replaces a `TODO` with a warning.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D127415

flang/lib/Lower/Bridge.cpp
flang/test/Lower/compiler-directive.f90 [new file with mode: 0644]

index 159fe5a..eb58c4e 100644 (file)
@@ -1445,7 +1445,7 @@ private:
   }
 
   void genFIR(const Fortran::parser::CompilerDirective &) {
-    TODO(toLocation(), "CompilerDirective lowering");
+    mlir::emitWarning(toLocation(), "ignoring all compiler directives");
   }
 
   void genFIR(const Fortran::parser::OpenACCConstruct &acc) {
diff --git a/flang/test/Lower/compiler-directive.f90 b/flang/test/Lower/compiler-directive.f90
new file mode 100644 (file)
index 0000000..72d85ba
--- /dev/null
@@ -0,0 +1,13 @@
+! RUN: bbc %s -o - 2>&1 | FileCheck %s
+! RUN: %flang_fc1 -emit-fir %s -o - 2>&1 | FileCheck %s
+
+! CHECK: ignoring all compiler directives
+
+MODULE test_mod
+  CONTAINS
+  SUBROUTINE foo()
+    REAL :: var
+  !DIR$ VECTOR ALIGNED
+    var = 1.
+  END SUBROUTINE foo
+END MODULE test_mod