Commit Graph

858 Commits

Author SHA1 Message Date
Brent Royal-Gordon
b440ab7331 [NFC] Move several types/functions to Import.h
To help consolidate our various types describing imports, this commit moves the following types and methods to Import.h:

* ImplicitImports
* ImplicitStdlibKind
* ImplicitImportInfo
* ModuleDecl::ImportedModule
* ModuleDecl::OrderImportedModules (as ImportedModule::Order)
* ModuleDecl::removeDuplicateImports() (as ImportedModule::removeDuplicates())
* SourceFile::ImportFlags
* SourceFile::ImportOptions
* SourceFile::ImportedModuleDesc

This commit is large and intentionally kept mechanical—nothing interesting to see here.
2020-10-09 18:57:07 -07:00
Robert Widmann
e646ef2cbe Add incrementalExternalDepend as an Incremental NodeKind 2020-09-25 01:16:01 -06:00
Robert Widmann
044f85ad9c Add ModuleDepGraphFactory
This completes the missing piece from #34073 and means the frontend may now serialize moduledecl-based dependencies.
2020-09-24 23:27:11 -06:00
Robert Widmann
76cd4bf160 [NFC] Differential Incremental External Dependencies in DependencyTracker
Also perform the plumbing necessary to convince the rest of the compiler that they're just ordinary external dependencies. In particular, we will still emit these depenencies into .d files, and code completion will still index them.
2020-09-24 23:25:47 -06:00
Robert Widmann
3c2b376aa2 [NFC] Refactor Reference Dependency Emission
Invert the responsibility of the entrypoint so that FrontendTool is directing the actual serialization work. The entrypoint now solely exists to construct a dependency graph.

While I'm here, prepare the way for serializing dependency graphs for modules by optimistically modeling a ModuleOrSourceFile input.
2020-09-24 20:07:02 -06:00
Mishal Shah
956b7a931c Merge pull request #34041 from apple/shahmishal/update-branch-doc
Update doc and links to support new main branch
2020-09-23 22:48:03 -07:00
Varun Gandhi
d3369f7711 [NFC] Rename ImportFilterKind cases to be clearer. 2020-09-23 12:50:20 -07:00
Mishal Shah
40024718ac Update doc and links to support new main branch 2020-09-22 23:53:29 -07:00
Robert Widmann
3287c4b271 [NFC] Refactor Main File Computation 2020-09-11 22:28:59 -06:00
Robert Widmann
c5a6cd6abe [NFC] Refactor getPrimaryOrMainSourceFile 2020-09-11 22:28:58 -06:00
Robert Widmann
a8766cce5b [NFC] Refactor InputFile's Accessors 2020-09-11 22:28:58 -06:00
Robert Widmann
8b725d8713 [NFC] Inline inputFileKindCanHaveTBDValidated 2020-09-11 21:24:26 -06:00
Robert Widmann
618b0b9eb6 Add doesActionPerformEndOfPipelineActions
For now, force the clang-based actions to skip the end of the pipeline. This restores the previous behavior of the frontend, but may not be desirable in the long run. For example, one may want to dump clang stats after running an -emit-pch job, but that is impossible without forcing the end of the pipeline to be more tolerant of ObjCHeader/modulemap-only inputs.

rdar://68587228
2020-09-11 13:57:28 -06:00
Robert Widmann
98765132c9 [Gardening] Document a Strange Sort 2020-09-09 10:39:22 -06:00
Max Desiatov
9685179e5f Merge pull request #33324 from kateinoigakukun/katei/swift-module-summary/frontend
[Frontend] Set up output file .swiftmodule.summary
2020-09-07 07:19:33 +01:00
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