Skip to content

Commit c9c3956

Browse files
committed
ASTPrinter: Minor cleanups
1 parent 3e0a5fc commit c9c3956

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

include/swift/AST/ASTPrinter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ StringRef getAccessorKindString(AccessorKind value);
389389
/// for the compiler features that it uses. Note that printBody
390390
/// may be called multiple times if the declaration uses suppressible
391391
/// features.
392-
bool printWithCompatibilityFeatureChecks(ASTPrinter &printer,
392+
void printWithCompatibilityFeatureChecks(ASTPrinter &printer,
393393
PrintOptions &options,
394394
Decl *decl,
395395
llvm::function_ref<void()> printBody);

lib/AST/ASTPrinter.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,12 +2588,12 @@ void PrintAST::printSynthesizedExtensionImpl(Type ExtendedType,
25882588
// protocol Foo {}
25892589
// extension Foo where <requirments from ExtDecl> { ... }
25902590
// struct Bar {}
2591-
// extension Bar: Foo where <requirments from TransformContext> { ... }
2591+
// extension Bar: Foo where <requirements from TransformContext> { ... }
25922592
//
25932593
// should produce a synthesized extension of Bar with both sets of
2594-
// requirments:
2594+
// requirements:
25952595
//
2596-
// extension Bar where <requirments from ExtDecl+TransformContext { ... }
2596+
// extension Bar where <requirements from ExtDecl+TransformContext> { ... }
25972597
//
25982598
if (!printCombinedRequirementsIfNeeded())
25992599
printDeclGenericRequirements(ExtDecl);
@@ -3208,21 +3208,21 @@ static void printWithSuppressibleFeatureChecks(ASTPrinter &printer,
32083208
/// #endif
32093209
/// #endif
32103210
/// ```
3211-
bool swift::printWithCompatibilityFeatureChecks(ASTPrinter &printer,
3211+
void swift::printWithCompatibilityFeatureChecks(ASTPrinter &printer,
32123212
PrintOptions &options,
32133213
Decl *decl,
32143214
llvm::function_ref<void()> printBody) {
32153215
// A single accessor does not get a feature check,
32163216
// it should go around the whole decl.
32173217
if (isa<AccessorDecl>(decl)) {
32183218
printBody();
3219-
return false;
3219+
return;
32203220
}
32213221

32223222
FeatureSet features = getUniqueFeaturesUsed(decl);
32233223
if (features.empty()) {
32243224
printBody();
3225-
return false;
3225+
return;
32263226
}
32273227

32283228
// Enter a `#if` for the required features, if any.
@@ -3252,8 +3252,6 @@ bool swift::printWithCompatibilityFeatureChecks(ASTPrinter &printer,
32523252
printer.printNewline();
32533253
printer << "#endif";
32543254
}
3255-
3256-
return true;
32573255
}
32583256

32593257
void PrintAST::visitExtensionDecl(ExtensionDecl *decl) {

0 commit comments

Comments
 (0)