Skip to content

Commit 21e1fc4

Browse files
committed
[AST/ASTMangler] Fix linker error for SWIFT_BUILD_ONLY_SYNTAXPARSERLIB build
With such a build we avoid linking the `clangAST` library.
1 parent 685d35b commit 21e1fc4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,10 @@ std::string ASTMangler::mangleTypeAsUSR(Type Ty) {
520520

521521
std::string ASTMangler::mangleDeclAsUSR(const ValueDecl *Decl,
522522
StringRef USRPrefix) {
523+
#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
524+
return std::string(); // not needed for the parser library.
525+
#endif
526+
523527
DWARFMangling = true;
524528
beginManglingWithoutPrefix();
525529
llvm::SaveAndRestore<bool> allowUnnamedRAII(AllowNamelessEntities, true);

0 commit comments

Comments
 (0)