Commit Graph

262 Commits

Author SHA1 Message Date
Robert Widmann
964f640636 Drop "Private Deps" Flag
In order for type body fingerprints to work, these declarations must always be included. Drop the ability to turn this off.
2020-10-01 14:40:45 -07:00
Robert Widmann
74765a8ba8 Remove Type Body Fingerprints Flags
This infrastructure has more than proven itself. Drop the code paths and tests supporting the status quo.
2020-10-01 13:09:00 -07:00
Robert Widmann
e35f060144 Install Incremental External Dependency Integration Code
An incremental build involving incremental external dependencies behaves as a hybrid between an external dependency and a normal swiftdeps-laden Swift file.

In the simplest case, we will fall back to the behavior of a plain external dependency today. That is, we will check its timestamp, then schedule all jobs that involve these external dependencies if it is out of date.

Where things get interesting is when cross-module incremental builds are enabled. In such a case, we know that a previous compiler has already emitted serialized swiftdeps information inside of a swiftmodule file. Moreover, we know that that swiftmodule file was loaded by the build of the current swift module. Finally, thanks to the previous stack of commits, we now know exactly how to extract this information from the swiftmodule file. To bring this all home, we unpack incremental dependency information from external dependencies, then integrate them into the current dependency graph - as though they were any other swiftdeps file. This neatly extends the single-module incremental logic to the multi-module case.
2020-09-25 11:45:58 -06:00
Robert Widmann
3ba33b93eb Install Faux Cross-Module Incremental Infrastructure In Driver
Treat any incremental external depends like normal external depends. This will eventually become the fallback behavior for cross-module incremental builds.
2020-09-25 01:16:01 -06:00
Robert Widmann
48415ad228 [NFC] Stage in driver flags for experimental cross-module incremental builds 2020-09-24 17:10:57 -06:00
Robert Widmann
14188f4428 Remove ~moduleonly Duplicate of Compilation Record
We thought we would need this while exploring  certain pre-build optimizations a la rdar://problem/37725110. This information was never used.
2020-09-24 11:42:06 -06:00
David Ungar
6171c4105b Remove bogus assertion with explanation. 2020-07-14 15:09:04 -07:00
Anthony Latsis
9fd1aa5d59 [NFC] Pre- increment and decrement where possible 2020-06-01 15:39:29 +03:00
Saleem Abdulrasool
09975d1253 sprinkle llvm_unreachable for covered switches (NFC)
Annotate the covered switches with `llvm_unreachable` to avoid the MSVC
warning which does not recognise the covered switches.  This allows us
to avoid a spew of warnings.
2020-05-07 11:05:35 -07:00
Slava Pestov
368d47429d Frontend: Remove coarse-grained dependency graph implementation 2020-04-29 16:55:53 -04:00
David Ungar
6f65e0ec36 Change unfinished handling 2020-01-27 15:14:46 -08:00
David Ungar
d61f6f2f66 Changes to support per-type-body fingerprints. 2020-01-27 15:14:46 -08:00
David Ungar
7f4205e9dc grammar 2020-01-22 21:38:21 -08:00
David Ungar
0c776a4a86 Add a verb. 2020-01-22 21:31:46 -08:00
David Ungar
cbd458c968 Make tests more deterministic by sorting jobs before scheduling 2020-01-16 13:20:35 -08:00
David Ungar
8c2c4ab391 Fixes for fine-grained dependencies 2020-01-16 13:20:27 -08:00
David Ungar
cc89dad526 Fine-grained and driver fixes.
Restructure fine-grained-dependencies to enable unit testing

Get frontend to emit correct swiftdeps file (fine-grained when needed) and only emit dot file for -emit-fine-grained-dependency-sourcefile-dot-files

Use deterministic order for more information outputs.

Set EnableFineGrainedDependencies consistently in frontend.

Tolerate errors that result in null getExtendedNominal()

Fix memory issue by removing node everywhere.

Break up print routine

Be more verbose so it will compile on Linux.

Sort batchable jobs, too.
2020-01-11 21:57:14 -08:00
Saleem Abdulrasool
b483047afe Revert "[Incremental] Dependency fixes in preparation for fine-grained dependencies" 2020-01-09 19:14:47 -08:00
David Ungar
939034a4bb Merge pull request #29009 from davidungar/fine-grained-fixes-post-rb
[Incremental] Dependency fixes in preparation for fine-grained dependencies
2020-01-09 00:57:31 -08:00
Doug Gregor
51bbaebd08 Merge pull request #28972 from kastiglione/dl/correct-batch-mode-partitiion-count-calculation
Adjust batch mode partition count calculation
2020-01-05 21:05:00 -08:00
David Ungar
6fffe724f2 Fine-grained and driver fixes.
Restructure fine-grained-dependencies to enable unit testing

