[clang] [NFC][Clang][FMV] Refactor sema checking of target_version/clones attributes. (PR #149067)

Tomas Matheson via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 18 06:50:30 PDT 2025


================
@@ -1535,4 +1535,91 @@ bool SemaARM::areLaxCompatibleSveTypes(QualType FirstType,
          IsLaxCompatible(SecondType, FirstType);
 }
 
+enum FirstParam { Unsupported, Duplicate, Unknown };
+enum SecondParam { None, CPU, Tune };
+enum ThirdParam { Target, TargetClones, TargetVersion };
----------------
tmatheson-arm wrote:

The enums are fine, I just don't like the fact that they add `None`, `Unsupported` etc to the top-level namespace. There is nothing indicating that they are intended for diagnostics. Something like this would be fine:

```suggestion
namespace FmvDiagParams {
  // Enums for the diagnostics for target_versions and target_clones
  enum FirstParam { Unsupported, Duplicate, Unknown };
  enum SecondParam { None, CPU, Tune };
  enum ThirdParam { Target, TargetClones, TargetVersion };
}
```

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


More information about the cfe-commits mailing list