Commit Graph

90 Commits

Author SHA1 Message Date
Jordan Rose
3cd9f166bc Don't spend time initializing LLVM when running the driver (#14896)
Tiny start-up time optimization noticed while looking at how we do
PrettyStackTraceProgram. Also add PrettyStackTraceProgram to a few
more of our testing tools, via the new PROGRAM_START macro.
2018-02-28 19:56:19 -08:00
Graydon Hoare
d139ab2968 [BatchMode] Expand lifetime of ToolChain, pass reference to it to Compilation. 2018-01-24 10:31:19 -08:00
swift-ci
75dc7c1b73 Merge pull request #13011 from modocache/driver-typo 2017-11-18 14:00:29 -08:00
Brian Gesiak
70ad32c598 [Driver] Fix typo: half sentence and period 2017-11-18 12:25:34 -05:00
Ankit Aggarwal
d84e4b4de1 [Driver] Remove built-in run subcommand
This is as per discussion in https://bugs.swift.org/browse/SR-5332
2017-07-10 10:35:00 +05:30
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Daniel Martín
df15ec4f3b Swift-format driver tool
This driver tool formats Swift files or file ranges using some
parameters like tabs or spaces, tab width, or amount of spaces.
2016-08-08 11:07:15 +02:00
John McCall
23f961bc0a Give the FrontendTool library its own header and allow users
to observe progress through the frontend.
2016-04-21 14:59:39 -07:00
John McCall
95eeabb025 Move the -frontend logic into its own library to allow re-use
and abstraction (to come).
2016-04-20 22:54:00 -07:00
Doug Gregor
da60535ced [Driver / API Notes] Re-introduce "-apinotes" driver flag to compile API notes.
Using Clang to compile API notes introduces a dependency on the
underlying Clang, which can cause problems as Clang's support for API
notes evolves. Re-introduce the "-apinotes" driver flag into the Swift
driver to allow us to compile API notes, and use that (rather than
Clang) to precompile API notes for the overlays.
2016-03-04 14:12:15 -08:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Daniel Dunbar
a0f5bdfa50 [PATCH] [Driver] Add support for using 'swift' to exec subcommands.
- This allows 'swift <FOO>' to be used to invoke swift-<FOO>, so that we can
   use 'swift' as a namespace for additional commands (like ones used for the
   package manager.

 - This patch just adds the basic subcommand functionality, but doesn't rework
   either 'swift-autolink-extract' or 'swift -frontend' to follow this code path.

 - <rdar://problem/22844530> Provide 'swift' support for subcommands



Swift SVN r32367
2015-10-01 07:16:12 +00:00
Michael Gottesman
e864f02690 In all executables make sure to completely initialize LLVM.
I also added a macro called INITIALIZE_LLVM(argc, argv) which moves this logic
into one place and should be used at the beginning of *all* binaries. It
initializes an LLVM shutdown object, sets up the pretty stack trace, and then
initializes all of the parts of LLVM. This will make it easy to update this in
the future.

The reason why a macro was required was because of llvm_shutdown_obj, an RAII
object that cleans up LLVM. It has to be at the function level scope of the main
function.

Swift SVN r31815
2015-09-09 04:37:38 +00:00
Adrian Prantl
0de0d43773 Introduce a -modulewrap driver action that wraps a (merged) .swiftmodule
inside a swift ast section in an object file so it can be passed to the
linker. The driver automatically wraps merged swiftmodules iff the target
is ELF.

rdar://problem/22407666

Swift SVN r31641
2015-09-02 21:56:25 +00:00
Argyrios Kyrtzidis
8b250d6d35 [driver] Remove the 'swift-fixit' symlink and introduce '-emit-fixits-path' frontend option that
writes compiler fixits as source edits.

Driver option '-fixit-code' adds '-emit-fixits-path' for all the frontend invocations.

Swift SVN r27208
2015-04-10 17:33:29 +00:00
Argyrios Kyrtzidis
623b9827b4 [driver] Separate "delegate to the migrator with swift-update" and "get compiler fixits with swift-fixit" functionalities.
Swift SVN r27139
2015-04-08 22:02:23 +00:00
Arnold Schwaighofer
f79e6abd2e Missing header includes ...
Swift SVN r26454
2015-03-23 22:05:47 +00:00
Graham Batty
078a558b26 Extract autolink information as a compile step.
Swift SVN r25510
2015-02-24 20:33:05 +00:00
Argyrios Kyrtzidis
e021f5077d [swift-update] Treat 'swift-update' as a symlink to the driver, instead of a separate executable.
This avoids having another copy of the frontend in the toolchain.

Swift SVN r24320
2015-01-09 18:55:16 +00:00
Dmitri Hrybenko
b11d050ff3 Driver: disable the compiler if COMPILER_DISABLE_SWIFT env var is
present

rdar://19161254

Swift SVN r23744
2014-12-05 22:41:49 +00:00
Doug Gregor
e0afb13abb Remove the APINotes library; it lives in Clang, now.
Swift SVN r22286
2014-09-25 18:48:43 +00:00
Ben Langmuir
13b44b7814 Revert "Suppress CrashTracer aggregation for crashes in non-production compilers."
This is failing to build in Jenkins

This reverts commit r22058

Swift SVN r22075
2014-09-18 15:43:12 +00:00
Greg Parker
5b22baffcd Suppress CrashTracer aggregation for crashes in non-production compilers.
rdar://18177298


Swift SVN r22058
2014-09-18 03:17:46 +00:00
Connor Wakamo
6e6e20ab4b [test] Added an integrated "-test-createCompilerInvocation" tool to swift-ide-test.
This is very basic: it just sees whether, given a set of driver arguments, the
swift::driver::createCompilerInvocation API returns a non-null
CompilerInvocation.

Unlike other modes of swift-ide-test, this mode requires that
"-test-createCompilerInvocation" be the first argument passed to swift-ide-test.
This is because it is handled separately from llvm::cl::ParseCommandLineOptions
so the remaining arguments can be passed through directly to
swift::driver::createCompilerInvocation without any interference from that
parser.

Additionally, added a test which uses this tool to try to create a
CompilerInvocation for a handful of basic driver commands.

Swift SVN r20973
2014-08-03 19:04:27 +00:00
Ben Langmuir
a96009c52f Add a 'swifti' symlink to stage in the upcoming driver changes
For now, keep 'swift' the same and put all the interactive driver
changes under 'swifti'. When these are in good shape, I will remove
swifti and make 'swift' the interactive driver as discussed.

Swift SVN r20359
2014-07-23 02:30:39 +00:00
Anna Zaks
ae3e822c2c Add a skeleton for API Notes YAML-to-binary conversion
Reapplies r20137 with most comments addressed.

Parses a YAML file (but not the final/full format yet).

Adds an entry to the driver for the apinotes "tool". We want the tool
to be visible to the user so it has to go to the driver.

Very limited testing as of now.

Swift SVN r20173
2014-07-18 19:54:11 +00:00
Greg Parker
00060d67d0 Revert r20137 because it breaks the arm64 build.
Swift SVN r20142
2014-07-18 06:34:43 +00:00
Anna Zaks
7fab0c91e2 Add a skeleton for API Notes YAML-to-binary conversion
Parses a YAML file (but not the final/full format yet).

Adds an entry to the driver for the apinotes "tool". We want the tool
to be visible to the user so it has to go to the driver.

Very limited testing as of now.

Swift SVN r20137
2014-07-18 03:39:03 +00:00
Michael Gottesman
9b72aa0e47 Revert "Update to ToT which removed std::error_code"
This reverts commit r18853. This was already fixed by the previous
commit.

Swift SVN r18855
2014-06-13 04:34:18 +00:00
Pete Cooper
676b005839 Update to ToT which removed std::error_code
Swift SVN r18853
2014-06-13 03:50:33 +00:00
Justin Bogner
a0c0dc25be Use std::error_code rather than llvm::error_code
std::error_code is no longer available via the llvm namespace as of
r210835.

Swift SVN r18851
2014-06-13 02:54:07 +00:00
Doug Gregor
3d3ff6811a Add a pile of missing #includes exposed by pruning includes in top-of-tree LLVM.
Swift SVN r17157
2014-05-01 14:26:34 +00:00
Jordan Rose
8f7a2e4d56 Eliminate LLVM pass entry points from swift and swift_driver.
Per previous commit, we should just test these using opt.

Swift SVN r13182
2014-01-30 23:42:40 +00:00
Connor Wakamo
247228104d [driver] Updated main() to return 1 if there were any errors building the Compilation.
Previously, main() would always return 0 if a Compilation was not built. Now
that the driver is correctly emitting diagnostics, check for any errors to see
if it should return 1 instead.

Swift SVN r13176
2014-01-30 22:42:18 +00:00
Connor Wakamo
cc7d62ecca [driver] Implemented a new "swift_driver -transform-ir" integrated tool.
This tool implements support for running IR transformations; in particular, it
replaces the functionality supported by "swift -arc-optimize" and
"swift -arc-transform".

No tests yet, but this will be used by several tests once we complete the
transition to the new driver.

Swift SVN r12927
2014-01-24 19:20:40 +00:00
Connor Wakamo
04b98c7d67 [driver] Move execution of Jobs from main() to Compilation.
Actual execution of Jobs is still performed under-the-covers by JobList::run(), but this abstraction will allow the Compilation to execute Jobs in parallel.

Swift SVN r11334
2013-12-15 21:47:36 +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
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