Commit Graph

1174 Commits

Author SHA1 Message Date
Robert Widmann
5b22910830 Remove Fallback Infrastructure For Evaluator-Based Dependencies 2020-04-20 10:36:29 -07:00
Doug Gregor
b63e9a6bcf [Frontend] Infer simulator environment in the frontend, too.
Some code paths that see target triples go through the frontend
without seeing the driver. Therefore, perform the same "simulator"
inference for x86 iOS/tvOS/watchOS triples also in the frontend,
to ensure that we remain compatible. Also make sure that
-print-target-info performs the appropriate adjustment.
2020-04-20 08:50:35 -07:00
swift_jenkins
e44d529e6b Merge remote-tracking branch 'origin/master' into master-next 2020-04-20 08:37:18 -07:00
Artem Chikin
c11f013101 Merge pull request #31099 from artemcm/NoWarningsAsErrorsOption
Add compiler option to *disable* warnings-as-errors
2020-04-20 08:35:53 -07:00
swift_jenkins
c2672fe6e9 Merge remote-tracking branch 'origin/master' into master-next 2020-04-19 23:58:17 -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
swift_jenkins
9458dc803c Merge remote-tracking branch 'origin/master' into master-next 2020-04-19 18:18:29 -07:00
Saleem Abdulrasool
fbbf61f297 Revert "[Darwin] Further restrict inference of the simulator environment" 2020-04-19 16:43:22 -07:00
swift_jenkins
1acb641f2c Merge remote-tracking branch 'origin/master' into master-next 2020-04-17 21:17:31 -07:00
Doug Gregor
22cdddd84e Merge pull request #30771 from DougGregor/stop-inferring-simulator
[Darwin] Further restrict inference of the simulator environment
2020-04-17 20:59:39 -07:00
swift_jenkins
1df751a7db Merge remote-tracking branch 'origin/master' into master-next 2020-04-17 15:17:29 -07:00
Joe Groff
948372b87c Merge pull request #31087 from jckarter/compatibility-51
Start a Compatibility51 library for backporting fixes to Swift 5.1 runtimes
2020-04-17 15:06:50 -07:00
Artem Chikin
c3b0232c2c Add compiler option to *disable* warnings-as-errors
`-no-warnings-as-errors`

This functionality is required for build systems to be able to overload/disable a given Swift project's preference of treating warnings as errors.

