Skip to content

Commit fb1c71c

Browse files
committed
[ASTPrinter] Skip SPI extensions too
1 parent 65a0dc1 commit fb1c71c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@ PrintOptions PrintOptions::printSwiftInterfaceFile(bool preferTypeRepr,
145145
if (D->getAttrs().hasAttribute<ImplementationOnlyAttr>())
146146
return false;
147147

148-
// Skip anything that isn't 'public' or '@usableFromInline',
149-
// or SPI if desired.
148+
// Skip SPI decls if `PrintSPIs`.
149+
if (!options.PrintSPIs && D->isSPI())
150+
return false;
151+
152+
// Skip anything that isn't 'public' or '@usableFromInline'.
150153
if (auto *VD = dyn_cast<ValueDecl>(D)) {
151154
if (!isPublicOrUsableFromInline(VD)) {
152155
// We do want to print private stored properties, without their
@@ -155,10 +158,6 @@ PrintOptions PrintOptions::printSwiftInterfaceFile(bool preferTypeRepr,
155158
if (contributesToParentTypeStorage(ASD))
156159
return true;
157160

158-
// Always print SPI decls if `PrintSPIs`.
159-
if (options.PrintSPIs && VD->isSPI())
160-
return true;
161-
162161
return false;
163162
}
164163
}

0 commit comments

Comments
 (0)