Skip to content

Commit 31d5802

Browse files
committed
[Serialization] Remove a hack around serializing 'final'
We used to track final-ness separately from FinalAttr, but serialization didn't know how to handle that, so we synthesized a fake FinalAttr. However, final-ness (finality, I guess) is always kept in sync with FinalAttr now, so this check is no longer necessary. No functionality change.
1 parent c6f033d commit 31d5802

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

lib/Serialization/Serialization.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2814,13 +2814,6 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
28142814
for (auto Attr : D->getAttrs())
28152815
writeDeclAttribute(Attr);
28162816

2817-
if (auto VD = dyn_cast<ValueDecl>(D)) {
2818-
// Hack: synthesize a 'final' attribute if finality was inferred.
2819-
if (VD->isFinal() && !D->getAttrs().hasAttribute<FinalAttr>())
2820-
writeDeclAttribute(
2821-
new (D->getASTContext()) FinalAttr(/*Implicit=*/false));
2822-
}
2823-
28242817
if (auto *value = dyn_cast<ValueDecl>(D))
28252818
writeDiscriminatorsIfNeeded(value);
28262819

0 commit comments

Comments
 (0)