Commit Graph

33 Commits

Author SHA1 Message Date
Jordan Rose
69fbc5b77b Get some files off of PointerLikeTypeTraitsFwdDecl.h 2016-02-06 11:22:28 -08:00
Michael Gottesman
3556db7484 Add in explicit specializations for forward declared pointers that we use. All of the explicit specializations are in the new header "PointerLikeTypeTraitsFwdDecl.h" 2016-02-06 11:22:28 -08:00
Jordan Rose
6067120f81 [Driver] Emit filelists for Jobs that want them (inputs).
This is the other half of the previous commit: we can use -filelist for
linking on Darwin.

More https://bugs.swift.org/browse/SR-280.
2016-01-13 18:39:24 -08:00
Jordan Rose
dbd0d47568 [Driver] Only JobActions have inputs, not InputActions.
Also, cluster the flags on Action into a single word. This probably doesn't
make any real difference, but it's the convention.

No functionality change.
2016-01-12 11:52:31 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Jordan Rose
528298c12b [Driver] Add the notion of "extra environment variables" to Jobs.
This is groundwork for setting [DY]LD_LIBRARY_PATH ahead of time when
invoking the interpreter, which is rdar://problem/23588774. The next
commit will set up the appropriate variable and use -driver-print-jobs
to test it; the following commit will apply the environment variable
when running a job.
2015-12-04 12:18:46 -08:00
Jordan Rose
de2ecbb80e [Driver] Remove the notion of Tools, turn ToolChain into an Action visitor.
The "Tool" abstraction wasn't buying us enough to deserve the added
complexity. Now a ToolChain turns Actions into Jobs, and every helper
tool is searched for relative to Swift first. Much simpler.

Swift SVN r31563
2015-08-28 23:12:33 +00:00
Jordan Rose
9a39d71d1a [Driver] Add Job::dump.
No functionality change.

Swift SVN r29803
2015-06-30 19:31:05 +00:00
Jordan Rose
036b083138 [Driver] Eliminate the JobList class.
This was just a wrapper around SmallVector that optionally owned the Job pointers
in it. Now that all Jobs are owned by the Compilation, we don't have to worry
about this any more.

No functionality change.

Swift SVN r29668
2015-06-25 15:45:45 +00:00
Jordan Rose
482cfac8a1 [Driver] Store all Jobs in a flat list in the Compilation object.
The Compilation is now the only owner of the Jobs.

No end-user functionality change.

Swift SVN r29667
2015-06-25 15:45:43 +00:00
Jordan Rose
6fce6d331d [Driver] Better separation of concerns in the Tool hierarchy.
No intended functionality change.

