[PATCH] D119012: [flang][driver] Add support for the `-emit-llvm` option

Diana Picus via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 7 03:44:50 PST 2022


rovka added inline comments.


================
Comment at: flang/include/flang/Frontend/FrontendOptions.h:37
 
+  /// Emit a .llvm file
+  EmitLLVM,
----------------
Shouldn't this be .ll?


================
Comment at: flang/lib/Frontend/FrontendActions.cpp:421
+  // Set-up the MLIR pass manager
+  fir::setTargetTriple(*mlirModule_, "native");
+  auto &defKinds = ci.invocation().semanticsContext().defaultKinds();
----------------
Nit: Should we assert that mlirModule exists?
Also, why doesn't it already have a triple and a kind mapping?


================
Comment at: flang/lib/Frontend/FrontendActions.cpp:464
+  if (ci.IsOutputStreamNull()) {
+    // Lower from the LLVM dialect to LLVM IR
+    os = ci.CreateDefaultOutputFile(
----------------
This looks like an obsolete comment.


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



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119012



More information about the cfe-commits mailing list