Commit Graph

611 Commits

Author SHA1 Message Date
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
swift_jenkins
10e1981971 Merge remote-tracking branch 'origin/master' into master-next 2020-05-13 13:37:47 -07:00
Robert Widmann
d82880a274 Merge pull request #31721 from CodaFi/const-of-proportionality
Const-Qualify LangOptions and TypeCheckerOptions
2020-05-13 13:36:15 -07:00
swift_jenkins
0fbb11da7a Merge remote-tracking branch 'origin/master' into master-next 2020-05-13 11:17:46 -07:00
Robert Widmann
eac92e3df0 [NFC] Const-Qualify LangOptions Accesses Through ASTContext 2020-05-13 09:13:44 -07:00
Slava Pestov
a301808144 Frontend: Go back to emitting index data after IRGen
There's no longer a technical reason to do this, but it helps
with crash analytics because AST crashes are less likely to
end up happening during index emission.
2020-05-13 00:27:54 -04:00
Arnold Schwaighofer
e12698d7a0 Merge remote-tracking branch 'origin/master' into master-next 2020-05-08 07:22:20 -07:00
Hamish Knight
98d3a81ede Merge pull request #31609 from hamishknight/ill-sil-you-in-later 2020-05-07 18:02:52 -07:00
swift_jenkins
8069dd1be9 Merge remote-tracking branch 'origin/master' into master-next 2020-05-07 08:20:47 -07:00
Hamish Knight
70abfd3252 [Frontend] Remove TheSILModule
Now that SIL parsing is handled lazily, the
CompilerInstance no longer needs to hang onto a
SILModule.
2020-05-06 20:11:49 -07:00
Hamish Knight
11d8f70dec Trigger SIL parsing from performSILGeneration
Rather than eagerly parsing an input .sil file
in `performSemaUpTo`, trigger it from
`performSILGeneration`. This will allow us to
remove the SILModule stored on the
CompilerInstance and will eventually allow the
various SIL tools to just call into
`performSILGeneration` without needing to call
`performSema`.
2020-05-06 20:11:48 -07:00
Slava Pestov
dd0ce1ad13 Remove the integrated REPL 2020-05-06 22:29:05 -04:00
swift_jenkins
d4f39f3eaa Merge remote-tracking branch 'origin/master' into master-next 2020-05-06 19:26:08 -07:00
Slava Pestov
5b6aa8d3d1 Frontend: Emit reference dependencies at the end of the frontend pipeline
As part of eliminating cascading dependencies, we need to make sure to
capture any dependencies discovered during SILGen and IRGen.

This is a little bit tricky because we exit early in various places in
the pipeline, so we want to do it after performCompileStepsPostSema()
returns, but we can't do it too late, because the ASTContext might
already have been deallocated.

So emit the dependencies manually before freeing the ASTContext if we
decide to do that, or just do it before returning from performCompile()
using a SWIFT_DEFER otherwise.

This should have no observable effect until we start recording dependencies
for lookups done on behalf of declarations in secondary files.
2020-05-06 18:42:37 -04:00
swift_jenkins
2af7cfcffe Merge remote-tracking branch 'origin/master' into master-next 2020-05-05 16:18:50 -07:00
Robert Widmann
b06211eac4 Initial plumbing for private dependencies
Add a mode bit to the dependency collector that respects the frontend flag in the previous commit.

