================
@@ -3139,9 +3139,17 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, 
ArgList &Args,
   if (Opts.ProgramAction != frontend::GenerateModule && Opts.IsSystemModule)
     Diags.Report(diag::err_drv_argument_only_allowed_with) << "-fsystem-module"
                                                            << "-emit-module";
-  if (Args.hasArg(OPT_fclangir) || Args.hasArg(OPT_emit_cir))
+  if (Args.hasArg(OPT_fclangir))
     Opts.UseClangIRPipeline = true;
 
+#if CLANG_ENABLE_CIR
+  if (!Args.hasArg(OPT_fclangir) && Args.hasArg(OPT_emit_cir))
+    Diags.Report(diag::err_drv_emit_cir_without_fclangir);
+#else
+  if (Args.hasArg(OPT_emit_cir))
----------------
andykaylor wrote:

We should also report an error if `-fclangir` is used in this case. Currently, 
we silently do nothing.

https://github.com/llvm/llvm-project/pull/166916
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to