Get frontend to emit correct swiftdeps file (fine-grained when needed) and only emit dot file for -emit-fine-grained-dependency-sourcefile-dot-files

Use deterministic order for more information outputs.

Set EnableFineGrainedDependencies consistently in frontend.

Tolerate errors that result in null getExtendedNominal()

Fix memory issue by removing node everywhere.

Break up print routine

Be more verbose so it will compile on Linux.

Sort batchable jobs, too.
2020-01-04 14:37:06 -08:00
Dave Lee
477763e7ed DivideRoundingUp 2020-01-04 06:53:37 -08:00
Dave Lee
d06d0394ed Remove incomplete bit about properties 2020-01-01 23:39:21 -08:00
Dave Lee
8a6f44da6b Extract DivideUp lambda 2020-01-01 23:35:12 -08:00
Dave Lee
17655b7c3e Correct batch mode partitiion count calculation 2019-12-31 07:32:15 -08:00
Saleem Abdulrasool
7d8aac60ca disambiguate some type shadowing (NFCI)
Adjust the type shadowing identified by GCC 7.  The declaration shadows
a type which changes the meaning of the identifier subsequently.
2019-12-23 15:34:55 -08:00
David Ungar
419240f4c3 Make path suitable for Windows 2019-12-20 10:47:12 -08:00
David Ungar
2a79331ac3 add -enable/disable-only-one-dependency-file flag, on by default 2019-12-18 16:07:51 -08:00
David Ungar
73a46ce57e Revert "[Incremental, Driver] Only emit a real make-style dependency file for one frontend job." 2019-12-12 22:26:25 -08:00
David Ungar
4c365a7735 Merge pull request #28702 from davidungar/only-one-dependency-file
[Incremental, Driver] Only emit a real make-style dependency file for one frontend job.
2019-12-11 21:21:41 -08:00
David Ungar
46687189a7 -only-one-dependency-file causes only the first frontend job to emit a real dependency file. 2019-12-10 22:52:57 -08:00
David Ungar
9bfed89e8c markTransitive & markExternal return the jobs, unfmt 2019-12-08 11:15:51 -08:00
David Ungar
0771d96986 Format 2019-12-08 10:14:24 -08:00
David Ungar
ebb77e8ee8 ExpDepGraph -> FineGrainedDepGraph 2019-12-08 09:44:47 -08:00
David Ungar
86a76cb2ea Merge pull request #28566 from davidungar/renaming-dependencies-2
Rename older dependency graph to "CoarseGrainedDependencyGraph"
2019-12-05 09:35:33 -08:00
Daniel Rodríguez Troitiño
5a6343f6f4 Merge pull request #28561 from compnerd/spectre-humanised
Driver: fix the Windows build after #28543
2019-12-04 12:22:07 -08:00
David Ungar
bc068ae68e format 2019-12-04 10:51:18 -08:00
David Ungar
8dc04c7912 Rename DependencyGraph and DependencyGraphImp with CoarseGrained prefix. 2019-12-04 10:51:18 -08:00
David Ungar
2ff5855c63 Rename DependencyGraphImpl -> CoarseGrainedDependencyGraphImpl, unformatted 2019-12-04 10:51:18 -08:00
David Ungar
200b181eb3 Renaming files -> CoarseGrained 2019-12-04 10:51:18 -08:00
Saleem Abdulrasool
ed4fe81129 Driver: fix the Windows build after #28543
Repair the VS2017 build after #28543.  It would fail to convert the
dependency set's keys into a vector of StringRefs:

