Commit Graph

43 Commits

Author SHA1 Message Date
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
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
Slava Pestov
e28b0ec7f3 Frontend: Remove a usage of DeclContext::getGenericParamsOfContext() 2018-12-11 23:55:41 -05: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
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
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
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
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
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
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
Graydon Hoare
657543119c [ModuleInterface] Version string (semi)finalization, format version checking. 2018-11-13 13:25:15 -08:00
Graydon Hoare
c6ac3867cd [ModuleInterface] Address review comments. 2018-11-13 13:25:15 -08:00
Graydon Hoare
8959923ac8 [ModuleInterface] Propagate dependencies to outer DependencyTracker for use in .d files. 2018-11-13 13:25:15 -08:00
Graydon Hoare
d44943a482 [ModuleInterface] Include and dedupe (transitive) FILE_DEPENDENCY records from dependencies. 2018-11-13 13:25:15 -08:00
Graydon Hoare
b07425ac1d [ModuleInterface] Switch from mtime to xxhash in FILE_DEPENDENCY records. 2018-11-13 13:25:15 -08:00
Graydon Hoare
8b0b5ad475 [ModuleInterface] Suppress warnings in sub-invocation. 2018-11-13 13:24:23 -08:00
Graydon Hoare
be7fcfdc2d [ModuleInterface] Emit error when we fail to find a dependency. 2018-11-13 13:24:23 -08:00
Graydon Hoare
3aab6fd5f3 [ModuleInterface] Use ForwardingDiagnosticConsumer in sub-instance. 2018-11-13 13:24:23 -08:00
Jordan Rose
ff7d03fbd1 [ParseableInterfaces] Handle unsatisfiable conditional conformances (#20433)
...by printing them with a dummy, unsatisfiable condition. This
happens when a public type conforms to a public protocol with
non-public conditions; the conformance can't be used in inlinable
code, but neither is it okay for a client to declare their own
conformance (constrained or unconstrained).

rdar://problem/45657450
2018-11-09 08:28:49 -08:00
Jordan Rose
4d041a360a [ParseableInterface] Print protocols inherited through private protos (#20169)
In this code:

    private protocol MyProto: Hashable {}
    public struct MyStruct: MyProto {}

Being Hashable is part of MyStruct's public API, even though it's not
written explicitly. If we're not going to require people to write it
explicitly, we need to make sure it gets printed.

rdar://problem/44662501
2018-11-08 10:33:42 -08:00
Graydon Hoare
0a3bd3eae9 [ModuleInterface] Address more review comments. 2018-11-01 21:17:09 -07:00
Graydon Hoare
fc4510e2b8 [ModuleInterface] Make up-to-date check recursive, since it runs first. 2018-11-01 10:51:44 -07:00
Graydon Hoare
9b258192de [ModuleInterface] Add more debug logging. 2018-11-01 10:51:44 -07:00
Graydon Hoare
6cb7b46f39 [ModuleInterface] Set EnableParseableModuleInterface in sub-instance. 2018-11-01 10:51:44 -07:00
Graydon Hoare
8d6f6e2d2f [ModuleInterface] Pass clang module cache path to sub-instance. 2018-11-01 10:51:44 -07:00
Graydon Hoare
11f3c9470d [ModuleInterface] Add PrintingDiagnosticConsumer to sub-instance. 2018-11-01 10:51:44 -07:00
Graydon Hoare
1a4ba3851b [ModuleInterface] Factor out clang module cache path extraction function. 2018-11-01 10:51:44 -07:00
Graydon Hoare
fd226ae761 [ModuleInterface] Address review comments. 2018-11-01 10:51:44 -07:00
Graydon Hoare
4938b002b4 [ModuleInterface] Remove SwiftParseableInterfaceDeps files, use INPUT_BLOCK. 2018-11-01 10:51:16 -07:00
Graydon Hoare
b4a96bb182 [ModuleInterface] Write, read-back and test deps stored in .sid files. 2018-10-19 12:12:53 -07:00
Graydon Hoare
1f85e80f3f [ModuleInterface] Tighten up cache key for generated .swiftmodule. 2018-10-18 00:31:23 -07:00
Graydon Hoare
63e1e166db [ModuleInterface] Specify module as supplementary rather than main output. 2018-10-11 23:56:21 -07:00
Graydon Hoare
2be23089a6 [ModuleInterface] Actually generate SIL for the module. 2018-10-11 23:56:20 -07:00
Graydon Hoare
4f315363f8 [ModuleInterface] Change TY_SwiftModuleInterfaceFile to TY_SwiftParseableInterfaceFile 2018-10-11 23:56:19 -07:00
Graydon Hoare
5e202697a3 [ModuleInterface] Mop up remaining "textual interface" terminology. 2018-10-11 23:56:19 -07:00
Graydon Hoare
6ea9accbed [ModuleInterface] Add TextualInterfaceModuleLoader sketch. 2018-10-11 23:56:18 -07:00
Graydon Hoare
45e6b25da4 [ModuleInterface] Rename TextualInterfaceGeneration.{cpp,h} to TextualInterfaceSupport.{cpp,h} 2018-10-11 16:43:51 -07:00