================
@@ -898,15 +899,21 @@ static void defineHLSLInterlockedFunc(Sema &S, 
NamespaceDecl *NS,
 
   for (QualType ElemTy : Elems)
     for (LangAS AS : AddrSpaces)
-      for (bool ThreeArg : {false, true})
+      for (bool ThreeArg : {false, true}) {
+        if (RequiresOriginalValue && !ThreeArg)
+          continue;
         buildAtomicOverload(S, NS, FuncName, BuiltinName, ElemTy, AS, 
ThreeArg);
+      }
----------------
hekota wrote:

```suggestion
      if (!RequiresOriginalValue)
        buildAtomicOverload(S, NS, FuncName, BuiltinName, ElemTy, AS, 
/*ThreeArg*/ false);
      buildAtomicOverload(S, NS, FuncName, BuiltinName, ElemTy, AS, 
/*ThreeArg*/ true);
```
Suggestion. Looping over {false, true} and then conditionally skipping over one 
iteration feels a little clumsy.

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

Reply via email to