[Macros] Private discriminators for outermost-private MacroExpansionDecl (#64813)

Add a private discriminator to the mangling of an outermost-private `MacroExpansionDecl` so that declaration macros in different files won't have colliding macro expansion buffer names.

rdar://107462515
This commit is contained in:
Richard Wei
2023-03-31 20:36:29 -07:00
committed by GitHub
parent 77bd312a88
commit eb8e984b97
24 changed files with 84 additions and 49 deletions

View File

@@ -363,7 +363,7 @@ public:
SmallVectorImpl<ValueDecl*> &results) const override;
virtual StringRef
getFilenameForPrivateDecl(const ValueDecl *decl) const override;
getFilenameForPrivateDecl(const Decl *decl) const override;
virtual TypeDecl *lookupLocalType(StringRef MangledName) const override;
@@ -456,7 +456,7 @@ public:
virtual void loadDependenciesForTestable(SourceLoc diagLoc) const override;
Identifier getDiscriminatorForPrivateValue(const ValueDecl *D) const override;
Identifier getDiscriminatorForPrivateDecl(const Decl *D) const override;
virtual StringRef getFilename() const override;