Notably, we now write over the dependency files at the end of the compiler pipeline when this flag is on so that dependency from SILGen and IRGen are properly written to disk.
2020-05-05 13:48:25 -07:00
Robert Widmann
a082e9de26 [Gardening] Use the CompilerInstance's DiagnosticEngine
This keeps us honest about the const-ness of the CompilerInstance itself: emitting diagnostics is a transitively mutating operation.
2020-05-05 12:56:59 -07:00
swift_jenkins
9b6f01b6d9 Merge remote-tracking branch 'origin/master' into master-next 2020-04-30 20:37:34 -07:00
Daniel Sweeney
ea526c6383 Converting ModuleDecl::ImportedModule from std::pair to a dedicated struct. (#31360) 2020-04-30 20:26:03 -07:00
swift_jenkins
2fb0e14746 Merge remote-tracking branch 'origin/master' into master-next 2020-04-29 21:48:41 -07:00
Hamish Knight
f7ae7c0459 [Frontend] Avoid passing CompilerInvocation + CompilerInstance
The invocation can be retrieved from the
CompilerInstance.
2020-04-29 18:58:47 -07:00
swift_jenkins
4dc2e3c785 Merge remote-tracking branch 'origin/master' into master-next 2020-04-29 17:59:15 -07:00
Slava Pestov
fd9ffe70d8 Frontend: Write out index before SILGen
This cleans things up somewhat.

Fixes <rdar://problem/30433353>.
2020-04-29 19:20:40 -04:00
Slava Pestov
368d47429d Frontend: Remove coarse-grained dependency graph implementation 2020-04-29 16:55:53 -04:00
swift_jenkins
34a33d9972 Merge remote-tracking branch 'origin/master' into master-next 2020-04-25 09:58:23 -07:00
Saleem Abdulrasool
618ced846b Merge pull request #31310 from compnerd/unreachable
sprinkle some `llvm_unreachable` for MSVC (NFC)
2020-04-25 09:44:39 -07:00
swift_jenkins
ed20b9c058 Merge remote-tracking branch 'origin/master' into master-next 2020-04-24 23:58:13 -07:00
Saleem Abdulrasool
fa46f7131c sprinkle some llvm_unreachable for MSVC (NFC)
MSVC does not realize that the switch is exhaustive and requires that
the path is explicitly marked as unreachable.  This silences the C4715
warning ("not all control paths return a value").
2020-04-24 18:59:07 -07:00
Doug Gregor
71e7d6a913 [Dependency scanning] Add implicit Swift and SwiftOnoneSupport dependencies 2020-04-24 12:58:45 -07:00
Doug Gregor
08ec8781aa [Dependency scanning] Emit make-style dependency files.
If requested, produce the normal make-style dependency file from the
fast dependency scanner, using the same dependency-tracking
infrastructure.
2020-04-24 12:58:44 -07:00
Doug Gregor
33cdd61835 Fast dependency scanning for Swift
Implement a new "fast" dependency scanning option,
`-scan-dependencies`, in the Swift frontend that determines all
of the source file and module dependencies for a given set of
Swift sources. It covers four forms of modules:

1) Swift (serialized) module files, by reading the module header
2) Swift interface files, by parsing the source code to find imports
3) Swift source modules, by parsing the source code to find imports
4) Clang modules, using Clang's fast dependency scanning tool

A single `-scan-dependencies` operation maps out the full
dependency graph for the given Swift source files, including all
of the Swift and Clang modules that may need to be built, such
that all of the work can be scheduled up front by the Swift
driver or any other build system that understands this
option. The dependency graph is emitted as JSON, which can be
consumed by these other tools.
2020-04-24 12:58:41 -07:00
swift_jenkins
c2672fe6e9 Merge remote-tracking branch 'origin/master' into master-next 2020-04-19 23:58:17 -07:00
swift_jenkins
563adf9573 Merge remote-tracking branch 'origin/master' into master-next 2020-04-19 21:57:18 -07:00
Robert Widmann
37f016b802 [NFC] Formalize isModuleExternallyConsumed
Yank this parameter and document the historical scope creep of this value.
2020-04-19 21:46:59 -07:00
Robert Widmann
446c6e6682 [NFC] Refactor validateTBDIfNeeded
Inline the conditions for the astGuaranteedToCorrespondToSIL parameter and clean up the logic here to be more const-friendly. Also try to centralize and document the reasons we skip TBD validation.
2020-04-19 16:10:06 -07:00