Commit Graph

595 Commits

Author SHA1 Message Date
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
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
Doug Gregor
618af0420f [Frontend] Add compatibility libraries to -print-target-info.
The driver and any other client that attempts to properly link Swift
code need to know which compatibility libraries should be linked on a
per-target basis. Vend that information as part of -print-target-info.
2020-07-07 23:57:10 -07:00
Doug Gregor
7bf676d335 [Frontend] Add compiler version information to -print-target-info output.
Clients that use -print-target-info can avoid an extra frontend
invocation by using this information.
2020-07-07 22:11:19 -07:00
Hamish Knight
553dadd87e [Frontend] dumpAPI at the end of the pipeline
This allows us to remove another condition that
was previously preventing the ASTContext from being
freed before LLVM.
2020-06-29 15:26:28 -07:00
Hamish Knight
4ca67327fe [Frontend] NFC: Move dumpAPI up a bit 2020-06-29 15:26:27 -07:00
Hamish Knight
958bf8e3fd [Frontend] Move dependency verifier to end of pipeline
Allow the verification of dependencies before LLVM,
allowing the freeing of the ASTContext.
2020-06-29 15:26:27 -07:00
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
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
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
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
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
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
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
Hamish Knight
c6de4fafed [Frontend] Factor out performEndOfPipelineActions 2020-05-28 11:32:10 -07:00
swift_jenkins
9f94387751 Merge remote-tracking branch 'origin/master' into master-next 2020-05-28 09:18:46 -07:00
Erik Eckstein
266bd0fd87 Cross-module-optimization: issue an error if TBD file generation is requested with CMO
This combination is not supported and may result in undefined-symbol linker errors.

rdar://problem/63238999
2020-05-28 15:33:50 +02:00
swift_jenkins
0b2d4f6963 Merge remote-tracking branch 'origin/master' into master-next 2020-05-27 20:38:47 -07:00
Owen Voorhees
e40e86fc94 Merge pull request #32017 from owenv/diag-style-opt
[Diagnostics] Add -diagnostic-style=(llvm|swift) to control printed output
2020-05-27 20:22:23 -07:00
swift_jenkins
35191fe8b9 Merge remote-tracking branch 'origin/master' into master-next 2020-05-27 18:58:55 -07:00
Hamish Knight
bccdc0e062 NFC: Rename performSILGeneration -> performASTLowering
And also rename the underlying request and
descriptor.

This rename is motivated by the fact that the
operation may instead perform parsing of SIL files
and/or deserialization of SIB files.
2020-05-27 09:36:11 -07:00
swift_jenkins
69b940a8d3 Merge remote-tracking branch 'origin/master' into master-next 2020-05-22 20:58:53 -07:00
Robert Widmann
acbf927b0e [NFC] Delete ReferencedNameTracker 2020-05-21 18:54:14 -07:00
Owen Voorhees
c4e67e29ed [Diagnostics] Add -diagnostic-style=(llvm|swift) to control printed output
This default formatting style remains the same "LLVM style". "Swift style"
is what was previously enabled via -enable-experimental-diagnostic-formatting
2020-05-20 19:34:15 -05:00