Start mangling names of private declarations specially.

We currently mangle private declarations exactly like public declarations,
which means that private entities with the same name and same type will
have the same symbol even if defined in separate files.

This commit introduces a new mangling production, private-decl-name, which
includes a discriminator string to identify the file a decl came from.
Actually producing a unique string has not yet been implemented, nor
serialization, nor lookup using such a discriminator.

Part of rdar://problem/17632175.

Swift SVN r21598
This commit is contained in:
Jordan Rose
2014-08-30 00:17:18 +00:00
parent ab5fa3f3d1
commit 47658c87eb
15 changed files with 128 additions and 12 deletions

View File

@@ -1238,3 +1238,8 @@ Optional<BriefAndRawComment> ModuleFile::getCommentForDeclByUSR(StringRef USR) {
return *I;
}
StringRef ModuleFile::getDiscriminatorForPrivateValue(const ValueDecl *D) {
// FIXME: Actually implement this.
return FileContext->getParentModule()->Name.str();
}