Tool selection is primarily done by checking the executable (= symlink) name.
But sometimes (e.g. if the tool symlink is not there) it's useful to have an option for selecting the tool.
The selection option (e.g. -sil-opt) must be the first argument of swift-frontend.
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`
The old API will be deprecated in the rebranch.
To avoid merge conflicts, use the new API already in the main branch.
rdar://102362022
Previously the driver mode was always set based on the executable name,
ignoring any manually passed flag, now this flag is preferred if it
exists.
Fixes https://github.com/apple/swift/issues/60600
Now that the new driver no longer runs the REPL by default
when there are no arguments, the frontend needs to update
its assumption as it is still used to launch the new driver.
rdar://88595293
If a response file is being passed to the legacy driver
because it is too large to fit on the system's command line,
then it should also be passed when spawning the new driver.
Currently, however, the legacy driver attempts to pass the
*expanded* arguments to the new driver, which can cause the
invocation to fail, requiring the new driver to be disabled
in order to compile.
This change passes the original arguments into `run_driver`
as well as the expanded ones, so that the branch that spawns
the new driver can use the original arguments instead.