Commit Graph

2 Commits

Author SHA1 Message Date
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Connor Wakamo
8db11fd059 [driver] Added an API for creating a CompilerInvocation from driver arguments.
Added a new API, swift::driver::createCompilerInvocation. This takes an array
of driver arguments, constructs a Driver and a Compilation, and then uses the
Compilation's frontend arguments to create a CompilerInvocation.

This works by forcing Driver to create a Compilation which contains a single
compile command. (It achieves this by passing
"-force-single-frontend-invocation" after all other arguments.) This approach
roughly matches Clang's clang::createInvocationFromCommandLine.

As implied by the namespacing, this lives in swiftDriver. As a result,
swiftDriver now depends on swiftFrontend.

In support of this, added a couple of driver diagnostics for exceptional error
cases (where Driver produced something other than a single Command, or if that
Command is not a frontend command).

This fixes <rdar://problem/16125395>.

Swift SVN r20972
2014-08-03 19:04:22 +00:00