Commit Graph

1187 Commits

Author SHA1 Message Date
Hamish Knight
12ae72c808 [Frontend] Move mangling stats to end of pipeline 2020-06-29 15:26:27 -07:00
Hamish Knight
7bc5440d17 [Frontend] Internalize createDependencyTracker
Expand the FrontendOptions to allow the enabling
of the dependency tracker for non-system
dependencies, and switch the previous clients of
`createDependencyTracker` over to using this
option. This ensures that the dependency tracker
is now set only during `CompilerInstance::setup`.
2020-06-29 15:26:26 -07:00
Hamish Knight
bddcda6333 [Frontend] Factor out setupDependencyTrackerIfNeeded
And call from `CompilerInstance::setup`.
2020-06-29 15:26:26 -07:00
swift_jenkins
6bea8ff31e Merge remote-tracking branch 'origin/master' into master-next 2020-06-25 00:19:28 -07:00
Doug Gregor
46f9f2147c [Frontend] Add --version as a frontend flag.
The new driver will defer to the frontend to print version information,
rather than embedded the version information itself.
2020-06-24 21:35:35 -07:00
swift_jenkins
75bea14185 Merge remote-tracking branch 'origin/master' into master-next 2020-06-23 10:39:14 -07:00
Robert Widmann
0da060e95e Merge pull request #32447 from martinboehme/option-set-initializer-list
Give OptionSet an initializer_list constructor
2020-06-23 10:36:57 -07:00
swift_jenkins
f5dc35b6b4 Merge remote-tracking branch 'origin/master' into master-next 2020-06-22 17:18:46 -07:00
Hamish Knight
4cd754e932 [DepScan] NFC: Remove check for OnoneSupport
This dependency is already recorded in the
`importInfo`'s `ModuleNames`.
2020-06-22 14:48:55 -07:00
Martin Boehme
d806ba53f6 Give OptionSet an initializer_list constructor.
This makes it easier to specify OptionSet arguments.

Also modify appropriate uses of ModuleDecl::ImportFilter to take
advantage of the new constructor.
2020-06-22 06:57:29 +02:00
swift_jenkins
a9e0eef729 Merge remote-tracking branch 'origin/master' into master-next 2020-06-18 12:58:30 -07:00
Hamish Knight
61a9a0d0f5 Merge pull request #32403 from hamishknight/over-and-out 2020-06-18 12:52:32 -07:00
Hamish Knight
b0bb723181 [Frontend] Handle errors from performEndOfPipelineActions
The use of `SWIFT_DEFER` previously meant that we
may return `false` from `performCompile` even if
an error was produced from
`performEndOfPipelineActions`.

To remedy this, introduce a lambda that both calls
`performEndOfPipelineActions`, and checks to see
if there was an error. Then, enforce that all exit
paths call this lambda.
2020-06-18 08:58:30 -07:00
Hamish Knight
63c8044f26 [Frontend] Move more outputs to end of pipeline
Move both the loaded module trace output and
"additional whole module outputs" to the end of
the pipeline, ensuring to preserve the behaviour
where we skip them if we encountered an error.
2020-06-18 08:58:29 -07:00
Hamish Knight
1e8f24a1e2 [Frontend] Move parsing outputs to end of pipeline 2020-06-18 08:58:29 -07:00
Hamish Knight
6ed0a87d43 [Frontend] Move .d generation to end of pipeline 2020-06-18 08:58:29 -07:00
Hamish Knight
11efc36a71 [Frontend] Move generic sig verification to end of pipeline 2020-06-18 08:58:29 -07:00
Hamish Knight
01825cb09f [Frontend] Move some stat collection to performEndOfPipelineActions
This better fits the model of an inverted pipeline
and ensures we capture all the work performed.
2020-06-18 08:58:28 -07:00
swift_jenkins
20ba5d3171 Merge remote-tracking branch 'origin/master' into master-next 2020-06-16 21:38:08 -07:00
Robert Widmann
057097a6c3 [NFC] Hide LoadedModules From Clients of ASTContext
There's no reason clients need to be able to access this data directly.
It obscures where module loading is actually happening, and makes it too
easy to accidentally register a module with the wrong identifier in the
context.

Hide the registration operations behind opaque accessors.
2020-06-16 15:09:19 -07:00
swift_jenkins
90dd9dbae8 Merge remote-tracking branch 'origin/master' into master-next 2020-06-16 14:18:53 -07:00
Xi Ge
b6a8af599e DependenciesScanner: move -fapinotes-swift-version to extra PCM arguments
Swift interface files may specify the effective language version to use. When building
a PCM loadable for these textual interface files, we should respect the language
version. This patch moves -fapinotes-swift-version from the generic PCM
commands to the extra PCM arguments owned by each loading Swift module.
2020-06-16 11:38:28 -07:00
Xi Ge
00872ba53e DependencyScanner: add a new extraPcmArgs field for each Swift module
Building each Swift module explicitly requires dependency PCMs to be built
with the exactly same deployment target version. This means we may need to
build a Clang module multiple times with different target triples.

