Skip to content

Fix “descriminator” typos #34156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/IRGen/GenPointerAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ PointerAuthEntity::getDeclDiscriminator(IRGenModule &IGM) const {
"discriminator for foreign declaration not supported yet!");

// Special case: methods that are witnesses to Actor.enqueue(partialTask:)
// have their own descriminator, which is shared across all actor classes.
// have their own discriminator, which is shared across all actor classes.
if (constant.hasFuncDecl()) {
auto func = dyn_cast<FuncDecl>(constant.getFuncDecl());
if (func->isActorEnqueuePartialTaskWitness()) {
Expand Down
8 changes: 4 additions & 4 deletions lib/Serialization/Serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2489,11 +2489,11 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {

auto *storage = dyn_cast<AbstractStorageDecl>(value);
auto access = value->getFormalAccess();
// Emit the private descriminator for private decls.
// Emit the private discriminator for private decls.
// FIXME: We shouldn't need to encode this for /all/ private decls.
// In theory we can follow the same rules as mangling and only include
// the outermost private context.
bool shouldEmitPrivateDescriminator =
bool shouldEmitPrivateDiscriminator =
access <= swift::AccessLevel::FilePrivate &&
!value->getDeclContext()->isLocalContext();

Expand All @@ -2507,10 +2507,10 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
storage->getFormalAccess() >= swift::AccessLevel::Internal &&
storage->hasPrivateAccessor()));

if (shouldEmitFilenameForPrivate || shouldEmitPrivateDescriminator) {
if (shouldEmitFilenameForPrivate || shouldEmitPrivateDiscriminator) {
auto topLevelContext = value->getDeclContext()->getModuleScopeContext();
if (auto *enclosingFile = dyn_cast<FileUnit>(topLevelContext)) {
if (shouldEmitPrivateDescriminator) {
if (shouldEmitPrivateDiscriminator) {
Identifier discriminator =
enclosingFile->getDiscriminatorForPrivateValue(value);
unsigned abbrCode =
Expand Down