[AST] Introduce Decl::addAttribute

Introduce a convenience entrypoint that also calls `attachToDecl` on
the attribute, and migrate all existing uses of `getAttrs().add` onto
it.
This commit is contained in:
Hamish Knight
2025-10-16 11:21:54 +01:00
parent 0358e1eadd
commit 73710e3eef
45 changed files with 269 additions and 271 deletions

View File

@@ -804,7 +804,7 @@ public:
// the order in which previous implementations printed these attributes.
for (auto attr = clonedAttrs.rbegin(), end = clonedAttrs.rend();
attr != end; ++attr) {
extension->getAttrs().add(const_cast<DeclAttribute *>(*attr));
extension->addAttribute(const_cast<DeclAttribute *>(*attr));
}
ctx.evaluator.cacheOutput(ExtendedTypeRequest{extension},