[clang] [Sema] Keep attribute lists in the order the attributes were parsed (PR #162714)

Henrik G. Olsson via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 9 14:00:50 PDT 2025


================
@@ -835,16 +835,16 @@ class DeclSpec {
   /// \endcode
   ///
   void addAttributes(const ParsedAttributesView &AL) {
-    Attrs.addAll(AL.begin(), AL.end());
+    Attrs.addAllPrepend(AL.begin(), AL.end());
   }
 
   bool hasAttributes() const { return !Attrs.empty(); }
 
   ParsedAttributes &getAttributes() { return Attrs; }
   const ParsedAttributes &getAttributes() const { return Attrs; }
 
-  void takeAttributesFrom(ParsedAttributes &attrs) {
-    Attrs.takeAllFrom(attrs);
+  void takeAttributesFromAppend(ParsedAttributes &attrs) {
----------------
hnrklssn wrote:

Sure. Also renamed `addAllAppend` and `addAllPrepend` to `appendAll` and `prependAll`.

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


More information about the cfe-commits mailing list