mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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
This commit is contained in:
@@ -148,9 +148,11 @@ InputArgList *Driver::parseArgStrings(ArrayRef<const char *> Args) {
|
||||
DerivedArgList *Driver::translateInputArgs(const InputArgList &ArgList) const {
|
||||
DerivedArgList *DAL = new DerivedArgList(ArgList);
|
||||
|
||||
bool ImmediateMode = ArgList.hasArgNoClaim(options::OPT_i);
|
||||
|
||||
for (Arg *A : ArgList) {
|
||||
// Pick up inputs via the -- option.
|
||||
if (A->getOption().matches(options::OPT__DASH_DASH)) {
|
||||
// If we're not in immediate mode, pick up inputs via the -- option.
|
||||
if (!ImmediateMode && A->getOption().matches(options::OPT__DASH_DASH)) {
|
||||
A->claim();
|
||||
for (unsigned i = 0, e = A->getNumValues(); i != e; ++i) {
|
||||
DAL->append(makeInputArg(*DAL, *Opts, A->getValue(i)));
|
||||
|
||||
Reference in New Issue
Block a user