[clang] [CIR] Initial implementation of lowering CIR to MLIR (PR #127835)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 19 10:07:26 PST 2025


================
@@ -2958,6 +2958,8 @@ defm clangir : BoolFOption<"clangir",
   BothFlags<[], [ClangOption, CC1Option], "">>;
 def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>,
   Group<Action_Group>, HelpText<"Build ASTs and then lower to ClangIR">;
+def emit_cir_mlir : Flag<["-"], "emit-cir-mlir">, Visibility<[CC1Option]>, Group<Action_Group>,
----------------
andykaylor wrote:

In the incubator this is just "-emit-mlir" but that's claimed below by flang as an alias for "-emit-fir". The incubator just has that line commented out. I find it a bit disturbing that flang is affecting the namespace for clang command-line options, but I guess it's good to have some alignment between the two drivers.

I'm not entirely happy with the name I used here, as it seems to imply the opposite of what it is. It's emitting MLIR with no ClangIR dialect, but I'm not sure how to represent that without a very long name. Suggestions?

https://github.com/llvm/llvm-project/pull/127835


More information about the cfe-commits mailing list