mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -609,11 +609,10 @@ void ModuleFile::getImportDecls(SmallVectorImpl<Decl *> &Results) {
|
||||
SourceLoc(), importPath.get());
|
||||
ID->setModule(M);
|
||||
if (Dep.isExported())
|
||||
ID->getAttrs().add(
|
||||
new (Ctx) ExportedAttr(/*IsImplicit=*/false));
|
||||
ID->addAttribute(new (Ctx) ExportedAttr(/*IsImplicit=*/false));
|
||||
if (Dep.isImplementationOnly())
|
||||
ID->getAttrs().add(
|
||||
new (Ctx) ImplementationOnlyAttr(/*IsImplicit=*/false));
|
||||
ID->addAttribute(new (Ctx)
|
||||
ImplementationOnlyAttr(/*IsImplicit=*/false));
|
||||
|
||||
ImportDecls.push_back(ID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user