Commit Graph

21 Commits

Author SHA1 Message Date
Harlan Haskins
366bbf48b9 [ParseableInterface] Add ‘forwarding modules’
A ‘forwarding module’ is a YAML file that’s meant to stand in for a .swiftmodule file and provide an up-to-date description of its dependencies, always using modification times.

When a ‘prebuilt module’ is first loaded, we verify that it’s up-to-date by hashing all of its dependencies. Since this is orders of magnitude slower than reading mtimes, we’ll install a `forwarding module` containing the mtimes of the now-validated dependencies.
2019-03-07 11:36:15 -08:00
Bob Wilson
06120c9d9d More fixes in recent Swift changes to work with newer VFS code. 2019-02-08 16:01:41 -08:00
Harlan Haskins
17821b6fd7 [ParseableInterface] Remove some accidentally-committed code 2019-02-06 16:24:33 -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
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
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
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
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
Graydon Hoare
f7200e87bd [ModuleInterface] <rdar://46081260> Fallback behaviour and testing env vars. 2018-11-28 18:34:41 -08:00
Graydon Hoare
657543119c [ModuleInterface] Version string (semi)finalization, format version checking. 2018-11-13 13:25:15 -08:00
Graydon Hoare
1a4ba3851b [ModuleInterface] Factor out clang module cache path extraction function. 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
b71c55ab8b [ModuleInterface] Address misc review comments. 2018-10-11 23:56:20 -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