In Driver::buildJobsForAction(), consult the OutputFileMap if we're building a
Job for a CompileJobAction and we're not in SingleCompile mode.
Swift SVN r12774
Added an -output-file-map option which will specify the path to an
OutputFileMap.
Added Driver::buildOutputFileMap(), which constructs an OutputFileMap
from the arguments.
Added OutputFileMap* parameters to Driver::buildJobs() and
Driver::buildJobsForAction(). (These parameters are not yet honored, except to
pass to calls of these functions.)
Swift SVN r12772
Since a CommandOutput may have multiple outputs, print any additional outputs
after printing the primary output, using the following format:
... output: {<type>: "<primary output>", <type>: "<additional output>", ...}
Swift SVN r12690
The new format is "-<option>" and "-<option>-path". As a result:
- Renamed -serialized-diagnostics-path to -serialize-diagnostics-path.
- Renamed -module-output-path to -emit-module-path.
Swift SVN r12614
Added a SerializedDiagnostics entry to Types.def.
In Driver::buildJobsForAction(), set an appropriate path for serialized
diagnostics, if requested. In Swift::constructJob(), check for an additional
SerializedDiagnostics output to determine if -serialize-diagnostics and
-serialized-diagnostics-path should be passed.
This is necessary infrastructure for the output file map.
Swift SVN r12613
This sets OutputInfo::CompilerMode to a new SingleCompile mode, which in turn
causes the driver to create a single CompileJobAction for all inputs. This mode
also prevents the creation of a MergeModuleJobAction, since we can rely on the
frontend to generate a full swiftmodule.
This mode will allow the driver to properly compile the stdlib; if this mode is
necessary for other inputs, we can rename and publicize this option.
Swift SVN r12612
Introduced OutputInfo::Mode and OutputInfo::CompilerMode, which dictate how the
driver should invoke the integrated frontend. Currently, there are three
options:
- StandardCompile: invoke the frontend once-per-input, using -primary-file
- REPL: invoke the frontend as the REPL
- Immediate: invoke the frontend in immediate mode
Updated buildOutputInfo() to properly set the CompilerMode, and updated
buildActions() and Swift::constructJob() to honor the CompilerMode.
With these changes, "swift_driver" (with no inputs) and "swift_driver -repl"
should invoke the REPL, and "swift_driver -i" should invoke the frontend in
immediate mode.
Swift SVN r12547
This will indicate that the generated module was user-requested, so it should be
placed alongside other outputs.
Updated buildOutputInfo() in a few ways:
- Updated it to set ShouldTreatModuleAsTopLevelOutput correctly.
- Updated it such that -g implies that a module should be generated, but treated as an intermediate.
- Moved the fallback ModuleName handling into buildOutputInfo(), which requires passing an InputList.
Swift SVN r12502
First, prefer -module-output-path over any other options when binding the output
for a merge module Command. If that’s not set, use the same behavior as other
intermediate outputs, but use the module name as the base name (instead of the
BaseInput, which is not descriptive enough for a swiftmodule).
This does not yet handle the case where the emitted module should be treated as
a top-level output, even though it’s not the top-level job (essentially,
whenever -emit-module is passed but the driver isn't in EmitModuleOnly mode).
Swift SVN r12500
Adjusted Driver::buildJobs() and Driver::buildJobsForAction() to include a const OutputMode& parameter.
Updated Driver::buildJobsForAction() to set an additional swiftmodule output on Jobs generated from a CompileJobAction if the OutputMode says the driver should generate a module.
This change now causes frontend invocations to pass “-emit-module -module-output-path <path>” when a module is requested, though the partial modules are not yet properly merged.
Swift SVN r12495
Instead of having buildActions() call the private Driver::getOutputMode() function, establish an OutputMode using a new Driver::buildOutputMode() function.
This change will allow the OutputMode to be more easily shared across functions without needing to generate it each time (though, at the moment, only buildActions() uses the OutputMode).
Swift SVN r12494
Updated Driver::OutputMode to also contain a ShouldGenerateModule field.
Updated Driver::getOutputMode() to set OutputMode::ShouldGenerateModule appropriately.
Updated Driver::buildActions() to insert a MergeModuleJobAction into the Action graph if the Driver’s OutputMode indicates that a module should be generated.
Swift SVN r12492
This will allow the driver to specify the location for, among other things, the partial swiftmodule generated by a single frontend invocation.
Swift SVN r12449
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
This instructs the driver to skip task execution by using a DummyTaskQueue in Compilation::performJobsInList().
This option should generally only be used for testing, as DummyTaskQueue may provide fake buffered output.
Swift SVN r12350
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
The driver does not yet support parallel execution, but this sets the Compilation up with the necessary information to execute commands in parallel.
Swift SVN r11333
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
- 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
SIL emitted by -emit-silgen is treated internally as “raw-sil”, while SIL emitted by -emit-silgen is treated internally as “sil".
Externally, there are no changes; both kinds of SIL still have a “.sil” file extension.
Updated test/Driver/Actions.swift to account for the change in behavior with -emit-silgen.
Swift SVN r10947
This produces output similar to "clang -ccc-print-bindings".
Also added several tests to ensure that "swift_driver -driver-print-bindings"
behaves as expected.
Swift SVN r10935
- 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