Commit Graph

13 Commits

Author SHA1 Message Date
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
8ab8847684 Fix typos. 2015-12-16 22:09:32 +01:00
Jordan Rose
963c442b44 [Driver] Add support for interface-hash.
Dependents of modified files are no longer rebuilt by default, only if it turns
out that file's interface has changed. There is a flag
-driver-always-rebuild-dependents to override this, but we expect it to only be
used for testing. (Most of the existing dependency tests pick up this option;
the two new tests have "interface-hash" in the name.)

This is the second half of ChrisW's work on interface hashing.

rdar://problem/15352929

Swift SVN r30478
2015-07-22 00:14:01 +00:00
Jordan Rose
45189f9feb [Driver] Add a basic tracing mode to determine why files are getting rebuilt.
Enabled with -driver-show-incremental. For debugging purposes only.

Swift SVN r29804
2015-06-30 19:31:07 +00:00
Jordan Rose
af49aa65e0 [Driver] Don't crash when a new file is added to the build.
This was supposed to be part of r28776, but the test got truncated and then
I forgot to commit it.

rdar://problem/21012796

Swift SVN r29039
2015-05-26 23:13:37 +00:00
Graham Batty
99a954fc7b Define iterator traits for StringSetIterator.
On gnu libc++ std::find (used on this iterator in
DependencyGraphTests.cpp:268) needs iterator traits to be properly
defined. This defines them for this iterator so it compiles
correctly.

Swift SVN r24478
2015-01-16 20:27:55 +00:00
Jordan Rose
5e889c0c8a [Driver] Load cross-module dependencies into the dependency graph.
We don't actually check them yet, but this fits them into the same dependency
structure as intra-module dependencies.

Part of rdar://problem/19270920

Swift SVN r24335
2015-01-10 00:38:10 +00:00
Jordan Rose
99075516ce Use "cascading/non-" terms for dependencies instead of "private/non-".
"private" is a very overloaded term already. "Cascading" instead of
"non-private" is a bit more clear about what will happen with this sort
of lookup.

No functionality change. There are some double negatives I plan to clean
up in the next commit, but this one was supposed to be very mechanical.

Swift SVN r23969
2014-12-17 02:42:45 +00:00
Jordan Rose
24118c95db [Driver] Handle dependencies we learn about after a job is run.
Specifically, we care about the case where a job is run because of a private
dependency, and then a non-private dependency turns out to be dirty. In
this case, we still need to make sure to build all downstream files.

With this the driver support for private dependencies should be complete
and correct.

Swift SVN r23853
2014-12-11 01:12:02 +00:00
Jordan Rose
20cd316500 [Driver] Add basic support for private dependencies.
- Add flags to dependency entries in DependencyGraph.
- Don't traverse past private dependencies in markTransitive.
- Only mark dependent jobs after a build if the build was triggered
  (a) explicitly (because the file is out of date), or
  (b) because of a non-private dependency.

This still isn't fully correct because of new non-private dependencies
discovered /after/ building an individual file, but it's on the way there.
Solving that problem will require tracking which dependencies have already
been marked dirty (next commit).

Swift SVN r23852
2014-12-11 01:11:58 +00:00
Jordan Rose
e48245a715 [Driver] Refactor DependencyGraph in preparation for private dependencies.
- Give loadWithPath an enum result that includes "NeedsRebuilding".
  This will be returned when a new dependency is discovered that
  retroactively affects the graph.
- Don't clear the "provides" set for a node when it gets reloaded;
  just append to it. This lets us avoid calling markTransitive twice.
- Use proper types for "depends" and "provides" entries instead of std::pair.
- Use swift::OptionSet instead of a manual bitmask.
- Use separate "depends" and "provides" callbacks when parsing dependency
  files.

No expected functionality change.

Swift SVN r23851
2014-12-11 01:11:57 +00:00
Jordan Rose
a4a6b42604 [Driver] Only run compile jobs if needed.
This teaches the driver's Compilation to not run jobs where the base input
is older than the main output (r23221) when we're tracking dependencies.
After a compile command finishes, anything that depended on the file that
just got compiled will get scheduled.

This has the nice side effect of trying to rebuild changed files first.

The tests here aren't really testing the dependency graph yet, because the
files don't include any dependencies. I'll be adding several more test
scenarios in the next few commits.

Part of rdar://problem/15353101

Swift SVN r23273
2014-11-12 18:06:10 +00:00
Jordan Rose
8b5d763e39 [Driver] Add a new DependencyGraph class.
...and some basic unit tests for it.

The purpose of this class is to track dependencies between opaque nodes.
The dependency edges are (kind, string) pairs, where the "kind"
distinguishes different kinds of dependencies (currently "top-level names"
and "types that we do lookup on"). The step is to make use of it in
running compile commands.

The YAML-based file format is only for bring-up and testing purposes.
I intend to switch it to a bitcode-based format in the long run.

Part of rdar://problem/15353101

Swift SVN r23223
2014-11-11 00:43:29 +00:00