Commit Graph

82 Commits

Author SHA1 Message Date
swift-ci
c99da10924 Merge remote-tracking branch 'origin/master' into master-next 2019-02-13 14:29:12 -08:00
Adrian Prantl
03b6938a66 Rename clang::vfs to llvm::vfs 2019-02-13 11:09:15 -08:00
Nathan Hawes
e146630b63 [ParseableInterface] Fix failing to build a module when the importing file has errors.
We were checking the parent invocation's DiagnosticEnginer rather than the
subinstance's to determine if there were any errors building the module, which
meant we would fail to load the module if there were errors prior to the import
statement in the importing file.

This also meant code completion would fail to load the module, because it always
emits a bogus error in order to mark the AST as erroneous so that different
parts of the compiler (e.g. the verifier) have less strict assumptions.

rdar://problem/43906499
2019-02-12 12:32:32 -08:00
swift-ci
e979e89859 Merge remote-tracking branch 'origin/master' into master-next 2019-02-11 21:09:42 -08:00
Brent Royal-Gordon
031166e25b Revert "[ParseableInterface] Fix failing to build a module when the importing file has errors." 2019-02-11 15:59:42 -08:00
swift-ci
d9133b7f32 Merge remote-tracking branch 'origin/master' into master-next 2019-02-11 10:29:21 -08:00
Nathan Hawes
2a746da9bc [ParseableInterface] Fix failing to build a module when the importing file has errors.
We were checking the parent invocation's DiagnosticEnginer rather than the
subinstance's to determine if there were any errors building the module, which
meant we would fail to load the module if there were errors prior to the import
statement in the importing file.

This also meant code completion would fail to load the module, because it always
emits a bogus error in order to mark the AST as erroneous so that different
parts of the compiler (e.g. the verifier) have less strict assumptions.

rdar://problem/43906499
2019-02-08 09:08:27 -08:00
swift-ci
82452b05d6 Merge remote-tracking branch 'origin/master' into master-next 2019-02-05 17:11:03 -08:00
Harlan Haskins
4eafcc9a6f [ParseableInterface] Use arch for cache key instead of full triple
The target triple actually includes too much information -- just use the
target architecture.

rdar://46503065
2019-02-05 15:44:39 -08:00
swift-ci
34d9c2e178 Merge remote-tracking branch 'origin/master' into master-next 2019-02-04 18:50:36 -08:00
Harlan Haskins
6ae20a959b [ParseableInterface] Refine cache key for cached swiftmodules
Previously, we included the PCH hash components in the cache key. While they didn’t do any harm, they didn’t contribute any unique information about the module in question.

Additionally, passing the effective language version in means that each dependency that uses a different -swift-version would re-compile all of its dependencies. This is unfortunate, as that means the standard library is recompiled potentially several times.
2019-02-04 14:39:46 -08:00
Harlan Haskins
6f94720b01 [Serialization] Use mtime instead of hash for file dependencies
Hashing the contents of the interface files is overkill. In practice, size and last modification time are enough to determine if a file has changed on disk, and therefore should be rebuilt.
2019-02-04 13:26:38 -08:00
swift-ci
f7846703aa Merge remote-tracking branch 'origin/master' into master-next 2019-01-10 12:29:57 -08:00
Slava Pestov
81c5a67489 Merge pull request #21758 from pschuh/s-1
Rename NameAliasType to TypeAliasType.
2019-01-10 15:20:41 -05:00
Parker Schuh
f5859ff46e Rename NameAliasType to TypeAliasType. 2019-01-09 16:47:13 -08:00
Jordan Rose
1b7160d52b Merge remote-tracking branch 'origin/master' into master-next 2019-01-09 15:26:26 -08:00
Jordan Rose
c88c8b5f90 [ParseableInterface] Don't serialize deps for explicit builds
If the frontend is invoked with
-build-module-from-parseable-interface, we might be trying to persist
and distribute the swiftmodule that gets built. In that case, any
dependencies we list might not be relevant.

