Commit Graph

18 Commits

Author SHA1 Message Date
Chris Lattner
0c8deef48a move the list of sil diagnostic passes out to a "runSILDiagnosticPasses"
helper function which is shared by the compiler and the immediate mode
stuff.  This way, diagnostic passes are run on modules imported by "-i".

Also add include guards and clean up headers a lot.


Swift SVN r7568
2013-08-26 16:06:37 +00:00
Chris Lattner
41ea6ac780 refactor the interface to RunImmediately to pass down the CompilerInstance,
instead of a few parts of it.  No functionality change.


Swift SVN r7567
2013-08-26 15:50:31 +00:00
Michael Gottesman
b75d5003fa Fixed 2x instances where we were missing C++ editor identifiers on .h files and a mislabeled header file.
Swift SVN r7418
2013-08-21 19:28:45 +00:00
Dmitri Hrybenko
f92237b12a tools/swift: Refactor REPLEnvironment so that it uses libFrontend to create
the TranslationUnit


Swift SVN r6789
2013-08-01 00:03:36 +00:00
Joe Groff
49dfa58f37 REPL: Create a new MemoryBuffer for each input.
Instead of reusing a fixed-size buffer, which causes problems when error messages refer back to previous inputs and corrupts AST references in *LiteralExpr that point back into source buffers, allocate each REPL input into its own buffer with its own SourceMgr entry. Fixes <rdar://problem/13387167>, crashes when using :dump_ast on expressions containing integer/float literal expr nodes, and hopefully sporadic buildbot failures running the Interpreter/repl test.

Swift SVN r5470
2013-06-04 18:02:44 +00:00
Joe Groff
ad1c30539b Remove -no-sil-irgen option.
Swift SVN r4760
2013-04-17 00:48:36 +00:00
Dave Abrahams
ad12dd6f9e Style fix: Use prevailing const& placement
Swift SVN r4627
2013-04-07 01:35:24 +00:00
Chris Lattner
db522fe7db thoroughly rework how the REPL synthesizes code to print values. This centralizes the
logic in Sema (previously, some of it was in tools/Swift/Frontend.cpp) and eliminates
redundancy between expr and pattern printing.  This also eliminates most of the invalid
ASTs that the repl was producing (there is still one left).

This commit reenables the disabled REPL testcase from my last big change.



Swift SVN r4622
2013-04-06 20:05:46 +00:00
Dave Abrahams
3ec813c71b Explicitly pass an argv to LLVM's execution engine
This commit touches many more interfaces than you might expect.  Tant pis.

Swift SVN r4618
2013-04-06 03:40:32 +00:00
Dave Abrahams
19a590617a Add a "--" option that allows arguments to be passed to scripts
Swift SVN r4565
2013-04-01 22:47:24 +00:00
Joe Groff
1a8b35d383 REPL: Support -sil-irgen.
Add a 'startElem' option to SILModule::constructSIL so that it can be used with REPL input.

Swift SVN r4519
2013-03-28 18:38:29 +00:00
Joe Groff
25e370fcce Frontend: Pass down -O level in -i mode.
'-i' code was always getting emitted at -O2 regardless of the -O flag, which enables the "standard library hack" that pulls in IR for all of swift.swift. For -i optimization is often less important than responsiveness, so allow the optimization level to be specified by a flag and default to -O0 normally.

Swift SVN r4518
2013-03-28 17:56:29 +00:00
Doug Gregor
6c647535ad REPL: automatically run replApplicationMain() the first time it becomes available.
Now, importing AppKit (or anything that depends on it) under
-repl-run-loop will set up the environment to do interactive UIs.


Swift SVN r4230
2013-02-27 22:13:44 +00:00
Joe Groff
321af9f090 Some frontend cleanup.
Package up some useful REPL context into a header-able REPLContext class. Move the response metavar index there instead of having it as a gross mutable static variable.

Swift SVN r4203
2013-02-26 00:05:00 +00:00
Joe Groff
585a3b216a REPL: Add a -repl-run-loop mode.
This runs the REPL with the editline interactor in a separate thread while the main thread runs a CFRunLoop. The interactor thread then sends REPL inputs through a CFMessagePort which the main thread run loop responds to.

Swift SVN r4128
2013-02-21 18:09:57 +00:00
Joe Groff
662afeaeef Add '-sil-i' option to driver.
Will allow immediate execution through SIL-irgen when SIL-irgen actually exists. Also add NeedsOutput_{First,Last} symbols to the ActionType enum so that the insidious enum ordering significance there is more obvious.

Swift SVN r3757
2013-01-14 02:57:04 +00:00
Eli Friedman
dc213bca76 Implement basic REPL under swift -repl. Known demo-blockers: need error recovery, need better brace/paren handling, need to implement the "print" part of REPL.
Swift SVN r1452
2012-04-18 00:52:11 +00:00
Eli Friedman
15bc5df608 Rename Interpret* to immediate mode, which should be a bit more intuitive.
Swift SVN r1322
2012-04-04 20:47:21 +00:00