[flang-commits] [flang] 494cd9b - [flang][lowering] Ignore compiler directives

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Fri Jun 10 08:27:02 PDT 2022


Author: Andrzej Warzynski
Date: 2022-06-10T15:26:49Z
New Revision: 494cd9b6fc7ff3e9d9bfad08cfd329763b799749

URL: https://github.com/llvm/llvm-project/commit/494cd9b6fc7ff3e9d9bfad08cfd329763b799749
DIFF: https://github.com/llvm/llvm-project/commit/494cd9b6fc7ff3e9d9bfad08cfd329763b799749.diff

LOG: [flang][lowering] Ignore compiler directives

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 at nvidia.com>

Reviewed By: kiranchandramohan

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

Added: 
    flang/test/Lower/compiler-directive.f90

Modified: 
    flang/lib/Lower/Bridge.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 159fe5a32700..eb58c4ee0634 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -1445,7 +1445,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
   }
 
   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
index 000000000000..72d85ba5159a
--- /dev/null
+++ b/flang/test/Lower/compiler-directive.f90
@@ -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


        


More information about the flang-commits mailing list