This patch removes the -target arguments from the reported PCM build
arguments and inserts extraPcmArgs fields to each Swift module.
swift-driver can combine the generic PCM arguments with these extra arguments
to get the command suitable for building a PCM specifically for
that loading Swift module.
2020-06-16 09:42:59 -07:00
Robert Widmann
a5ef6f28b2 Adapt to ScanDeps to StringRef conversion removal
rdar://64263902
2020-06-15 11:19:22 -07:00
Xi Ge
f8bef59209 Merge remote-tracking branch 'apple/master' into apple-master-next 2020-06-12 14:20:06 -07:00
Xi Ge
22ead9f9f7 DepScanner: use emplace_back instead of push_back. rdar://64227623 2020-06-11 12:33:02 -07:00
Arnold Schwaighofer
6f03b3ec75 Fix compile error in ScanDependencies 2020-06-10 08:22:27 -07:00
swift_jenkins
e0326ac2e3 Merge remote-tracking branch 'origin/master' into master-next 2020-06-10 07:39:27 -07:00
David Zarzycki
017ee7bf04 [SIL] NFC: Simplify SILVTable and save 8 bytes per SILVTable
We were not using the primary benefits of an intrusive list, namely the
ability to insert or remove from the middle of the list, so let's switch
to a plain vector. This also avoids linked-list pointer chasing.
2020-06-10 07:54:23 -04:00
swift_jenkins
44d9926958 Merge remote-tracking branch 'origin/master' into master-next 2020-06-09 13:58:09 -07:00
Xi Ge
b65300f34e Merge pull request #32245 from nkcsgexi/scan-overlay-file
DependenciesScanner: teach the scanner to handle cross-import overlays
2020-06-09 13:39:38 -07:00
Xi Ge
42cc989136 DependenciesScanner: teach the scanner to handle cross-import overlays 2020-06-09 10:38:52 -07:00
David Zarzycki
4be1192904 Keep master-next building and tested 2020-06-09 06:05:05 -04:00
Karoy Lorentey
57ea964f2c Merge commit '3eb82c183662945687f48e11c09828f551b34858' into master-next
# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
2020-06-08 16:58:37 -07:00
Karoy Lorentey
68351d2110 Revert "Merge remote-tracking branch 'origin/master-next'"
This reverts commit 1c9b0908e6, reversing
changes made to 3eb82c1836.
2020-06-08 16:48:38 -07:00
Karoy Lorentey
1c9b0908e6 Merge remote-tracking branch 'origin/master-next'
# Conflicts:
#	include/swift/Frontend/FrontendInputsAndOutputs.h
2020-06-08 16:43:40 -07:00
Hamish Knight
1ed810653c [Frontend] Remove performParseOnly
Most clients were only using it to populate the
main module with files, which is now done by
`getMainModule`. Instead, they can now just rely
on parsing happening lazily.
2020-06-08 12:44:15 -07:00
Hamish Knight
7824dc1048 [Frontend] Move parse-only module load assert
Move into `performEndOfPipelineActions`, and move
the call up a bit in `performCompile` to make sure
it gets called even for a parse-only invocation.

Unfortunately this requires carving out an
exception for `-emit-imported-modules`, which can
load modules.
2020-06-08 12:44:15 -07:00
Hamish Knight
5d72c464eb [Frontend] Remove parsing option params from performParseOnly
Lift the `DisablePoundIfEvaluation` parsing option
into `LangOptions` to subsume the need for the
`EvaluateConditionals` parameter, and sink the
computation of `CanDelayBodies` down into
`createSourceFileForMainModule`.
2020-06-08 12:44:13 -07:00
Robert Widmann
b996a21d08 Merge pull request #32196 from ladd/levantol/perf-patch-d-files
Build dependency list once
2020-06-05 10:58:00 -07:00
Ladd Van Tol
b8abe55bc5 Build dependency list once
Remove changed lines
2020-06-04 15:34:30 -07:00
Xi Ge
28b0b22a42 ModuleInterface: refactor several configuration values into an Option struct 2020-06-02 16:51:45 -07:00
Xi Ge
3a214d99f6 Frontend: add an argument to disable implicitly built Swift modules 2020-06-02 16:51:45 -07:00
Hamish Knight
ab6c15f4b3 [Frontend] Bail early if the stdlib is missing
Rather than trying to continue the compilation
with an empty main module, let's bail out early if
we expect an implicit stdlib import and fail to
load in the stdlib.
2020-05-29 16:13:42 -07:00
swift_jenkins
df94ca4bc1 Merge remote-tracking branch 'origin/master' into master-next 2020-05-29 14:59:02 -07:00
Artem Chikin
26125f5e70 Merge pull request #32083 from artemcm/RecycleYourSwiftModules
[Fast Dependency Scanner] Ensure Swift modules don't depend on self.
2020-05-29 14:49:43 -07:00
Artem Chikin
99a0919b34 [Fast Dependency Scanner] Ensure Swift modules don't depend on self.
When resolving direct dependencies for a given Swift module, we go over all Clang module dependencies and add, as additional dependencies, their Swift overlays. We find overlays by querying `ASTContext::getModuleDependencies` with the Clang module's name. If the Clang module in question is a dependency of a Swift module with the same name, we will end up adding the Swift module as its own dependence.

e.g.
- Swift A depends on Clang A
  - Add Clang A to dependencies of Swift A
- We look for overlays of Clang A, by name, and find Swift A
  - Add Swift A to dependencies of Swift A

From what I can tell, the logic upstream is sound, and `getModuleDependencies` is doing the right thing, so this change is simply restricting what gets added when we are looking for overlays.

Resolves rdar://problem/63731428
2020-05-29 11:55:27 -07:00
swift_jenkins
b84e995326 Merge remote-tracking branch 'origin/master' into master-next 2020-05-28 16:38:52 -07:00
Hamish Knight
f43a15e336 Merge pull request #31983 from hamishknight/import-regulations 2020-05-28 16:29:51 -07:00
Hamish Knight
16c326eed3 [Frontend] Re-enable imported AST verification
The reasons for disabling it appear to now be
outdated. Re-enable it, and run it after the
entire pipeline has finished to make sure we
verify any decls deserialised during SIL/IRGen.
2020-05-28 11:32:11 -07:00