-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Rework the integrated REPL to use separate modules for every line #19485
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
Ah, the pre-Swift-1 days... -enable-source-import may come back in some form some day, but it's not supported now.
It's still not working very well (23 failing tests, 1 UXPASS), but at least I can run it again. We probably need a bot.
This was full of cruft to begin with, and -enable-source-import has plenty of other problems. Remove support for IRGen-ing those other modules.
Useful in the LLDB REPL, and also for what I'm about to do to the integrated REPL.
@swift-ci Please test |
@swift-ci Please asan test |
Cool! We could also pull the “make everything public/open” walker out of lldb and into the frontend if we really wanted to... |
lib/Immediate/REPL.cpp
Outdated
|
||
SourceFile::ImportOptions ImportOpts; | ||
ImportOpts |= SourceFile::ImportFlags::Exported; | ||
REPLInputFile.addImports({{{{}, MostRecentModule}, {}}}); |
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.
I guess I should clean up this ridiculous initializer list.
I don't really know who should review this, so I'm going to nominate @slavapestov as an all-arounder and already-commenter. |
...like LLDB does, instead of parsing into a single SourceFile. This does break some functionality: - no more :dump_ast - no redeclaration checking, but no shadowing either---redeclarations just become ambiguous - pretty much requires EnableAccessControl to be off, since we don't walk decls to promote them to 'public' ...but it allows us to remove a bit of longstanding support for type-checking / SILGen-ing / IRGen-ing only part of a SourceFile that was only used by the integrated REPL. ...which, need I remind everyone, is still /deprecated/...but sometimes convenient. So most of it still works.
This was only used by the integrated REPL, and is now a dead option. The "StartElem" option for performTypeChecking is still used for reading SIL files, which have AST and SIL blocks alternate.
Parsing additional declarations from a separate buffer into an existing SourceFile is definitely a hack, but again, the integrated REPL is deprecated and does not deserve real attention.
No functionality change. Unfortunately we still need the flag in SILModule itself because of the ability to create an empty SILModule and parse SIL into it incrementally, which can happen before there's a FileUnit to use as the associated DeclContext instead of a CompilerInstance's main module.
472d4e1
to
a9bbaf7
Compare
@swift-ci Please smoke test |
...like LLDB does, instead of parsing into a single SourceFile. This does break some functionality:
:dump_ast
public
like the proper REPL...but it allows us to remove a bit of longstanding support for type-checking / SILGen-ing / IRGen-ing only part of a SourceFile that was only used by the integrated REPL.
...which, need I remind everyone, is still deprecated...but sometimes convenient. So most of it still works.
Also removes support for
-enable-source-import
in the JIT. This is the only part of this PR that should affect non-integrated-REPL uses.