Resolves rdar://problem/35699776
2020-04-17 12:10:26 -07:00
Joe Groff
42514f42e0 Start a Compatibility51 library for backporting fixes to Swift 5.1 runtimes 2020-04-17 10:41:48 -07:00
Doug Gregor
8339f32184 [Frontend] Infer simulator environment in the frontend, too.
Some code paths that see target triples go through the frontend
without seeing the driver. Therefore, perform the same "simulator"
inference for x86 iOS/tvOS/watchOS triples also in the frontend,
to ensure that we remain compatible. Also make sure that
-print-target-info performs the appropriate adjustment.
2020-04-16 21:42:43 -07:00
swift_jenkins
e59efb4415 Merge remote-tracking branch 'origin/master' into master-next 2020-04-16 11:17:36 -07:00
Doug Gregor
290e9edaf8 [Driver/Frontend] Add target variant SDK version for Catalyst. 2020-04-15 22:11:11 -07:00
Doug Gregor
548e28170a [Driver/Frontend] Thread the target SDK version through to the IR.
Teach the driver to pass the SDK version it computes (from the SDK
settings JSON in a Darwin-based platform's SDK) down into the frontend.
The frontend then sets that SDK version in the LLVM module, which
eventually makes its way into the Mach-O file.

Last part of rdar://problem/60332732.
2020-04-15 21:42:28 -07:00
swift_jenkins
1ff7e55ac9 Merge remote-tracking branch 'origin/master' into master-next 2020-04-10 21:59:39 -07:00
Erik Eckstein
6da902ef8b Add an option to completely disable SIL verification.
This is useful to disable SIL verification in an assert build of the compiler.
2020-04-10 20:10:24 +02:00
swift_jenkins
14b2e0a2bd Merge remote-tracking branch 'origin/master' into master-next 2020-04-08 11:40:06 -07:00
Dan Zheng
2eb460de4d [AutoDiff upstream] Add forward-mode differentiation. (#30878)
JVP functions are forward-mode derivative functions. They take original
arguments and return original results and a differential function. Differential
functions take derivatives wrt arguments and return derivatives wrt results.

`JVPEmitter` is a cloner that emits JVP and differential functions at the same
time. In JVP functions, function applications are replaced with JVP function
applications. In differential functions, function applications are replaced
with differential function applications.

In JVP functions, each basic block takes a differential struct containing callee
differentials. These structs are consumed by differential functions.
2020-04-08 11:29:21 -07:00
swift_jenkins
c1468d9eb2 Merge remote-tracking branch 'origin/master' into master-next 2020-04-07 19:21:15 -07:00
Artem Chikin
0d1013245e Merge pull request #30782 from artemcm/Rcross-import
Add -Rcross-import option
2020-04-07 19:04:47 -07:00
Artem Chikin
b679fd8738 Add -Rcross-import option
It is an optional, user-accessible mechanism to have the compiler tell you what it’s cross-importing.

Resolves rdar://problem/60381893
2020-04-02 19:45:39 -07:00
swift_jenkins
9d645c3782 Merge remote-tracking branch 'origin/master' into master-next 2020-04-02 03:42:02 -07:00
Dan Zheng
1308fc69c5 [AutoDiff] Simplify conditions enabling differentiable programming. (#30765)
Previously, two conditions were necessary to enable differentiable programming:
- Using the `-enable-experimental-differentiable-programming` frontend flag.
- Importing the `_Differentiation` module.

Importing the `_Differentiation` module is the true condition because it
contains the required compiler-known `Differentiable` protocol. The frontend
flag is redundant and cumbersome.

Now, the frontend flag is removed.
Importing `_Differentiation` is the only condition.
2020-04-02 03:24:03 -07:00
swift_jenkins
37ac3a7aba Merge remote-tracking branch 'origin/master' into master-next 2020-04-01 10:20:19 -07:00
Arnold Schwaighofer
1bde486a63 IRGen: Disable type layout based value witness generation at Onone
Type layout based witness generation can emit quite complex IR that will
lead to code bloat if the llvm optimizer is not run.

No need to use type layouts at Onone.

rdar://61155295
2020-04-01 07:18:23 -07:00
swift_jenkins
12a5da6dc6 Merge remote-tracking branch 'origin/master' into master-next 2020-03-31 18:24:02 -07:00
Robert Widmann
a337b67f69 Stage In Flags To Fall Back To Manual Tracking
Request-based incremental dependencies are enabled by default. For the time being, add a flag that will turn them off and switch back to manual dependency tracking.
2020-03-31 16:16:53 -07:00
swift_jenkins
acbf5bf9ae Merge remote-tracking branch 'origin/master' into master-next 2020-03-27 15:42:21 -07:00
Owen Voorhees
791312fb74 Turn Educational Notes On-By-Default (#30583)
* [Diagnostics] Turn educational notes on-by-default

* [Diagnostics] Only include educational notes in printed output if -print-educational-notes is passed

* Make -print-educational-notes a driver option

* [Diagnostics] Issue a printed remark if educational notes are available, but disabled

* [docs] Update educational notes documentation and add a contributing guide

* [Diagnostics] Cleanup PrintingDiagnosticConsumer handling of edu notes

* Revert "[Diagnostics] Issue a printed remark if educational notes are available, but disabled"
For now, don't notify users if edu notes are available but disabled. This decision can be reevaluated later.
2020-03-27 15:29:48 -07:00
swift_jenkins
68e5c887fb Merge remote-tracking branch 'origin/master' into master-next 2020-03-25 10:45:22 -07:00
Dan Zheng
e5cb871428 [AutoDiff upstream] Add flag-gated AdditiveArithmetic derivation. (#30628)
Add `AdditiveArithmetic` derived conformances for structs, gated by the
`-enable-experimential-additive-arithmetic-derivation` flag.

Structs whose stored properties all conform to `AdditiveArithmetic` can derive
`AdditiveArithmetic`:
- `static var zero: Self`
- `static func +(lhs: Self, rhs: Self) -> Self`
- `static func -(lhs: Self, rhs: Self) -> Self`
- An "effective memberwise initializer":
  - Either a synthesized memberwise initializer or a user-defined initializer
    with the same type.

Effective memberwise initializers are used only by derived conformances for
`Self`-returning protocol requirements like `AdditiveArithmetic.+`, which
require memberwise initialization.

Resolves TF-844.
Unblocks TF-845: upstream `Differentiable` derived conformances.
2020-03-25 10:31:50 -07:00
swift_jenkins
c1c195e331 Merge remote-tracking branch 'origin/master' into master-next 2020-03-19 12:18:15 -07:00
Joe Groff
b4abd44e03 Merge pull request #30479 from jckarter/disable-mangled-name-metadata
IRGen: Add a flag to disable mangled name type metadata accessors.
2020-03-19 12:01:38 -07:00
Joe Groff
72b13e8c65 IRGen: Add a flag to disable mangled name type metadata accessors.
Useful as a workaround for runtime demangler bugs, or in rare cases where there are
performance problems with the demangler.
2020-03-18 13:55:01 -07:00
Michael Forster
345a9147ec Explicit SmallString->std::string conversion.
This is only needed temporarily until commit d7049213 from upstream
LLVM hits the swift/master branch.
2020-03-13 19:16:49 +01:00
Fred Riss
259d78a350 Adapt to llvm.org StringRef API change 2020-03-13 19:08:22 +01:00
Ben Langmuir
b3d321bb1f Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	lib/Frontend/CompilerInvocation.cpp
2020-03-13 10:33:17 -07:00
AG
710799dd09 Merge pull request #30393 from bitjammer/acgarland/rdar-59262057-ssge-maccatalyst
[SymbolGraph] Add macCatalyst compatibility
2020-03-13 09:35:39 -07:00
Ashley Garland
8f96f67581 [SymbolGraph] Add macCatalyst compatibility
- Add `setDefaultPrebuiltCacheIfNecessary` a `CompilerInvocation` method
- Call that while setting up the invocation in `swift-symbolgraph-extract`
- Add `Fsystem` argument to add iOSSupport directory to the search paths
- Add `resource-dir` argument for local builds

rdar://59262057
2020-03-12 10:51:11 -07:00
swift_jenkins
21cafe5070 Merge remote-tracking branch 'origin/master' into master-next 2020-03-12 09:01:05 -07:00
Joe Groff
d06b839c03 Add -verify-all-substitution-maps frontend flag 2020-03-11 16:19:30 -07:00
swift_jenkins
bd6dad611d Merge remote-tracking branch 'origin/master' into master-next 2020-03-03 09:45:13 -08:00
Visoiu Mistrih Francis
aaab1869af Merge pull request #29650 from francisvm/sil-remark-streamer
[Remarks] Add a specialized RemarkStreamer for SIL remarks
2020-03-03 09:30:17 -08:00
swift_jenkins
b930c0ad1f Merge remote-tracking branch 'origin/master' into master-next 2020-03-03 09:00:32 -08:00
Owen Voorhees
69b513afaf [Diagnostics] Updated (experimental) diagnostic printing style (#30027)
* [Diagnostics] Experimental diagnostic printing updates

This new style directly annotates small snippets of code with
error messages, highlights and fix-its. It also uses color more
effectively to highlight important segments.

* [Diagnostics] Stage educational notes and experimental formatting behind separate frontend flags

educational notes -> -enable-educational-notes
formatting -> -enable-experimental-diagnostic-formatting

* [Diagnostics] Refactor expensive line lookups in diag formatting

* [Diagnostics] Refactor some PrintingDiagnosticConsumer code into a flush method

* [Diag-Experimental-Formatting] Custom formatting for Xcode editor placeholders

* [Diag-Experimental-Formatting] Better and more consistent textual description of fix its

* [Diags-Experimental-Formatting] Handle lines with tab characters correctly when rendering highlights and messages

Tabs are converted to 2 spaces for display purposes.

* [Diag-Experimental-Formatting] Refactor byte-to-column mapping for efficiency

* [Diag-Experimental-Formatting] Fix line number indent calculation

* [Diag-Experimental-Formatting] Include indicators of insertions and deletions in the highlight line

Inserts are underlined by green '+' chars, deletions by red '-' chars.

* [Diag-Experimental-Formatting] Change color of indicator arrow for non-ASCII anchored messages
* [Diag-experimental-formatting] Make tests less sensitive to line numbering

* [Diag-Experimental-Formatting] Update tests to allow windows path separators

* [Diag-Experimental-Formatting] Bug fixes for the integrated REPL
2020-03-03 08:48:32 -08:00
Francis Visoiu Mistrih
e724ebab6b [Remarks] Add a specialized RemarkStreamer for SIL remarks
This allows the usage of the whole remark infrastructure developed in
LLVM, which includes a new binary format, metadata in object files, etc.

This gets rid of the YAMLTraits-based remark serialization and does the
plumbing for hooking to LLVM's main remark streamer.

For more about the idea behind LLVM's main remark streamer, see the
docs/Remarks.rst changes in https://reviews.llvm.org/D73676.

The flags are now:

* -save-optimization-record: enable remarks, defaults to YAML
* -save-optimization-record=<format>: enable remarks, use <format> for
serialization
* -save-optimization-record-passes <regex>: only serialize passes that
match <regex>.

The YAMLTraits in swift had a different `flow` setting for the debug
location, resulting in some test changes.
2020-03-02 18:33:20 -08:00