Commit Graph

531 Commits

Author SHA1 Message Date
Brent Royal-Gordon
6cce3d374e Add swiftcrossimport and swiftoverlays file_types 2020-02-18 11:06:12 -08:00
swift-ci
0dc9c02d07 Merge pull request #29772 from DougGregor/disable-one-dependency-file 2020-02-11 17:20:54 -08:00
Robert Widmann
054d7b9913 Merge pull request #29713 from CodaFi/unused-unwanted-unloved
[Gardening] Silence Some Warning Spew
2020-02-11 15:46:16 -08:00
Doug Gregor
d000065ab1 Revert "Change to defaulting on"
This reverts commit b1f6a8941c. This
change is causing some instability with incremental builds, so we're
backing it out. Fixes rdar://problem/59016969.
2020-02-11 15:34:48 -08:00
Robert Widmann
d2360d2e8c [Gardening] dyn_cast -> isa 2020-02-07 16:09:31 -08:00
swift-ci
9d310503ce Merge remote-tracking branch 'origin/master' into master-rebranch 2020-02-03 19:03:03 -08:00
Brent Royal-Gordon
b4771c20a0 Merge pull request #29591 from brentdax/stay-on-target
Add target variant to -print-target-info
2020-02-03 19:00:50 -08:00
swift-ci
782b4e1bfa Merge remote-tracking branch 'origin/master' into master-rebranch 2020-02-03 15:42:56 -08:00
Xi Ge
273500ec76 Driver: add an option to avoid emitting .swiftsourceinfo files 2020-02-03 13:05:23 -08:00
Brent Royal-Gordon
161061f8a3 Pass target-variant through the driver for -print-target-info 2020-02-01 15:33:38 -08:00
swift-ci
81a6a266aa Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-27 18:23:23 -08:00
David Ungar
d61f6f2f66 Changes to support per-type-body fingerprints. 2020-01-27 15:14:46 -08:00
swift-ci
f324eb6a1e Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-23 15:04:45 -08:00
David Ungar
2f79ff7875 Merge pull request #29390 from davidungar/centralizeDefault
[Incremental] Use the initial value of EnableFineGrainedDependencies as the default.
2020-01-23 14:58:50 -08:00
David Ungar
98b86c63d1 Use the initial value of EnableFineGrainedDependencies as the default. 2020-01-23 12:12:17 -08:00
swift-ci
810bf82c09 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-23 00:37:05 -08:00
Keith Smiley
8c8c9784d6 Add -no-whole-module-optimization (#29362)
This adds an argument to allow negating `-whole-module-optimization`.
This is useful for cases where it's easier to add an extra flag to your
swiftc invocation rather than removing the original one.
2020-01-23 00:13:00 -08:00
Erik Eckstein
bbfaccda4b Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-22 08:25:23 +01:00
Devin Coughlin
655d89b146 [Driver/Frontend] Add Driver support for macCatalyst and library search paths
Add support in the driver and frontend for macCatalyst target
targets and library search paths.

The compiler now adds two library search paths for overlays when compiling
for macCatalyst: one for macCatalyst libraries and one for zippered macOS
libraries. The macCatalyst path must take priority over the normal macOS path
so that in the case of 'unzippered twins' the macCatalyst library is
found instead of the macOS library.

To support 'zippered' builds, also add support for a new -target-variant
flag. For zippered libraries, the driver invocation takes both a -target and a
-target-variant flag passes them along to the frontend. We support builds both
when the target is a macOS triple and the target variant is macCatalyst and
also the 'reverse zippered' configuration where the target is macCatalyst and the
target-variant is macOS.
2020-01-21 18:28:17 -08:00
swift-ci
e280ebe9b7 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-12 21:44:31 -08:00
David Ungar
cc89dad526 Fine-grained and driver fixes.
Restructure fine-grained-dependencies to enable unit testing

Get frontend to emit correct swiftdeps file (fine-grained when needed) and only emit dot file for -emit-fine-grained-dependency-sourcefile-dot-files

Use deterministic order for more information outputs.

Set EnableFineGrainedDependencies consistently in frontend.

Tolerate errors that result in null getExtendedNominal()

Fix memory issue by removing node everywhere.

Break up print routine

Be more verbose so it will compile on Linux.

Sort batchable jobs, too.
2020-01-11 21:57:14 -08:00
swift-ci
e0c29988fe Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-10 15:04:04 -08:00
Ashley Garland
7a3a0a9e23 Symbol graph support
Adds a tool `swift-symbolgraph-extract` that reads an existing Swift
module and prints a platform- and language-agnostic JSON description of
the module, primarly for documentation.

Adds a small sub-library `SymbolGraphGen` which houses the core
implementation for collecting relevant information about declarations.
The main entry point is integrated directly into the driver as a mode:
the tool is meant to be run outside of the normal edit-compile-run/test
workflow to avoid impacting build times.

Along with common options for other tools, unique options include
`pretty-print` for debugging, and a `minimum-access-level` options for
including internal documentation.

A symbol graph is a directed graph where the nodes are symbols in a
module and the edges are relationships between them. For example, a
`struct S` may have a member `var x`. The graph would have two nodes for
`S` and `x`, and one "member-of" relationship edge. Other relationship
kinds include "inherits-from" or "conforms to". The data format for a
symbol graph is still under development and may change without notice
until a specificiation and versioning scheme is published.

Various aspects about a symbol are recorded in the nodes, such as
availability, documentation comments, or data needed for printing the
shapes of declarations without having to understand specifics about the
langauge.

Implicit and public-underscored stdlib declarations are not included by
default.

rdar://problem/55346798
2020-01-10 09:53:37 -08:00
swift_jenkins
21401ad11f Merge remote-tracking branch 'origin/master' into master-next 2019-12-19 11:59:47 -08:00
Vinicius Vendramini
aebfb53966 Ast dump ignore wmo (#20596)
* Ignore -wmo when passing -dump-ast

* Cleanup on driver diagnostics

* Remove the FIXME.

* Add support for ignoring `-index-file`

* Revert unrelated formatting changes

* Revert back to only ignoring `-wmo`

Ignoring both `-wmo` and `-index-file` will be harder than just `-wmo`. This is because when calling the compiler and passing `-index-file` after `-dump-ast`, the option gets un-ignored by `Driver::buildOutputInfo`. Therefore, we will just ignore `-wmo` for now.

* Add tests, inspired by `Driver/batch_mode_with_WMO_or_index.swift`
2019-12-19 11:47:47 -08:00
swift_jenkins
9a7d347076 Merge remote-tracking branch 'origin/master' into master-next 2019-12-19 09:40:15 -08:00
David Ungar
b1f6a8941c Change to defaulting on 2019-12-19 07:38:59 -08:00
swift_jenkins
f421f1f3e9 Merge remote-tracking branch 'origin/master' into master-next 2019-12-19 00:59:44 -08:00
David Ungar
0291b36739 off-by-default & fix tests 2019-12-18 22:35:26 -08:00
David Ungar
2a79331ac3 add -enable/disable-only-one-dependency-file flag, on by default 2019-12-18 16:07:51 -08:00
swift_jenkins
3b15474d0b Merge remote-tracking branch 'origin/master' into master-next 2019-12-13 00:20:06 -08:00
David Ungar
73a46ce57e Revert "[Incremental, Driver] Only emit a real make-style dependency file for one frontend job." 2019-12-12 22:26:25 -08:00
swift_jenkins
fa658f594f Merge remote-tracking branch 'origin/master' into master-next 2019-12-11 21:39:59 -08:00
David Ungar
4c365a7735 Merge pull request #28702 from davidungar/only-one-dependency-file
[Incremental, Driver] Only emit a real make-style dependency file for one frontend job.
2019-12-11 21:21:41 -08:00
David Ungar
ecb74b54ae Make the new behavior the default. 2019-12-10 23:17:42 -08:00
David Ungar
46687189a7 -only-one-dependency-file causes only the first frontend job to emit a real dependency file. 2019-12-10 22:52:57 -08:00
Joe Groff
fb34044408 Merge remote-tracking branch 'origin/master' into master-next 2019-12-10 12:46:41 -08:00
Saleem Abdulrasool
e2d208d358 IRGen,Driver: extract tool usage into a variable (NFC)
autolink-extract is needed on ELF (and windows-cygnus).  However, WASM
also has gone down this path and did not actually indicate that it
needed the autolink extract handling.  Extract the handling check into a
variable which helps readability.
2019-12-09 21:46:25 -08:00
Doug Gregor
f451dc4177 Merge pull request #28646 from DougGregor/print-target-info-paths
[Frontend] Add some paths to the output of -print-target-info.
2019-12-09 10:00:04 -08:00
Doug Gregor
c92600b38b [Frontend] Add some paths to the output of -print-target-info.
Add various target-specific and compiler-determined paths to the output
of `-print-target-info`, such as the runtime resource path, SDK path, and
runtime library paths.
2019-12-08 21:10:30 -08:00
Doug Gregor
179e3c2ab4 Merge pull request #28602 from DougGregor/print-target-triple
[Driver/Frontend] Add -print-target-triple
2019-12-07 10:51:38 -08:00
Doug Gregor
61c83d2415 [Driver] Switch -print-target-triple to -print-target-info and add more info.
Rather than only emitting the target triple, provide additional
information about that particular target, including the module triple
(i.e., what file names will be used for Swift modules for that
triple), the runtime compatibility version if there is one, and
whether linking with rpaths is required for the standard library and
other libraries shipped with Swift. Encode this as JSON so we can
extend it in the future. For now, it looks like this:

```
{
  "target": {
    "triple": "arm64-apple-ios12.0",
    "moduleTriple": "arm64-apple-ios",
    "swiftRuntimeCompatibilityVersion": "5.0",
    "librariesRequireRPath": true
  }
}
```

Which you can deserialize into a TargetInfo instance as defined below:

```
struct Target: Codable {
  /// The target triple.
  var triple: String
  /// The triple used for module file names.
  var moduleTriple: String
  /// If this platform provides the Swift runtime, the Swift language
  version
  /// with which that runtime is compatible.
  var swiftRuntimeCompatibilityVersion: String?
  /// Whether linking against the Swift libraries requires the use of
  rpaths.
  var librariesRequireRPath: Bool
}

struct TargetInfo: Codable {
  var target: Target
}
```

Implements rdar://problem/47095159.
2019-12-06 22:17:29 -08:00
Doug Gregor
cfe25eabb0 [Driver/Frontend] Add -print-target-triple
Add a -print-target-triple command line option to the Swift frontend
and driver to allow other tools (e.g., SwiftPM) to query the host
triple as it is understood by the Swift compiler. This follows the
precedent set by Clang. Implements rdar://problem/57434967.
2019-12-05 17:23:13 -08:00
Saleem Abdulrasool
23b1a6b87a Driver: add support for WASI/WASM toolchain
Treat WASM/WASI as a generic Unix toolchain.  This adds the necessary
support to build a toolchain for WASM/WASI.
2019-12-04 20:14:08 -08:00
David Ungar
4d2c46c9a5 Format 2019-12-04 08:51:33 -08:00
David Ungar
6a6e9357ef Change "experimental" to "fine-grained". 2019-12-04 08:50:44 -08:00
David Ungar
448d9df38c Merge pull request #28444 from davidungar/WIP-custom-diff
Fix memory violation when build record is bad.
2019-12-02 10:55:59 -08:00
David Ungar
5b0c4b2486 Fix memory violation when build record is bad. 2019-11-22 14:56:31 -08:00
David Ungar
62ae2bfd2f Merge pull request #28164 from davidungar/WIP-custom-diff
[Incremental compilation] Source-range-based dependencies
2019-11-21 23:47:52 -08:00
David Ungar
ae64f471cd Reporting refactoring 2019-11-19 16:42:21 -08:00