[PATCH] D48100: Append new attributes to the end of an AttributeList.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 14 04:11:34 PDT 2018


aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a comment.

Thank you for working on this odd detail of attributes!

Can you also simplify `hasSameOverloadableAttrs()` in ASTReaderDecl.cpp similar to what you did in SemaOverload.cpp (the copy seems spurious)?



================
Comment at: include/clang/Sema/AttributeList.h:767
     assert(newAttr->getNext() == nullptr);
-    newAttr->setNext(list);
-    list = newAttr;
+    addAllAtEnd(newAttr);
   }
----------------
This now means adding an attribute requires walking the entire attribute list to get to the end of it. I don't think this is a huge issue (attribute lists tend to be short), but it might be good to leave a comment explaining the issue and why it's acceptable for now.


Repository:
  rC Clang

https://reviews.llvm.org/D48100





More information about the cfe-commits mailing list