Commit Graph

430 Commits

Author SHA1 Message Date
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
c6d56ba570 Merge remote-tracking branch 'origin/master' into master-next 2020-04-30 15:57:39 -07:00
Hamish Knight
b6150b06b3 [Serialization] Remove duplicated IsSIB bit
Store the bit on the ModuleFile, and query it
from the SerializedASTFile.
2020-04-30 14:17:29 -07:00
swift_jenkins
ed20b9c058 Merge remote-tracking branch 'origin/master' into master-next 2020-04-24 23:58:13 -07:00
Doug Gregor
172c0472f6 Merge pull request #28515 from DougGregor/fast-dependency-scanning
Fast dependency scanning for Swift
2020-04-24 23:54:06 -07:00
swift_jenkins
df6fe6509c Merge remote-tracking branch 'origin/master' into master-next 2020-04-24 21:20:17 -07:00
Brent Royal-Gordon
e7bd60494a Revert "[ModuleLoader] Emit a better diagnostic for swiftinterfaces with wrong arch."
This reverts commit 412ee0a922.
2020-04-24 13:45:05 -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
dae7b2425d Merge remote-tracking branch 'origin/master' into master-next 2020-04-23 19:39:25 -07:00
Nathan Hawes
083e95ca9d Merge pull request #31227 from nathawes/cross-import-tooling-fixes
[IDE][AST] Handle frameworks with traditional overlays where the underlying module declares cross imports in sourcekit
2020-04-23 19:28:28 -07:00
Nathan Hawes
b7ac8f87b1 [IDE][AST] Handle frameworks with traditional overlays where the underlying module declares cross imports in sourcekit.
We weren't handling this case, so their generated interfaces / doc info
wouldn't include symbols from the cross-import overlays, and we wouldn't
map the underscored cross-import overlay name back to the declaring
framework's name in cusor-info, completion results or when indexing.

Resolves rdar://problem/62138551
2020-04-23 13:03:59 -07:00
swift_jenkins
01ac52612f Merge remote-tracking branch 'origin/master' into master-next 2020-04-23 07:59:46 -07:00
Varun Gandhi
9c1615c761 Merge pull request #31196 from varungandhi-apple/vg-remove-arm64e-fallback
Remove fallback for arm64e -> arm64.
2020-04-23 07:57:55 -07:00
Varun Gandhi
412ee0a922 [ModuleLoader] Emit a better diagnostic for swiftinterfaces with wrong arch.
Before this change, we would emit the warning only for swiftmodules; however,
it may be the case that only a swiftinterface (of a different arch) is present
but no swiftmodule is present.

Fixes rdar://problem/50905075.
2020-04-22 23:58:54 -07:00
Varun Gandhi
c4134ca452 [ModuleInterface] Remove fallback behavior for arm64e -> arm64.
Addresses rdar://problem/61407215.
2020-04-22 23:58:33 -07:00
swift_jenkins
e44d529e6b Merge remote-tracking branch 'origin/master' into master-next 2020-04-20 08:37:18 -07:00
Max Desiatov
5a2b42d054 [NFC] Fix typo in SerializedModuleLoader.cpp 2020-04-20 14:27:02 +01:00
swift_jenkins
340839a81d Merge remote-tracking branch 'origin/master' into master-next 2020-03-27 12:19:29 -07:00
Hamish Knight
6f212634c8 Add getOperatorDecls to FileUnit and ModuleDecl
Query the SourceLookupCache for the operator decls,
and use ModuleDecl::getOperatorDecls for both
frontend stats and to clean up some code
completion logic.

