Default DeclAttributes::getAttributes to skipping invalid attributes.

This matches the singular 'getAttribute', and all three current users
of this API were passing 'false' here anyway. No functionality change.
This commit is contained in:
Jordan Rose
2017-03-09 14:10:25 -08:00
parent 3e45121b59
commit f068ddf1e3
3 changed files with 5 additions and 6 deletions

View File

@@ -376,11 +376,10 @@ SILFunction *SILModule::getOrCreateFunction(SILLocation loc,
F->setClangNodeOwner(decl);
auto Attrs = decl->getAttrs();
for (auto *A : Attrs.getAttributes<SemanticsAttr, false /*AllowInvalid*/>())
for (auto *A : Attrs.getAttributes<SemanticsAttr>())
F->addSemanticsAttr(cast<SemanticsAttr>(A)->Value);
for (auto *A :
Attrs.getAttributes<SpecializeAttr, false /*AllowInvalid*/>()) {
for (auto *A : Attrs.getAttributes<SpecializeAttr>()) {
auto *SA = cast<SpecializeAttr>(A);
auto kind = SA->getSpecializationKind() ==
SpecializeAttr::SpecializationKind::Full