Commit Graph

693 Commits

Author SHA1 Message Date
Xi Ge
e107182f1a Merge remote-tracking branch 'apple/master' into master-rebranch 2020-09-02 18:36:37 -07:00
Varun Gandhi
4350a96303 Merge pull request #33640 from varungandhi-apple/vg-fix-module-trace-cycle
[ModuleTrace] Handle cycle detection edge case in module trace emission (ep2).
2020-09-02 11:59:52 -07:00
Varun Gandhi
3e7f33971c [ModuleTrace] Handle cycle detection edge case in module trace emission (ep2).
Fixes rdar://67704000.
2020-09-01 14:23:14 -07:00
Nathan Hawes
9da1d89520 Manually merge remote-tracking branch 'upstream/master' into HEAD
Conflicts:
	lib/AST/ExtInfo.cpp
2020-08-31 10:50:54 -07:00
Robert Widmann
4c56c95674 Define doesActionRequireInputs 2020-08-27 16:17:20 -07:00
Robert Widmann
fe7444ffa3 Add doesActionRequireSwiftStandardLibrary 2020-08-27 16:17:20 -07:00
Robert Widmann
4c7ccf5abe [NFC] Clean Up FrontendTool
Try to impose a simple structure that splits performing actions from the
pre and post-pipeline conditions. Wherever actions would take more than
a simple return, split them into functions. Refine functions that
perform effects to return status codes when they fail. Finally,
delineate functions that need semantic analysis from those that do not.

Overall this should be NFC.
2020-08-27 16:15:44 -07:00
Yuta Saito
43fb346b67 [Frontend] Set up output file .swiftmodule.summary
This patch focus on teaching frontend and driver to emit this file.
The actual serialization and deserialization implementation will come
later.
2020-08-27 00:41:16 +09:00
swift_jenkins
258b72273c Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-24 21:36:02 -07:00
Brent Royal-Gordon
8fbd449501 Merge pull request #33114 from brentdax/check-your-interfaces-at-the-door
Verify that just-emitted module interfaces parse and typecheck
2020-08-24 20:33:58 -07:00
Nathan Hawes
280d4c995a Merge remote-tracking branch 'upstream/master' into HEAD 2020-08-21 22:23:58 -07:00
Xi Ge
f3045ff9c2 DependenciesScanner: teach batch scanning mode to configure scanner using specified additional arguments
To help solving rdar://67079780, this change allows swift-driver to configure scanner using additional
arguments passed down via the batch input JSON file for each module under scanning.
2020-08-21 12:06:14 -07:00
swift_jenkins
21c2e0ebac Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-20 20:54:07 -07:00
Xi Ge
5a1f38bf41 Merge pull request #33569 from nkcsgexi/batch-scanning-protocol
DependenciesScanner: implement protocol for batch module dependencies scan
2020-08-20 20:06:40 -07:00
swift_jenkins
ac8122598c Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-20 18:35:29 -07:00
Varun Gandhi
260125e7ae [ModuleTrace] Early exit if a Clang module imports itself.
Fixes rdar://67435472.
2020-08-20 14:53:06 -07:00
Xi Ge
29e655bac0 DependenciesScanner: implement protocol for batch module dependencies scan
This scanning mode allows swift-driver to query module dependencies in a batch
and in a more granular way. In short term, it could help solve a problem that
clang module dependencies may vary if target triple changes. In a longer term,
we could break a holistic dependencies graph into smaller pieces for better caching
and reusing.

This change doesn't include the implementation of using the specified scanner
arguments to set up Clang dependencies scanner. It will come in later commits.
2020-08-20 14:06:47 -07:00
swift_jenkins
28cce4af82 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-18 10:54:41 -07:00
Xi Ge
9988911232 Frontend: add a new action -scan-clang-dependencies to scan a PCM's dependencies
For the issue mentioned in rdar://67079780, swift-driver needs to run clang dependencies
scanner multiple times with different target triples for a Swift target. This patch adds
a new scanning action to generate the JSON file for a given clang module to accommodate
this requirement.

Resolves: rdar://problem/67269210
2020-08-17 22:02:32 -07:00
swift_jenkins
9ab003bcf9 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-14 15:14:01 -07:00
Nathan Hawes
51beab6889 Manually merge remote-tracking branch 'upstream/master' into HEAD
Conflicts:
	test/DebugInfo/modulecache.swift
