[flang-commits] [flang] [flang][cli] Add diagnostic flags to the CLI (PR #142022)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Sun Jun 8 10:48:24 PDT 2025


================
@@ -108,26 +106,51 @@ class LanguageFeatureControl {
     warnAllUsage_ = false;
     warnUsage_.clear();
   }
-
+  void DisableAllWarnings() {
+    disableAllWarnings_ = true;
+    DisableAllNonstandardWarnings();
+    DisableAllUsageWarnings();
+  }
+  bool AreWarningsDisabled() const { return disableAllWarnings_; }
   bool IsEnabled(LanguageFeature f) const { return !disable_.test(f); }
-  bool ShouldWarn(LanguageFeature f) const {
-    return (warnAllLanguage_ && f != LanguageFeature::OpenMP &&
-               f != LanguageFeature::OpenACC && f != LanguageFeature::CUDA) ||
-        warnLanguage_.test(f);
+  bool ShouldWarn(LanguageFeature f) const { return warnLanguage_.test(f); }
+  bool ShouldWarn(UsageWarning w) const { return warnUsage_.test(w); }
+  // Cli options
+  bool ApplyCliOption(std::string input);
+  void AddAlternativeCliSpelling(LanguageFeature f, std::string input) {
----------------
eugeneepshteyn wrote:

Is `AddAlternativeCliSpelling()` used anywhere? If it is, `std::string input` shouldn't be passed by value, since it would cause extra temporary creation with potential allocation/deallocation. `const std::string& input`, perhaps?

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


More information about the flang-commits mailing list