Swift SVN r29666
2015-06-25 15:45:41 +00:00
Jordan Rose
2b7b78d162 [Driver] A .swift file should be rebuilt if its mtime has changed.
...not if it's newer than its output .o file. This handles cases where the
object file is generated too quickly (rdar://problem/19404140) or when you
revert to a previous version of the file, mtime intact (rdar://problem/19720146).

There's a lot of test churn here; the only real new test is the backwards
mtime update in one-way.swift.

Swift SVN r29584
2015-06-24 00:06:58 +00:00
Jordan Rose
4dacca912d [Driver] Don't full-rebuild when a new file is added.
Continue to full-rebuild when a file is removed, because we don't know what
was depending on it.

Swift SVN r28776
2015-05-19 18:25:51 +00:00
Erik Eckstein
50423166aa Driver: fix a few things to get -embed-bitcode working with multi-threaded compilation.
Swift SVN r28517
2015-05-13 17:52:57 +00:00
Erik Eckstein
5537cf84ca Driver: Support -num-threads <n> option.
Together with -wmo it enables multi-threaded compilation.
I didn't want to reuse the -j option for this, because -num-threads (even if n == 1) does change the generated code.
For details see commit message of r25930.



Swift SVN r26258
2015-03-18 10:05:11 +00:00
Jordan Rose
1b7cd80d1d [Driver] Track the latest a particular job could have been run.
This is mostly just a matter of not throwing away mtimes we were already
looking up. We can compare these values to the mtimes of cross-module
dependencies to find out what's been updated.

Part of rdar://problem/19270920

Swift SVN r24336
2015-01-10 00:38:11 +00:00
Jordan Rose
43bcbb8f9e [Driver] Handle outstanding jobs by reading the build record.
r23968 wrote out a record of which source files were included in a build,
and whether they were succesfully compiled or not...and if not, whether
they were out of date because of a cascading or non-cascading dependency.
This commit uses that information to decide what files might need to be
rebuilt even if a particular input doesn't change and doesn't appear to
have any changed dependencies. The two interesting cases are:

- A file was going to be built last time, but the build was halted
  because of an error. Build it this time.
- One of the files was removed and thus we've lost a source of dependency
  information; rebuild everything!

rdar://problem/19270980

Swift SVN r24018
2014-12-18 21:24:18 +00:00
Jordan Rose
0364724ec3 [Driver] Add an mtime test for single-file compilation jobs.
The Swift compiler is always fed the entire list of files in a module.
If it's told to track dependencies, though, it should look to see if it
actually needs to recompile all of its inputs. The first step in this is
to see which files are actually dirty, which it does by comparing the mtime
of each source file with the mtime of its output object file. If a source
file is not dirty, it only needs to be rebuilt if it depends on something
in a dirty file.

Nothing actually uses this information yet, but we can print it with
-driver-print-bindings!

Swift SVN r23221
2014-11-11 00:43:27 +00:00
Jordan Rose
c4fd29eb0b [Driver] Eliminate the common base class of Command and JobList.
...and rename Command to Job (previously the name of the base class).

We never generated job lists directly contained in other job lists, so
let's not even worry about this case. We may some day need to break Job
out into separate subclasses (Clang has Command and FallbackCommand in
addition to JobList), but we should be able to keep the list separate.

No intended functionality change.

Swift SVN r23144
2014-11-07 00:10:18 +00:00
Jordan Rose
3fcdfd40e9 Remove the "swift/Basic/Optional.h" header.
llvm::Optional lives in "llvm/ADT/Optional.h". Like Clang, we can get
Optional in the 'swift' namespace by including "swift/Basic/LLVM.h".

We're now fully switched over to llvm::Optional!

Swift SVN r22477
2014-10-02 18:51:45 +00:00
Connor Wakamo
6cf30215ae Added support for specifying the terminator used by Command::printCommandLine.
This defaults to "\n", so this is NFC for existing clients.

Swift SVN r20848
2014-07-31 21:19:56 +00:00
Jordan Rose
69533b53f7 [Driver] Invoke dsymutil after linking when invoked with -g.
This matches Clang's behavior, though this implementation does not check
that it's actually on a platform that uses dsymutil.

<rdar://problem/16012971>

Swift SVN r20529
2014-07-25 01:31:40 +00:00
Jordan Rose
3bebef4d29 Pass options to LLDB's REPL.
This is the rest of <rdar://problem/16776705>

Swift SVN r17820
2014-05-10 01:17:39 +00:00
Nadav Rotem
6a0f2cfcb8 remove more extra semicolons to clean up warnings.
Swift SVN r15486
2014-03-26 05:44:41 +00:00
Connor Wakamo
49d8d07224 [driver] Moved Command printing into Command::printCommandLine().
This was previously implemented in both Compilation::performJobsInList() and printJob().

Swift SVN r13253
2014-02-01 00:22:41 +00:00
Jordan Rose
c101e360a9 [driver] Use "const std::string &" instead of StringRef.
…for strings required to be null-terminated.

Swift SVN r12790
2014-01-22 21:56:24 +00:00
Connor Wakamo
4a79769742 [driver] Make CommandOutput::BaseInput into a bare StringRef, treating an empty reference as no value.
Swift SVN r12607
2014-01-20 19:26:50 +00:00
Connor Wakamo
5f00a5b1a9 [driver] Adjusted CommandOutput so that BaseInput is an Optional<StringRef>.
Not all Commands will have a base input (REPL commands, in particular), so make
BaseInput optional.

Swift SVN r12546
2014-01-18 20:55:20 +00:00
Connor Wakamo
824c0cb126 [driver] Reworked the CommandOutput class to add support for specifying additional outputs.
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
2014-01-17 01:11:55 +00:00
Connor Wakamo
24fad265a2 [driver] Removed Job::run() and Job::needsToRun().
Both of these functions are now handled by Compilation.

Swift SVN r12061
2014-01-08 19:10:43 +00:00
Connor Wakamo
ab7fcaecc3 [driver] Make Command::getExecutable() return a const char *, since a Command’s executable must always be a null-terminated C string.
Swift SVN r11426
2013-12-18 18:06:04 +00:00
Connor Wakamo
25283a28d9 [driver] Fixed an issue where creating Commands with no output failed due to an attempt to initialize a StringRef with nullptr.
Swift SVN r11324
2013-12-15 00:58:26 +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