Commit Graph

14 Commits

Author SHA1 Message Date
Connor Wakamo
40b38c40b2 [driver] Reworked Driver::buildJobsForAction() so that it doesn’t create the same Job multiple times.
Since a Job may be reached through multiple paths in the dependency graph, we
need to include support for caching Jobs. (Currently, the cache maps
Action/ToolChain pairs to Jobs.)

As a result of these changes, Tool::constructJob() and
Driver::buildJobsForAction() return a plain Job *, instead of a
std::unique_ptr<Job>, since the Jobs returned by buildJobsForAction() no longer
need to be unique.

Swift SVN r12443
2014-01-17 00:47:21 +00:00
Connor Wakamo
3f4a6efd44 [driver] Pass -serialize-diagnostics to the frontend, if requested.
Swift SVN r12252
2014-01-13 21:38:04 +00:00
Connor Wakamo
f0555a73a8 [driver] Add support for the -parse-sil option, including passing it through to the frontend.
Swift SVN r12175
2014-01-11 00:33:31 +00:00
Connor Wakamo
86fe23de29 [driver] Add support for passing -parse-as-library and -parse-stdlib to the frontend.
Swift SVN r12172
2014-01-11 00:33:29 +00:00
Connor Wakamo
ee7c66258a [driver] Add support for passing all inputs to the Swift frontend, selecting one per invocation with -primary-file.
Swift SVN r12151
2014-01-10 22:39:06 +00:00
Connor Wakamo
5303544046 [driver] Add support for passing -O to the integrated frontend.
Swift SVN r11451
2013-12-18 23:42:51 +00:00
Connor Wakamo
5a603a3cd1 [driver] Add support for -emit-ir and -emit-bc.
Added driver-level support for generating commands with -emit-ir and -emit-bc as well integrated frontend support for handling -emit-ir and -emit-bc.

Swift SVN r11375
2013-12-17 02:43:40 +00:00
Connor Wakamo
6127955b05 [driver] Add support for passing arguments after -- down to the frontend as-is if the driver is in immediate mode.
In Driver::translateInputArgs(), don’t break apart the OPT__DASH_DASH argument if we’re in immediate mode.
Mark OPT__DASH_DASH as being a FrontendOption.
In Swift::constructJob(), add support for types::TY_Nothing, and pass the argument for OPT__DASH_DASH as-is if the driver is invoking the frontend in immediate mode.

Swift SVN r11325
2013-12-15 00:58:27 +00:00
Connor Wakamo
85c2afcd90 [driver] Added support for -Xfrontend, which passes arguments through to the frontend.
Swift SVN r11166
2013-12-12 01:14:06 +00:00
Connor Wakamo
fb38d09bb1 [driver] Switch from passing “-triple” to “-target” to the integrated frontend.
Swift SVN r11097
2013-12-10 23:17:00 +00:00
Connor Wakamo
02c1532d27 Initial support for an integrated frontend in swift_driver.
- Added support for invoking the Swift frontend via "swift_driver -frontend".
- Added frontend_main.cpp, which implements the main entry point for the
  integrated frontend. (Currently, this supports compiling an input Swift file
  into an object file.)
- Removed lib/Frontend/FrontendOptions.td, and replaced its functionality with
  options in include/Swift/Driver/Options.td and a new
  include/Swift/Driver/FrontendOptions.td. Options supported by the frontend
  are denoted by the FrontendOption flag; options which are not supported by
  the driver are denoted by the NoDriverOption flag.
- Updated CompilerInvocation::parseArgs() to use the option table returned from
  createDriverOptTable(), including renaming a handful of options. (-triple is
  now -target, and -Xclang is now -Xcc.)

Swift SVN r11082
2013-12-10 18:06:54 +00:00
Connor Wakamo
725eda93a7 [driver] Reimplemented Swift::constructJob() so that it actually produces compile commands.
Instead of producing "swift_driver --version" commands, implemented support for producing
"swift" commands which actually compile code. (The support at this point is rudimentary,
but serves as a good starting point.)

Swift SVN r10949
2013-12-06 23:11:31 +00:00
Connor Wakamo
e93274315e [driver] Assert that the linker is only asked to produce outputs of type TY_Image.
Swift SVN r10948
2013-12-06 23:11:30 +00:00
Connor Wakamo
ed2038585f Initial set of changes to add a new 'swift_driver' executable.
- Added a couple of new targets:
  - libswiftDriver, which contains most of the driver implementation
  - swift_driver, which produces the actual executable

- Added centralized version information into libswiftBasic.

- Added a new "Driver Design & Internals" document, which currently describes
  the high-level design of the Swift driver.

- Implemented an early version of the functionality of the driver, including
  versions of the Parse, Pipeline, Bind, Translate, and Execute driver stages.
  Parse, Pipeline, and Bind are largely implemented; Translate and Execute are
  early placeholders. (Translate produces "swift_driver --version" and "ld -v"
  commands, while Execute performs all subtasks sequentially, rather than in
  parallel.)

This is just the starting point for the Swift driver. Tests for the existing
behavior are forthcoming.

Swift SVN r10933
2013-12-06 21:23:01 +00:00