In addition, this commit switches getPrecedenceGroups
over to querying SourceLookupCache.
2020-03-27 09:44:55 -07:00
swift_jenkins
e4ce785e76 Merge remote-tracking branch 'origin/master' into master-next 2020-03-27 06:42:06 -07:00
Dan Zheng
28315487dc [AutoDiff upstream] Serialize derivative function configurations. (#30672)
Serialize derivative function configurations per module.

`@differentiable` and `@derivative` attributes register derivatives for
`AbstractFunctionDecl`s for a particular "derivative function configuration":
parameter indices and dervative generic signature.

To find `@derivative` functions registered in other Swift modules, derivative
function configurations must be serialized per module. When configurations for
a `AbstractFunctionDecl` are requested, all configurations from imported
modules are deserialized. This module serialization technique has precedent: it
is used for protocol conformances (e.g. extension declarations for a nominal
type) and Obj-C members for a class type.

Add `AbstractFunctionDecl::getDerivativeFunctionConfigurations` entry point
for accessing derivative function configurations.

In the differentiation transform: use
`AbstractFunctionDecl::getDerivativeFunctionConfigurations` to implement
`findMinimalDerivativeConfiguration` for canonical derivative function
configuration lookup, replacing `getMinimalASTDifferentiableAttr`.

Resolves TF-1100.
2020-03-27 06:40:27 -07:00
swift_jenkins
4ccdfa27aa Merge remote-tracking branch 'origin/master' into master-next 2020-03-23 12:20:10 -07:00
Hamish Knight
cc9c851856 Add direct operator lookup requests
Introduce DirectOperatorLookupRequest &
DirectPrecedenceGroupLookupRequest that lookup
operator and precedence groups within a given
file or module without looking through imports.

These will eventually be used as the basis for the
new operator lookup implementation, but for now
just use them when querying lookup results from
serialized module files.
2020-03-23 09:17:58 -07:00
Hamish Knight
a502246f34 [AST] Add OperatorFixity
Use this instead of DeclKind in a few places.
2020-03-23 09:17:58 -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
Adrian Prantl
41f76322d2 Adapt to upstream header file reshuffling 2020-03-12 10:23:47 -07:00
Shoaib Meenai
8b8650770e Include Host.h for getProcessTriple
https://github.com/llvm/llvm-project/commit/213aea4c5836 means this
header doesn't get implicitly transitively included anymore, so we have
to include it explicitly.
2020-03-11 23:36:59 -07:00
Rintaro Ishizaki
a7cb72fe55 Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	stdlib/public/Reflection/TypeRefBuilder.cpp
2020-03-10 12:46:49 -07:00
Kuba Mracek
84c4864911 [arm64e] Add Swift compiler support for arm64e pointer authentication 2020-02-27 16:10:31 -08:00
swift_jenkins
f96c54317d Merge remote-tracking branch 'origin/master' into master-next 2020-02-21 13:59:21 -08:00
Alexis Laferrière
880b8663b9 [Serialization] Fix crash in reporting missing implementationOnly modules
The diagnostic function crashed as it did not take into account the
DebuggerSupport options as the site reporting the missing dependency did.
In this context, missing implementation-only imported dependencies are
ignored only if DebuggerSupport is set.
2020-02-21 10:25:18 -08:00
swift_jenkins
5806fd0f63 Merge remote-tracking branch 'origin/master' into master-next 2020-02-19 16:19:27 -08:00
Alexis Laferrière
0e7029dfb5 Use "SPI group" for the name used in an @_spi attribute 2020-02-19 14:18:11 -08:00
Alexis Laferrière
501f458879 [AST] Intro service lookupImportedSPIs to find direct SPI imports of a module 2020-02-19 14:17:14 -08:00
swift_jenkins
a2e41771fc Merge remote-tracking branch 'origin/master' into master-next 2020-02-19 09:19:25 -08:00
Brent Royal-Gordon
e248f82773 Add support for loading cross-import files 2020-02-18 11:06:12 -08:00
swift_jenkins
9fb3b6ac0e Merge remote-tracking branch 'origin/master' into master-next 2020-02-12 08:37:17 -08:00
Robert Widmann
86ea1912c4 Merge remote-tracking branch 'upstream/master' into HEAD 2020-02-11 23:03:59 -08:00
Ashley Garland
7190073a85 Serialize symbol graphs for extended modules separately
When a module extends a type from another module, serialize those symbols into
separated files dedicated to those extended modules. This makes it easier to
ingest and categorize those symbols under the extended module if desired.

rdar://58941718
2020-02-11 13:23:16 -08:00
Fred Riss
a3afd8b155 Adapt to llvm.org StringRef API change 2020-01-31 15:36:19 -08:00
Brent Royal-Gordon
e4c1de675a [NFC-ish] Simplify module loader filename handling (#29295)
* Remove dead ModuleSourceInfoFilename parameters

These were never actually used; we might find a way to bring them back later.

* Introduce SerializedModuleBaseName

This is intended to replace the _n_ filename parameters that tend to get passed around in the SerializedModuleLoader classes.

* Manipulate currPath in SerializedModuleLoader less often

* Don’t pass raw paths around SerializedModuleLoader

Only pass base names.

* Regularize module file opening functions
2020-01-21 13:02:20 -08:00
Kita, Maksim
ea6a2dc094 SR-11889: Fixed code review issues
1. Updated Located field names with Pascal Case
2. Updated Located constuctor
3. Formatted lines with more than 80 symbols
2019-12-20 17:18:59 +03:00
Kita, Maksim
b7cb3b67bf SR-11889: Using Located<T> instead of std::pair<SourceLoc, T> 2019-12-20 17:18:58 +03:00
Alexis Laferrière
c2c36d0769 [Serialization] Fix reporting a dependency cycle with a missing clang module
rdar://problem/57364033
2019-12-16 17:06:59 -08:00
Alexis Laferrière
e9abba2eab [Serialization] Filter Decl to deserialize by their attributes
Add an alternative to getTopLevelDecls and getDeclChecked to limit which
decls are deserialized by first looking at their attributes. If the
attributes are accepted by a function passed as argument the decl is
fully deserialized, otherwise it is ignored.

The filter is included in the signature of existing functions in the
Serilalization services, but I’ve added new methods for it in FileUnit
and its subclasses to leave existing implementations untouched.
2019-11-21 10:06:37 -08:00
Xi Ge
0abcc1db40 SerializeLoc: address Jordan's previous code review comments 2019-10-22 18:35:55 -07:00
Varun Gandhi
68a68cb564 Merge pull request #27635 from varungandhi-apple/vg-robustify-module-trace-emission
Make module trace emission more robust.
2019-10-15 20:45:04 -07:00
Varun Gandhi
903add2c3f [Frontend] Make the module trace emission more robust.
✔ More informative error messages in case of crashes.
✔ Handling and documenting different cases.
✔ Test cases for different cases.
✔ Make SDKDependencies.swift pass again.
2019-10-15 15:44:26 -07:00