[llvm-branch-commits] [clang] [CIR] Add options to emit ClangIR and enable the ClangIR pipeline (PR #89030)

Bruno Cardoso Lopes via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 24 15:17:09 PDT 2024


================
@@ -2876,6 +2876,15 @@ def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Gr
 def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
 def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group<f_Group>,
   HelpText<"Force linking the clang builtins runtime library">;
+
+/// ClangIR-specific options - BEGIN
+def fclangir_enable : Flag<["-"], "fclangir-enable">, Visibility<[ClangOption, CC1Option]>,
+  Group<f_Group>, HelpText<"Use ClangIR pipeline to compile">,
+  MarshallingInfoFlag<FrontendOpts<"UseClangIRPipeline">>;
+def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>,
----------------
bcardosolopes wrote:

My preference is to match current `-emit-llvm` behavior (i.e. be a driver level flag). It makes it convenient for us to just replace `-emit-llvm` with `-emit-cir` in workflows that currently expect LLVM output. If someone fixes `-emit-llvm` someday (which I find unlikely), we could then do the same for CIR. If this is a over my dead body argument for you, then whatever is fine, just wanna make sure I express what I believe is the right approach.

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


More information about the llvm-branch-commits mailing list