================
@@ -100,6 +100,12 @@ void AttributePool::takePool(AttributePool &pool) {
   pool.Attrs.clear();
 }
 
+void AttributePool::takeFrom(ParsedAttributesView &List, AttributePool &Pool) {
+  assert(&Pool != this && "AttributePool can't take attributes from itself");
+  llvm::for_each(List.AttrList, [&Pool](ParsedAttr *A) { Pool.remove(A); });
----------------
erichkeane wrote:

You mean reverse the order of the remove/add?  Based on `takeAllFrom` and 
`takeOneFrom` 
(https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Sema/ParsedAttr.h#L953),
 we are consistently inconsistent :)

In this case, I was working from `takeOneFrom` so I ended up in this order, but 
if there is a good reason to prefer one over the other, I can switch.

https://github.com/llvm/llvm-project/pull/83611
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to