================
@@ -13467,7 +13467,15 @@ void ASTContext::forEachMultiversionedFunctionVersion(
     const FunctionDecl *FD,
     llvm::function_ref<void(FunctionDecl *)> Pred) const {
   assert(FD->isMultiVersion() && "Only valid for multiversioned functions");
-  llvm::SmallDenseSet<const FunctionDecl*, 4> SeenDecls;
+  // Function template specializations do not appear as separate results when
+  // looking up the name of their primary template. The target_clones attribute
+  // stores every version on the specialization itself, so visit it directly.
+  if (FD->isTargetClonesMultiVersion() &&
----------------
erichkeane wrote:

This part seems wrong.  The point here is we have to find all of the 
declarations, so just picking up the specialization here is wrong.

We should be propagating the attribute properly to the functions themselves. 

WE might need to be better about the 'lookup' in the case where we're looking 
for the specializations though, but we have to make sure we find ALL of them.

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

Reply via email to