This probably isn't really the final answer here; what we want is some
way to say /which/ dependencies are relevant, and how they're related
to how the swiftmodule that gets used. Most likely the right answer
here is to limit this to dependencies within the SDK or something.
2018-12-21 15:41:23 -08:00
Jordan Rose
614deb640b [ParseableInterface] Pass prebuilt cache path down to sub-invocations
Otherwise, the top-level compilation gets the benefit of the prebuilt
cache path, but the sub-invocations for swiftinterfaces that /do/
need to be compiled do not.
2018-12-21 15:41:17 -08:00
Jordan Rose
7562137fab [ParseableInterfaces] Move call to helper to the one place it's needed
This is a little trickier than it sounds because we have 'friend'
access into the FrontendInputsAndOutputs structure, which means all
the helpers need to be declared in the header file. But it makes the
two use sites simpler, and does slightly less work in the cache hit
path.
2018-12-21 15:41:10 -08:00
Jordan Rose
5417ca0aa2 [ParseableInterfaces] Handle swiftdoc files correctly
The previous 'openModuleFiles' interface in SerializedModuleLoaderBase
still assumed that swiftmodule files and swiftdoc files would be found
next to each other, but that's not true anymore with
swiftinterfaces-built-to-modules. Give up on this assumption (and on
the minor optimization of passing down a scratch buffer) and split out
the interface into the customization point
'findModuleFilesInDirectory' and the implementation 'openModuleFiles'.
The latter now takes two full paths: one for the swiftmodule, one for
the swiftdoc.
2018-12-21 15:37:32 -08:00
Jordan Rose
1c3d467fe9 [ParseableInterfaces] Use namespace path = llvm::sys::path
Makes this code easier to read. No functionality change.
2018-12-17 18:23:28 -08:00
Jordan Rose
4bfe4eff6d [ParseableInterfaces] Add -prebuilt-module-cache-path to the frontend
When trying to load a swiftinterface, search this directory before
doing all the work of building a swiftmodule.
2018-12-17 18:23:28 -08:00
swift-ci
69e29013f5 Merge remote-tracking branch 'origin/master' into master-next 2018-12-17 13:29:42 -08:00
Jordan Rose
73de196fb5 [ParseableInterface] Accept no space after "swift-module-flags:" (#21334)
I lost about a minute or so to this with a manually-written
swiftinterface, so may as well avoid that problem in the future.
2018-12-17 13:20:24 -08:00
Bob Wilson
22001a2bcb Merge remote-tracking branch 'origin/master' into master-next 2018-12-13 15:00:21 -08:00
Jordan Rose
37708ede6e Add frontend mode -build-module-from-parseable-interface
Makes it easier to test the caching behavior, and may also be useful
for "prebuilding" swiftinterfaces in the future, or having the Driver
kick off a bunch of separate builds as proper tasks.
2018-12-13 11:18:05 -08:00
Jordan Rose
13c8a75da5 [ParseableInterface] Split up creation of the sub-CompilerInvocation
The goal here is to separate the parts that compute an output file
name from the parts that do the actual compilation, so that we can
test the swiftinterface -> swiftmodule behavior more directly. No
functionality change in this commit; the next will take advantage
of the refactoring.
2018-12-12 19:49:02 -08:00
swift-ci
e366cfcaf1 Merge remote-tracking branch 'origin/master' into master-next 2018-12-12 07:30:05 -08:00
Slava Pestov
e28b0ec7f3 Frontend: Remove a usage of DeclContext::getGenericParamsOfContext() 2018-12-11 23:55:41 -05:00
Bob Wilson
5979fb382f Merge remote-tracking branch 'origin/master' into master-next 2018-12-07 10:58:43 -08:00
Jordan Rose
813316190b [ParseableInterface] Don't require Foundation to use @objc
Deinitializers are always @objc. (Arguably, this makes it unnecessary
to print, but we don't want to do any @objc inference at all in a
swiftinterface.)
2018-12-06 14:57:18 -08:00
Jordan Rose
a51f1dd3d2 [ParseableInterface] Pass down the module name and import source loc
- Use the name for the cached module, so that we don't end up with a
  zillion "x86_64-XXXXXXXX.swiftmodule" files in the cache when we're
  working with architecture-specific swiftmodules.

- Diagnose if the expected name is different from the name specified
  in the swiftinterface.

- Emit all diagnostics at the location of the import, instead of
  without any location at all.
2018-12-06 13:33:07 -08:00
swift-ci
372aded41b Merge remote-tracking branch 'origin/master' into master-next 2018-12-03 18:30:37 -08:00
Harlan Haskins
3716858d81 Merge pull request #20936 from harlanhaskins/optimus-prime
[ParseableInterface] Optimize parseable modules
2018-12-03 18:30:07 -08:00
Jordan Rose
f8852c97de [ParseableInterface] Don't serialize all SIL like a SIB file (#20976)
This would break resilience, which makes a distinction between "SIL
only inside the module, which is inside the resilience domain" and
"SIL we're going to serialize, which is outside the resilience
domain".
2018-12-03 18:29:48 -08:00
Harlan Haskins
95a17b5afe [ParseableInterface] Optimize parseable modules
This turns on optimization for speed for modules compiled from interfaces during module loading.
2018-12-03 13:17:35 -08:00
swift-ci
2096fd21eb Merge remote-tracking branch 'origin/master' into master-next 2018-11-30 18:19:15 -08:00
Jordan Rose
1c91dd4933 [ParseableInterface] Include "import Swift" in swiftinterface files (#20935)
Otherwise we've got a problem with modules that use -parse-stdlib but
aren't the stdlib themselves. Ideally we'd /only/ print this in that
case, but we don't have that information at this point in the pipeline
and I'm not sure it would be a good idea to include it in the set of
options we pass through.
2018-11-30 18:07:14 -08:00
Bob Wilson
65b53c0c52 master-next: Fix up recent Swift changes to work with newer VFS code.
The main different here is that VFS moved from clang to llvm.
2018-11-30 14:26:30 -08:00
swift-ci
4e9e3a1a3e Merge remote-tracking branch 'origin/master' into master-next 2018-11-29 16:30:04 -08:00
Jordan Rose
7d30f9cb1f [ParseableInterface] Fixes and tests for Graydon's fallback work 2018-11-29 11:02:24 -08:00
Graydon Hoare
f7200e87bd [ModuleInterface] <rdar://46081260> Fallback behaviour and testing env vars. 2018-11-28 18:34:41 -08:00
Jordan Rose
0ccfe34513 [ParseableInterface] mkdir -p the module cache before using it
Clang does the same thing for its module cache.
2018-11-28 18:34:41 -08:00
swift-ci
5528db1462 Merge remote-tracking branch 'origin/master' into master-next 2018-11-27 23:30:31 -08:00
Harlan Haskins
3e15224d0b [ParseableInterface] Serialize module-link-name in binary module
We weren’t serializing the module-link-name before, which was causing link errors when trying to import one of these interfaces from the cache.
2018-11-27 15:17:22 -08:00
swift-ci
8f70d56a32 Merge remote-tracking branch 'origin/master' into master-next 2018-11-26 17:50:04 -08:00
Jordan Rose
9f6de1fb8e [ParseableInterface] Don't print conformances from other modules (#20657)
...even if they're depended on by protocols we conform to.
2018-11-26 17:38:24 -08:00
swift-ci
5ffb33378a Merge remote-tracking branch 'origin/master' into master-next 2018-11-26 11:32:00 -08:00
Jordan Rose
f56af4e0af [ParseableInterface] Don't print conformances for non-public types (#20656)
I have nothing to say but "oops".
2018-11-26 11:29:36 -08:00
Bob Wilson
e50d66afb9 Merge remote-tracking branch 'origin/master' into master-next 2018-11-14 11:03:56 -08:00