[clang] [X86] Relax AVX ABI warning on internal functions (PR #157570)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 11 07:13:31 PDT 2025


================
@@ -1513,12 +1513,17 @@ static void initFeatureMaps(const ASTContext &Ctx,
 
 static bool checkAVXParamFeature(DiagnosticsEngine &Diag,
                                  SourceLocation CallLoc,
+                                 const FunctionDecl &Callee,
                                  const llvm::StringMap<bool> &CallerMap,
                                  const llvm::StringMap<bool> &CalleeMap,
                                  QualType Ty, StringRef Feature,
                                  bool IsArgument) {
   bool CallerHasFeat = CallerMap.lookup(Feature);
   bool CalleeHasFeat = CalleeMap.lookup(Feature);
+  // No explicit features and the function is internal, be permissive.
+  if (!CallerHasFeat && !CalleeHasFeat && !Callee.isExternallyVisible())
+    return false;
----------------
rjmccall wrote:

Alright, thanks, that's all I can ask. Sounds like the generalization, then, is just that we're setting a precedent for any similar warning we add for other targets in the future.

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


More information about the cfe-commits mailing list