Skip to content

Commit eecb741

Browse files
committed
[SwiftSyntax] Avoid linking clangAST in SwiftSyntaxParserLib build
`printClangDeclName` introduced another use of the clang AST in `swiftAST`, remove it by returning early if we are only building the parser library.
1 parent 91966de commit eecb741

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/DiagnosticEngine.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,10 @@ static bool isMainActor(Type type) {
570570

571571
void swift::printClangDeclName(const clang::NamedDecl *ND,
572572
llvm::raw_ostream &os) {
573+
#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
574+
return; // not needed for the parser library.
575+
#endif
576+
573577
ND->getNameForDiagnostic(os, ND->getASTContext().getPrintingPolicy(), false);
574578
}
575579

0 commit comments

Comments
 (0)