[PATCH] D118985: [flang][driver] Add support for `-emit-mlir`

Kiran Chandramohan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 7 03:49:55 PST 2022


kiranchandramohan added a comment.

Few Nits/questions.



================
Comment at: flang/lib/Frontend/FrontendActions.cpp:69
+
+  // Create a LoweringBridge
+  auto &defKinds = ci.invocation().semanticsContext().defaultKinds();
----------------
Nit: Can we remove the three autos below?


================
Comment at: flang/lib/Frontend/FrontendActions.cpp:419
+
+  // ... otherwise, print to a file.
+  auto os{ci.CreateDefaultOutputFile(
----------------
Nit: Should we test the existence of such a file?


================
Comment at: flang/lib/Frontend/FrontendActions.cpp:420
+  // ... otherwise, print to a file.
+  auto os{ci.CreateDefaultOutputFile(
+      /*Binary=*/true, /*InFile=*/GetCurrentFileOrBufferName(), "mlir")};
----------------
Nit: can we remove auto?


================
Comment at: flang/test/Driver/emit-mlir.f90:1
+! The the `-emit-fir` option
+
----------------
Nit: The the


================
Comment at: flang/test/Driver/syntax-only.f90:16
-! FSYNTAX_ONLY: IF statement is not allowed in IF statement
-! FSYNTAX_ONLY_NEXT: Semantic errors in {{.*}}syntax-only.f90
-
----------------
Nit: Do you have another test for `fsyntax-only`?


================
Comment at: flang/test/Driver/syntax-only.f90:23
+! CHECK-NOT: error
 ! NO_FSYNTAX_ONLY: error: code-generation is not available yet
 
----------------
Do we currently run the stages before codegen and then issue this error?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118985



More information about the cfe-commits mailing list