Merge pull request #80074 from dylansturg/objc_enum_refs

The Error enum synthesized declarations, e.g. the struct and its static accessors, should generally appear to be identical to the underlying Clang definitions. There are some specific use cases where the synthesized declarations are necessary though.

I've added an option for USR generation to override the Clang node and emit the USR of the synthesized Swift declaration. This is used by SwiftDocSupport so that the USRs of the synthesized declarations are emitted.

Fixes 79912
This commit is contained in:
Dylan Sturgeon
2025-03-25 04:21:21 -07:00
committed by GitHub
parent ea225d5485
commit 2c8e337f25
13 changed files with 138 additions and 32 deletions

View File

@@ -898,8 +898,9 @@ bool SwiftLangSupport::printDisplayName(const swift::ValueDecl *D,
return false;
}
bool SwiftLangSupport::printUSR(const ValueDecl *D, llvm::raw_ostream &OS) {
return ide::printValueDeclUSR(D, OS);
bool SwiftLangSupport::printUSR(const ValueDecl *D, llvm::raw_ostream &OS,
bool distinguishSynthesizedDecls) {
return ide::printValueDeclUSR(D, OS, distinguishSynthesizedDecls);
}
bool SwiftLangSupport::printDeclTypeUSR(const ValueDecl *D, llvm::raw_ostream &OS) {