-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Requestify getInterfaceType() in Name Only #27314
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
CodaFi
merged 5 commits into
swiftlang:master
from
CodaFi:an-interface-to-the-interface
Sep 24, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8d9629e
Requestify getInterfaceType() in Name Only
CodaFi ed18f47
Port getInterfaceType() patterns in libAST
CodaFi f053f9c
Port getInterfaceType() patterns in libSema
CodaFi 792e1db
Port getInterfaceType() patterns in ancillary libraries
CodaFi 1233cdf
Update SourceKit for getInterfaceType() changes
CodaFi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2697,7 +2697,13 @@ bool ValueDecl::hasInterfaceType() const { | |
} | ||
|
||
Type ValueDecl::getInterfaceType() const { | ||
assert(hasInterfaceType() && "No interface type was set"); | ||
if (!hasInterfaceType()) { | ||
// Our clients that don't register the lazy resolver are relying on the | ||
// fact that they can't pull an interface type out to avoid doing work. | ||
// This is a necessary evil until we can wean them off. | ||
if (auto resolver = getASTContext().getLazyResolver()) | ||
resolver->resolveDeclSignature(const_cast<ValueDecl *>(this)); | ||
} | ||
return TypeAndAccess.getPointer(); | ||
} | ||
|
||
|
@@ -3241,7 +3247,7 @@ Type TypeDecl::getDeclaredInterfaceType() const { | |
selfTy, const_cast<AssociatedTypeDecl *>(ATD)); | ||
} | ||
|
||
Type interfaceType = hasInterfaceType() ? getInterfaceType() : nullptr; | ||
Type interfaceType = getInterfaceType(); | ||
if (interfaceType.isNull() || interfaceType->is<ErrorType>()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It won't be null now? |
||
return interfaceType; | ||
|
||
|
@@ -6549,17 +6555,6 @@ static bool requiresNewVTableEntry(const AbstractFunctionDecl *decl) { | |
if (decl->isEffectiveLinkageMoreVisibleThan(base)) | ||
return true; | ||
|
||
// FIXME: Remove this once getInterfaceType() has been request-ified. | ||
if (!decl->hasInterfaceType()) { | ||
ctx.getLazyResolver()->resolveDeclSignature( | ||
const_cast<AbstractFunctionDecl *>(decl)); | ||
} | ||
|
||
if (!base->hasInterfaceType()) { | ||
ctx.getLazyResolver()->resolveDeclSignature( | ||
const_cast<AbstractFunctionDecl *>(base)); | ||
} | ||
|
||
// If the method overrides something, we only need a new entry if the | ||
// override has a more general AST type. However an abstraction | ||
// change is OK; we don't want to add a whole new vtable entry just | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need the assert after this call I think.