-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Use function signatures for SILDeclRefs in witness_tables, vtables and witness_method instructions #7078
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
Conversation
@swift-ci Please test |
Build failed |
*this << AMI->getType(); | ||
} | ||
void visitWitnessMethodInst(WitnessMethodInst *WMI) { | ||
if (WMI->isVolatile()) | ||
*this << "[volatile] "; | ||
*this << "$" << WMI->getLookupType() << ", " << WMI->getMember(); | ||
*this << "$" << WMI->getLookupType() << ", " << WMI->getMember() | ||
<< " : " << WMI->getMember().getDecl()->getInterfaceType(); |
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.
Does this need to use custom PrintOptions too?
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.
Hmm. Good question. The tests will show.
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.
They might not, if it happens not to hit this case in the stdlib either.
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.
Yeah. I could try to construct a use-case by hand using non-qualified types.
a73b816
to
db2a5e5
Compare
@swift-ci Please test OSX |
1 similar comment
@swift-ci Please test OSX |
@swift-ci please test OSX |
@swift-ci please test OS X |
@swift-ci please test |
Build failed |
Build failed |
db2a5e5
to
064b72f
Compare
@swift-ci please test OS X |
Build failed |
Build failed |
@jrose-apple Hmm. By looking at the failing tests I got the impression that we need to use the fully qualified names only for the types coming from the stdlib. If we use fully qualified names for user files, we get problems with sil-opt processing the -emit-sil output and the like, e.g. because it assumes by default "main" to be the name of the module. Of course, we could fix these tests by adding -module-name to the sil-opt command line options. WDYT? |
064b72f
to
4eca265
Compare
@swift-ci please test OS X |
Build failed |
@swift-ci Please test Linux |
@swift-ci please test Linux |
Build failed |
@jrose-apple Jordan, the failures on Linux are all like this:
The parser tries to treat the _AnyCollectionBox.Type as a function type I guess. In any case, probably these ivar_destroyers should be handled in a special way? What is actually the type of such a destroyer function? I guess it is not really |
I don't know; I don't know how ivar destroyers work. @slavapestov, @jckarter? |
That doesn't make sense. What if the file you're emitting SIL for imports some other library that defines a type with the same name? Maybe the only time it's okay to not qualify a type is when it's from the current module. You could either add a print option for that, or just print qualified types all the time. |
Right. I realized it yesterday, after I asked you. I introduced some changes so that we don't use qualified types for the types from the current module. It seems to work nicely. The last remaining issue seem to be those ivar destroyers. I need to understand what is so special about them and how to handle them properly. |
@swift-ci please test Linux |
1 similar comment
@swift-ci please test Linux |
Build failed |
@swift-ci Please smoke test Linux |
@swift-ci please smoke test Linux |
@swiftix Can you do a full test for this. So that the parse stdlib tests run? |
@swift-ci please smoke test OS X |
@swift-ci please smoke test |
@swift-ci please smoke test OS X |
1 similar comment
@swift-ci please smoke test OS X |
…d witness_method instructions. Textual SIL was sometimes ambiguous when SILDeclRefs were used, because the textual representation of SILDeclRefs was the same for functions that have the same name, but different signatures.
94fa2d7
to
8ad61d5
Compare
@swift-ci please test |
Build failed |
Build failed |
Textual SIL was sometimes ambiguous when SILDeclRefs were used, because the textual representation of SILDeclRefs was the same for functions that have the same name, but different signatures.
This patch fixes this problem.