2020-08-13 11:16:33 -07:00
Hamish Knight
f6976d8620 Have TBDGenDescriptor take ownership of TBDGenOptions
This is necessary for caching TBD requests.
2020-08-13 10:21:37 -07:00
Varun Gandhi
ad4aba8b98 Merge pull request #33377 from varungandhi-apple/vg-fix-module-trace-cycle
[ModuleTrace] Handle cycle detection edge case in module trace emission.
2020-08-11 23:22:39 -07:00
Varun Gandhi
0ca8458189 [NFC] Remove caching for "isOverlay" computation when emitting a trace.
Based on measurements, it seemed to save about 0.2 ms - 0.4 ms for a module
with a large number of imports from the SDK. That's insignificant compared to
the compile time for a typical module, which usually takes somewhere between
a few seconds and a few minutes.
2020-08-08 01:02:40 -07:00
Varun Gandhi
99cefe707e [ModuleTrace] Handle cycle detection edge case in module trace emission.
Fixes rdar://66512316.
2020-08-07 18:07:29 -07:00
Brent Royal-Gordon
9bc787ef5f Add a “typecheck module interface” mode 2020-08-07 16:00:15 -07:00
Nathan Hawes
607e2b8822 Manually merge remote-tracking branch 'upstream/master' into HEAD 2020-08-04 13:47:48 -07:00
Dario Rexin
0850436d9f Properly compute resource folder when linking statically
- deduplicate the logic to compute the resource folder
- install headers and module files in shared and static resource folders
- forward -static flag when calling swiftc with -print-target-info
2020-07-30 15:07:03 -07:00
Nathan Hawes
498e767765 Manually merge remote-tracking branch 'upstream/master' into merge-m-to-mr 2020-07-27 22:41:53 -07:00
Hamish Knight
81d455d701 Merge pull request #33107 from hamishknight/tbd-two 2020-07-27 17:03:05 -07:00
Nathan Hawes
e3a2059393 [master-rebranch] Fix up missing include causing build failures. 2020-07-27 12:32:52 -07:00
Nathan Hawes
b0a2230860 Manually merge remote-tracking branch 'upstream/master' into merge-in-master 2020-07-27 09:25:01 -07:00
Varun Gandhi
1ddf4ff790 [Gardening] Use consistent style for referencing notes. 2020-07-25 23:36:17 -07:00
Hamish Knight
3ae136ce7d [Frontend] Fix error detection
Seperating out TBD file generation uncovered a bug
in the frontend where we could fail to notice that
we emitted an error during the end-of-pipeline
actions and returned a zero exit code. Tweak the
logic to detect this case.
2020-07-24 15:49:08 -07:00
Varun Gandhi
497e049401 Merge pull request #32738 from varungandhi-apple/vg-fix-indirect-dep
[ModuleTrace] Track direct dependencies through #import and @_exported import
2020-07-24 14:15:01 -07:00
Varun Gandhi
7e34fb040a [ModuleTrace] More precise dependency tracking through ObjC.
We need to traverse the module dependency graph and track which modules expose
which other modules' ABIs, while making sure that we don't hit a loop while
trawling through Clang (sub)modules.

Fixes rdar://64993153.
2020-07-23 19:25:02 -07:00
Nathan Hawes
9d4ed5f39c Manually merge remote-tracking branch 'upstream/master' into manually-merge-master-to-master-rebranch 2020-07-20 16:09:55 -07:00
Varun Gandhi
986f27f771 [NFC] Separate out trace import filtering into a separate function. 2020-07-18 01:22:42 -07:00
Robert Widmann
638977454b Remove SharedTimer Infrastructure
Teach the UnifiedStatsReporter to directly construct
llvm::NamedRegionTimer for itself.
2020-07-16 17:35:50 -07:00
Robert Widmann
2198d7174c Remove -debug-time-compilation
This flag no longer does anything now that the unified statistics
reporting infrastructure exists. It is better to use
-driver-time-compilation to see a bird's eye view of timing statistics
for frontend jobs, and -stats-output-dir to see a down-and-dirty view of
everything including performance counters.
2020-07-16 17:35:50 -07:00
Hamish Knight
9b2bcd13f9 [TBDGen] Return a vector of symbols instead of set
A couple of clients are iterating over the result,
so switch to a vector to ensure we don't
accidentally introduce any non-determinism.

(cherry picked from commit 56929fdaaa)
2020-07-15 18:41:57 -07:00
Hamish Knight
4daeb4fa3a Sink linker directive computation into IRGen
With an inverted pipeline, IRGen needs to be able
to compute the linker directives itself, so sink
it down such that it can be computed by the
`IRGenDescriptor`.

(cherry picked from commit c0a2ea7d0e)
2020-07-15 18:41:52 -07:00
Hamish Knight
e284d7e8e5 [TBDGen] Make enumeratePublicSymbols more functional
Instead of taking an out parameter, have it return
the set directly. Also coalesce the two overloads
into a single overload that takes a
`TBDGenDescriptor`.

(cherry picked from commit 0e97ecedd6)
2020-07-15 18:41:42 -07:00
Hamish Knight
f9d70661dd [IRGen] Hash compiler version instead of lang version
The LLVM passes we apply don't depend on the language
version, only the compiler version.
2020-07-15 16:46:41 -07:00
Hamish Knight
45f11c8615 [IRGen] Allow IRGenDescriptor to hold a FileUnit
This will allow it to better interact with the
SILGen descriptor.
2020-07-15 16:46:41 -07:00
Hamish Knight
c354b0faa1 [TBDGen] Return a vector of symbols instead of set
A couple of clients are iterating over the result,
so switch to a vector to ensure we don't
accidentally introduce any non-determinism.
2020-07-13 20:42:54 -07:00
Hamish Knight
db7fea4665 Sink linker directive computation into IRGen
With an inverted pipeline, IRGen needs to be able
to compute the linker directives itself, so sink
it down such that it can be computed by the
`IRGenDescriptor`.
2020-07-13 20:42:54 -07:00
Hamish Knight
b5f9e05255 [TBDGen] Make enumeratePublicSymbols more functional
Instead of taking an out parameter, have it return
the set directly. Also coalesce the two overloads
into a single overload that takes a
`TBDGenDescriptor`.
2020-07-13 20:42:53 -07:00
Varun Gandhi
e72629df92 Merge pull request #32771 from varungandhi-apple/vg-include-spi-deps-in-trace
Include SPI dependencies in module trace.
2020-07-10 13:48:31 -07:00
Varun Gandhi
7c366839b3 [FrontendTool] Include SPI dependencies in module trace. 2020-07-08 17:57:50 -07:00