-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix a couple of places in the IRGen where we still don't use interface types #7112
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
Tests? |
Oh sorry didn't see WIP! |
@slavapestov Could you have a quick look? I found a couple of places in the IRGen, where we were not using interface types for deserialized things yet. I essentially replaced: |
@gottesmm I'm not sure how to test it. It kind of happens only on deserialized types in certain cases... I need to see if I can come up with something small that can test it. |
A test that builds a module and imports it from another module would work. We absolutely need more multi-file tests since issues keep coming up again and again. |
@slavapestov Importing from a different module is a prerequisite, but it is not enough, because this bug only happens if you try to emit the metadata for types from a different module. We normally don't do it. It discovered it only because I was doing some experiments on my local branch. |
@swiftix It's strange that we would attempt to do that. Is this with imported types? Or subclassing a class from another module? |
@slavapestov No, we don't try to do that. My new code tries to do that, because I play with whole program optimization. I try to transitively import everything needed into the current module, perform the optimizations, dead function elimination and then emit the IR. Thus I need to emit the metadata for all the types from the stdlib that are used by the user program. |
But the stdlib already has the metadata for all those types, why are you emitting it again? |
I'm emitting this "instead", not "again"! I try to create small static executables, which are not dependent on the static stdlib, because the static stdlib is 6MB big and is essentially one huge Swift.o file. So, I'm trying to include into the user module a copy of that part of the stdlib, which is actually needed by the user program. This includes functions, types, etc. I need to emit the IR metadata just as it would be done when we compile the stdlib. |
I see. |
@slavapestov So, OK to merge? Semantically it seems the right thing to do, or? |
@swift-ci please smoke test |
Discussed with @slavapestov and decided to merge. |
No description provided.