```
error C2678: binary '*': no operator found which takes a left-hand operand of type 'const _Iter' (or there is no acceptable conversion)
        with [
            _Iter=llvm::StringMapKeyIterator<char>
        ]
C:\agent\_work\2\s\toolchain\llvm\include\llvm/ADT/StringMap.h(549): note: could be 'llvm::StringRef &llvm::StringMapKeyIterator<ValueTy>::operator *(void)'
        with
        [
            ValueTy=char
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\xmemory(217): note: while trying to match the argument list '(const _Iter)'
        with
        [
            _Iter=llvm::StringMapKeyIterator<char>
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\vector(1823): note: see reference to function template instantiation '_FwdIt *std::_Uninitialized_copy<_Iter,llvm::StringRef*,std::allocator<_Ty>>(const _InIt,const _InIt,_FwdIt,_Alloc &)' being compiled
        with
        [
            _FwdIt=llvm::StringRef *,
            _Iter=llvm::StringMapKeyIterator<char>,
            _Ty=llvm::StringRef,
            _InIt=llvm::StringMapKeyIterator<char>,
            _Alloc=std::allocator<llvm::StringRef>
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\vector(708): note: see reference to function template instantiation 'llvm::StringRef *std::vector<llvm::StringRef,std::allocator<_Ty>>::_Ucopy<_Iter>(_Iter,_Iter,llvm::StringRef *)' being compiled
        with
        [
            _Ty=llvm::StringRef,
            _Iter=llvm::StringMapKeyIterator<char>
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\vector(708): note: see reference to function template instantiation 'llvm::StringRef *std::vector<llvm::StringRef,std::allocator<_Ty>>::_Ucopy<_Iter>(_Iter,_Iter,llvm::StringRef *)' being compiled
        with
        [
            _Ty=llvm::StringRef,
            _Iter=llvm::StringMapKeyIterator<char>
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\vector(723): note: see reference to function template instantiation 'void std::vector<llvm::StringRef,std::allocator<_Ty>>::_Range_construct_or_tidy<_Iter>(_Iter,_Iter,std::forward_iterator_tag)' being compiled
        with
        [
            _Ty=llvm::StringRef,
            _Iter=llvm::StringMapKeyIterator<char>
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\vector(723): note: see reference to function template instantiation 'void std::vector<llvm::StringRef,std::allocator<_Ty>>::_Range_construct_or_tidy<_Iter>(_Iter,_Iter,std::forward_iterator_tag)' being compiled
        with
        [
            _Ty=llvm::StringRef,
            _Iter=llvm::StringMapKeyIterator<char>
        ]
C:\agent\_work\2\s\toolchain\swift\lib\Driver\Compilation.cpp(1571): note: see reference to function template instantiation 'std::vector<llvm::StringRef,std::allocator<_Ty>>::vector<IteratorT,void>(_Iter,_Iter,const _Alloc &)' being compiled
        with
        [
            _Ty=llvm::StringRef,
            IteratorT=llvm::StringMapKeyIterator<char>,
            _Iter=llvm::StringMapKeyIterator<char>,
            _Alloc=std::allocator<llvm::StringRef>
        ]
C:\agent\_work\2\s\toolchain\swift\lib\Driver\Compilation.cpp(1571): note: see reference to function template instantiation 'std::vector<llvm::StringRef,std::allocator<_Ty>>::vector<IteratorT,void>(_Iter,_Iter,const _Alloc &)' being compiled
        with
        [
            _Ty=llvm::StringRef,
            IteratorT=llvm::StringMapKeyIterator<char>,
            _Iter=llvm::StringMapKeyIterator<char>,
            _Alloc=std::allocator<llvm::StringRef>
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\xmemory(217): error C2100: illegal indirection
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\\include\xmemory(217): error C2062: type 'unknown-type' unexpected
```

Attempt to make it more explicit with a `std::copy`.
2019-12-04 09:30:12 -08:00
David Ungar
6a6e9357ef Change "experimental" to "fine-grained". 2019-12-04 08:50:44 -08:00
David Ungar
496e602bff Renaming files 2019-12-04 08:38:59 -08:00
David Ungar
3d3507b7b6 Remove unparsed ranges and use diffs to schedule dependents earlier. 2019-12-03 17:23:02 -08:00
David Ungar
3cba2306ca Moving tests and driver refactoring. 2019-12-03 09:24:17 -08:00
David Ungar
448d9df38c Merge pull request #28444 from davidungar/WIP-custom-diff
Fix memory violation when build record is bad.
2019-12-02 10:55:59 -08:00
David Ungar
08cfe80061 Don't crash when asking for comparison but not incremental 2019-11-23 11:21:33 -08:00
David Ungar
62ae2bfd2f Merge pull request #28164 from davidungar/WIP-custom-diff
[Incremental compilation] Source-range-based dependencies
2019-11-21 23:47:52 -08:00
David Ungar
68f0ea2290 fmt 2019-11-21 00:01:34 -08:00
David Ungar
468a23cef9 report stages unfmt 2019-11-20 13:28:19 -08:00