Commit Graph

187 Commits

Author SHA1 Message Date
David Ungar
663760e3b7 ASTOOScope ontology 2019-05-28 10:48:22 -07:00
Mishal Shah
8daa0348ed Fix type in Inputs path 2019-05-23 00:20:24 -07:00
Mishal Shah
4bb3fc9daa [Tests] Update the ParseableInterface tests to use make-old.py due to nondeterministic timestamp issue with touch 2019-05-22 15:38:49 -07:00
Mishal Shah
b21774b8bb [Tests] Update the ParseableInterface tests to use make-old.py due to nondeterministic timestamp issue with touch 2019-05-21 17:36:58 -07:00
Jordan Rose
9647483aee Warn when using '@_implementationOnly' inconsistently in a module (#24800)
I thought it would be useful to allow some uses of a module to be
'@_implementationOnly' and others to not be in case someone wanted to
change from one to the other gradually, but it turns out that if
you're trying to /make/ an import implementation-only, you want to
know everywhere you used it.

rdar://problem/50748157
2019-05-16 09:13:34 -07:00
Joe Groff
0be95f56bd Merge pull request #24798 from jckarter/opaque-type-check-availability
Opaque types require a newer Swift runtime.
2019-05-15 18:05:40 -07:00
Joe Groff
cec9e9e33a Opaque types require a newer Swift runtime.
Check the availability of decls that declare an opaque return type to ensure they deploy to a
runtime that supports opaque types.

rdar://problem/50731151
2019-05-15 11:39:53 -07:00
Jordan Rose
def1ccac66 Don't print extensions to conform to protocols that aren't printed
Try a little harder to avoid printing empty extensions by seeing if
any of the inherited protocols are actually going to be printed.
Previously this just made things a little prettier, but with
implementation-only imports it's a correctness issue, since there may
be extensions of implementation-only types that do in fact conform to
non-public protocols.

rdar://problem/50748072
2019-05-14 16:16:28 -07:00
Saleem Abdulrasool
9cb2e6e3ff Merge pull request #24755 from compnerd/unparseable
test: make test paths more portable
2019-05-14 07:48:14 -07:00
Jordan Rose
e43a9f5475 [ModuleInterface] Propagate availability for synthesized extensions (#24753)
Otherwise, we can synthesize an extension that's extending a type
that's unavailable on a particular platform, or that conforms to a
protocol that hasn't been introduced on the minimum deployment target.
2019-05-13 19:55:00 -07:00
Saleem Abdulrasool
8277f8bd31 test: make test paths more portable
Windows uses `\` as the separator rather than `/`.  Adjust the tests for
this.
2019-05-13 18:07:28 -07:00
Harlan Haskins
5cb98bfe80 [ModuleInterface] Pass -Rmodule-interface-rebuild to sub-invocation (#24737)
Previously, we wouldn't pass this flag to sub-invocations, which means
that if we had to fall back and recompile a transitive import, we
wouldn't get a remark.

rdar://50729662
2019-05-13 12:56:18 -07:00
Nathan Hawes
e0b2920b67 [test] Fix check line in test/ParseableInterface/enums-layout.swift
The call isn't a tail call in all configurations.

Resolves rdar://problem/50543373
2019-05-07 10:17:48 -07:00
Saleem Abdulrasool
c8b3c8e01f tests: Win32 ParseableInterface.ModuleCache.SystemDependencies
Fix the path separator.  On Windows, there is an extra search path which
makes the strict next check fail.
2019-05-06 20:33:22 -07:00
Daniel Rodríguez Troitiño
13f85af8cd Merge pull request #24524 from drodriguez/executable-stored-properties-client
[test] Mark stored-properties-client as executable.
2019-05-06 13:41:27 -07:00
Saleem Abdulrasool
0bc0979def Merge pull request #24515 from compnerd/bits-byte-back
test: make portable to LLP64 targets (harder)
2019-05-06 12:03:45 -07:00
Daniel Rodríguez Troitiño
4b79fce660 [test] Mark stored-properties-client as executable.
Test was enabled in #21426, but it was not marked as executable, and the Android CI has been trying to run it in the builder, and failing.
2019-05-06 11:33:33 -07:00
Jordan Rose
6720a7cb74 Merge branch 'master' into artiodactyla 2019-05-06 09:32:56 -07:00
Saleem Abdulrasool
a6ff2538a7 test: make portable to LLP64 targets (harder)
`Int` is not usable for LLP64 targets, use an explicit `Int32` when
bridging an ObjC enumeration.
2019-05-06 08:32:34 -07:00
swift-ci
b16ee94d1a Merge pull request #24512 from DougGregor/property-delegates-serialization 2019-05-05 23:17:43 -07:00
Doug Gregor
eb3f28825c [Property delegates] Fix textual interfaces for properties with delegates
Don’t synthesize a missing setter for a property that has an attached
delegate and is in a .swiftinterface file.
2019-05-05 22:12:00 -07:00
Saleem Abdulrasool
7701b88307 test: make portable to LLP64 targets
`Int` is not usable for LLP64 targets, use an explicit `Int32` when
bridging an ObjC enumeration.
2019-05-05 10:53:00 -07:00
Jordan Rose
b3c5a68acf [Serialization] Reduce file size by splitting dep dirnames from basenames
Dependency tracking for cached compiled modules (compiled from
swiftinterfaces) can lead to a high percentage of the module being
SDK-relative paths when -track-system-dependencies is on. Cut down on
this by storing directory names in a separate record that gets
referenced from each file dependency. (Since a lot of per-file
dependencies are header files in a common directory, this is a win.)

We can do something more clever in the future, but this is a
reasonable start for, say, the overlays.

rdar://problem/50449802
2019-05-04 10:47:46 -07:00
Jordan Rose
9ba1d8a1c6 [ModuleInterface] Include the raw values of @objc enums (#24487)
...since they're part of the run-time representation. Not having this
meant that someone compiling against an interface would miscompile
uses of @objc enums defined in that interface!

rdar://problem/50410541
2019-05-04 10:14:46 -07:00
Nathan Hawes
09058cca19 Merge pull request #24479 from harlanhaskins/unremarkable
[test] Remove debug flag from module cache rebuild test
2019-05-03 11:16:03 -07:00
Jordan Rose
f76d2c3976 [ModuleInterface] Short-circuit module loading for frameworks too (#24459)
Follow-up to 7969705 that handles frameworks as well. Oops.

rdar://problem/50070463
2019-05-03 11:11:07 -07:00
Harlan Haskins
385b60b21c [test] Remove debug flag from module cache rebuild test
This debug flag shouldn't have been included in the test, and it doesn't
exist when built without asserts.

rdar://50447378
2019-05-03 10:39:13 -07:00
Harlan Haskins
f978cb0ba3 Merge pull request #24424 from harlanhaskins/an-absolutely-remarkable-thing
[ModuleInterface] Emit remarks when rebuilding from an interface
2019-05-02 22:45:15 -07:00
Harlan Haskins
f1b22b980b [test] Change stored-properties-client to an executable test (#21426)
This test was overfitting what it was trying to test, causing different
targets (and even different assert configurations) to fail to match.
Instead, make this an executable test and ensure that round-tripping
through setting and getting behaves as expected.

Fixes rdar://46486517
2019-05-02 19:02:41 -07:00
Harlan Haskins
dfe4491702 [ModuleInterface] Emit remarks when rebuilding from an interface
Keep track of information that led the module interface loader to reject loading a compiled module, if it needed to fall back to compiling an interface.

rdar://47792754
2019-05-02 17:46:34 -07:00
Jordan Rose
3eff026bbf [ModuleInterfaces] Warn emitting without -enable-library-evolution
Module interfaces don't yet carry enough information to correctly
describe the binary interface of a module compiled without
-enable-library-evolution, but we don't want to make this an error
because that would make it harder to work towards getting it in the
future.
2019-05-01 17:32:12 -07:00
Jordan Rose
73b7185a3d [ModuleInterfaces] Warn emitting an interface in -swift-version 4[.2]
If the project ever drops Swift 4 mode or Swift 4.2 mode, that would
break modules using those modes in their interface, so put an
unsilenceable warning in for using those modes to nudge interface
emitters to Swift 5.

rdar://problem/47792595
2019-05-01 17:32:12 -07:00
Jordan Rose
3d16557c7f [ModuleInterface] Look for a prebuilt module by full target name (#24402)
Although the default cache location separates by platform, a
/combined/ cache is still an interesting idea, and in that case we
need to use the full platform names.
2019-05-01 13:48:32 -07:00
Harlan Haskins
81a68f28ef [Frontend] Default the prebuilt cache to <resourcedir>/<platform>/prebuilt-modules (#24295)
By default, prebuilt modules will live in
<resource-dir>/<platform>/prebuilt-modules, so make this explicit if it wasn't
passed in explicitly.
2019-04-26 13:52:41 -07:00
Jordan Rose
9b2db03451 Module interfaces: preserve -autolink-force-load (#24262)
Otherwise the overlays won't be force-loaded when you import them.

(This feature could possibly be scoped back at this point, but it's
not something that should be changed just by using module interfaces!)
2019-04-24 21:39:09 -07:00
Nathan Hawes
1a2680a52f Merge pull request #24212 from nathawes/overriding-convenience-init-module-interface
[Deserialization] Don't add an OverrideAttr if the 'overridden' decl is a convenience init when deserializing
2019-04-24 13:58:16 -07:00
swift-ci
63d64fb2e0 Merge pull request #24225 from nathawes/iboutlet-private-set-in-module-interface 2019-04-24 12:39:31 -07:00
Harlan Haskins
5f823fbaff [ModuleInterface] Escape Type and Protocol when they're type members (#24111)
Previously, we wouldn't escape `Type` and `Protocol` at all in the
ASTPrinter, which lead to unfortunate build failures while compiling an
interface.

Instead, make sure we escape them whenever we print a name that's a type
member. Except for methods, which are erroneously allowed to be called
`Type` and `Protocol`.

rdar://49858651
2019-04-24 09:33:23 -07:00
Nathan Hawes
370713989f [ModuleInterface] Allow non-mutable IBOutlet instance properties in module interfaces
If an IBOutlet property is public private(set), it's interface only has a
getter. Consuming this interface was triggering a diagnostic that IBOutlet
properties must be mutable. This patch bypasses this check for module
interfaces.

Resolves rdar://problem/49856177
2019-04-23 16:26:07 -07:00
Nathan Hawes
2ae7315adf [Serialization] Don't add an OverrideAttr if the 'overridden' decl is a convenience init when deserializing 2019-04-22 18:08:03 -07:00
Nathan Hawes
4ee9fe6cd0 [ParseableInterface][test] Also pass the built dylib to %target-run in the inherited-defaults-execution.swift test
Resolves rdar://problem/50050902
2019-04-19 10:42:04 -07:00
Nathan Hawes
1060d1af1c Merge pull request #24073 from nathawes/inherit-default-values
[ParseableInterfaces] Support inheriting default arguments in module interfaces via '= super'
2019-04-18 22:21:35 -07:00
Nathan Hawes
32497c7f19 Check '= super' is actually parsed correctly in module interfaces via an execution test
Also pass the decls themselves rather than their locations when diagnosing
incorrect usage of '= super'.
2019-04-18 16:11:55 -07:00
Nathan Hawes
d4f1894347 Simplify diagnostics for inherited default argument values in module interfaces
Also:
- additionally require the containing and overridden initializers are
  designated, as that's the only case in which we should produce the '= super'
  syntax in module interfaces
- Add notes to point out the locations of the overriden initializer when it's
  not designated, and the corresponding parameter in that initializer when it
  doesn't have a default argument to inherit.
2019-04-18 11:03:34 -07:00
Joe Groff
dbd3a48afb Track var/subscript opaque return decls for type reconstruction. 2019-04-17 14:46:22 -07:00
Joe Groff
60aa49d69c merge fixup 2019-04-17 14:46:22 -07:00
Joe Groff
399332b75b Parsable interface and type reconstruction support for opaque types.
When printing a swiftinterface, represent opaque result types using an attribute that refers to
the mangled name of the defining decl for the opaque type. To turn this back into a reference
to the right decl's implicit OpaqueTypeDecl, use type reconstruction. Since type reconstruction
doesn't normally concern itself with non-type decls, set up a lookup table in SourceFiles and
ModuleFiles to let us handle the mapping from mangled name to opaque type decl in type
reconstruction.

(Since we're invoking type reconstruction during type checking, when the module hasn't yet been
fully validated, we need to plumb a LazyResolver into the ASTBuilder in an unsightly way. Maybe
there's a better way to do this... Longer term, at least, this surface design gives space for
doing things more the right way--a more request-ified decl validator ought to be able to naturally
lazily service this request without the LazyResolver reference, and if type reconstruction in
the future learns how to reconstruct non-type decls, then the lookup tables can go away.)
2019-04-17 14:46:22 -07:00
Nathan Hawes
1d4b6df411 Update tests from @_inheritedDefaultValue to '= super' 2019-04-16 15:21:26 -07:00
Nathan Hawes
b425987e45 Add diagnostics for the new @_inheritedDefaultValue attribute 2019-04-16 11:23:23 -07:00
Nathan Hawes
9639bceded Add an attribute to inhert a param's default value from the overridden decl in module interfaces 2019-04-16 11:22:36 -07:00