[flang-commits] [clang] [flang] [flang][Driver] Support -fdiagnostics-color (PR #109210)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Thu Sep 19 02:25:54 PDT 2024


================
@@ -732,6 +732,12 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
   // to avoid warn_drv_unused_argument.
   Args.getLastArg(options::OPT_fcolor_diagnostics,
                   options::OPT_fno_color_diagnostics);
+  if (const Arg *A = Args.getLastArg(options::OPT_fdiagnostics_color_EQ)) {
+    StringRef Value(A->getValue());
+    if (Value != "always" && Value != "never" && Value != "auto")
+      D.Diag(diag::err_drv_invalid_argument_to_option)
+          << Value << A->getOption().getName();
+  }
----------------
kiranchandramohan wrote:

Should this code be shared with Clang?

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


More information about the flang-commits mailing list