[PATCH] D63607: [clang][driver] Add basic --driver-mode=flang support for fortran

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 11:12:07 PDT 2019


thakis added a comment.

Thanks!

Looks like it's just the `-E` test that's causing problems; the test passes with that disabled:

  $ git diff
  diff --git a/clang/test/Driver/flang/flang.f90 b/clang/test/Driver/flang/flang.f90
  index 97e4847f843..4cbc2cd8754 100644
  --- a/clang/test/Driver/flang/flang.f90
  +++ b/clang/test/Driver/flang/flang.f90
  @@ -1,6 +1,5 @@
   ! D63607 made mac builders unhappy by failing this test, and it isn't
   ! yet obvious why. Mark as unsupported as a temporary measure.
  -! UNSUPPORTED: darwin
   
   ! Check that flang -fc1 is invoked when in --driver-mode=flang.
   
  @@ -21,10 +20,9 @@
   
   ! Check that f90 files are not treated as "previously preprocessed"
   ! ... in --driver-mode=flang.
  -! RUN: %clang --driver-mode=flang -### -E                  %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-E %s
  +! RUN: %clang --driver-mode=flang -###                   %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-E %s
   ! CHECK-E-NOT: previously preprocessed input
  -! CHECK-E-DAG: "-E"
  -! CHECK-E-DAG: "-o" "-"
  +! CHECK-E-DAG: "-o"
   
   ! RUN: %clang --driver-mode=flang -### -emit-ast           %s 2>&1 | FileCheck --check-prefixes=ALL,CHECK-EMIT-AST %s
   ! CHECK-EMIT-AST-DAG: "-triple"

I'll debug a bit more.



================
Comment at: clang/lib/Driver/Driver.cpp:4883
+  // And say "no" if this is not a kind of action flang understands.
+  if (!isa<PreprocessJobAction>(JA) && !isa<CompileJobAction>(JA) && !isa<BackendJobAction>(JA))
+    return false;
----------------
(please run clang-format on your new code -- it might also answer why some enums have a comma after the last entry ;) )


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63607/new/

https://reviews.llvm.org/D63607





More information about the cfe-commits mailing list