Commit Graph

1195 Commits

Author SHA1 Message Date
Brent Royal-Gordon
a7a5e340aa Improve diagnostic for broken module interfaces
Currently, when a swiftinterface file fails to load, we emit the specific diagnostics for the failures, followed by a generic “failed to load module ‘Foo’” message. This PR improves that final diagnostic, particularly when the cause may be that the interface was emitted by a newer compiler using backwards-incompatible syntax.
2020-03-13 20:31:55 -07:00
Joe Groff
808d33d016 IRGen: Don't cache accesses to fixed class metadata.
The only initialization these class objects need is ObjC realization, which can be done
fast with `objc_opt_self` on recent Apple OSes. The cache check just adds code size and
dirties memory.
2020-02-26 15:10:18 -08:00
swift-ci
c59f1aa6ba Merge pull request #29797 from CodaFi/clotheslined 2020-02-12 15:55:29 -08:00
Robert Widmann
e5d9fef296 Add a regression test for the @usableFromInline pattern in rdar://59171169
Make sure we don't print @_hasMissingDesignatedInitializers in the swift
interface when we actually can see all the designated initializers.
2020-02-12 14:13:52 -08:00
Robert Widmann
12d542c24f Specialize a test for Windows
An unfortunate workaround for rdar://59397376

Resolves rdar://59318361
2020-02-12 12:45:43 -08:00
Mishal Shah
db8bf0bd29 Merge pull request #29744 from apple/master-rebranch
Merge master-rebranch into master to support new llvm branch apple/stable/20200108
2020-02-10 17:50:40 -08:00
Robert Widmann
6d40e7b350 XFAIL a test holding up the rebranch process 2020-02-10 11:24:15 -08:00
swift-ci
822408fbc6 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-29 14:23:11 -08:00
Slava Pestov
3c86061de8 Sema: Fix module interface printing of inherited generic initializers
Make sure we use the sugared form of GenericTypeParamType and not
the canonical type.

Fixes <rdar://problem/58578998>.
2020-01-29 12:32:22 -08:00
swift-ci
3e4ceaa05d Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-16 08:43:11 -08:00
Erik Eckstein
1b312a85bd Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-16 10:39:20 +01:00
Daniel Rodríguez Troitiño
eb90ff2def [test][android] Mark inherits-superclass-initializers-client as executable.
The test uses %target-run, which requires executing code. Android CI
cannot execute code because no device is attached. Marking the test as
executable skip it in the Android CI machines.
2020-01-15 14:40:57 -08:00
Arnold Schwaighofer
3a520e674e Disable test that fails spuriously
This test fails sometimes with something like:

SOURCE_DIR/test/ModuleInterface/ModuleCache/prebuilt-module-cache-forwarding.swift:47:8: error: malformed compiled module: BUILD_DIR/test-macosx-x86_64/ModuleInterface/ModuleCache/Output/prebuilt-module-cache-forwarding.swift.tmp/MCP/Lib-2XZQCTV44N470.swiftmodule

rdar://58578342
2020-01-15 06:04:41 -08:00
Saleem Abdulrasool
546c5b79ab tests: fix accidental not env usage
Manually expand out the few places where we had a `not ...` substitution
where the substituted value was invoking `env` to alter the environment.
This pattern is not portable and causes problems when using the
integrated shell, such as on Windows.  This was identified during the
LLVM update.

This additionally corrects the use of `not` to indicate that it is
expecting a crashing failure.  This was resulting in the Windows tests
failing as `not` was not expecting a crashing failure.
2020-01-14 13:29:14 -08:00
swift-ci
da3943ae2b Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-13 14:43:23 -08:00
Harlan Haskins
e23e77b6a5 Allow function builder attrs on vars without bodies in interfaces (#29165)
The check for whether or not we can use a function builder on a property
checked whether the attached getter had a body, which is not always true for
module interfaces. Just disable that part of the check when compiling a
module interface.

rdar://58535753
2020-01-13 14:41:01 -08:00
swift_jenkins
8a3c5c753b Merge remote-tracking branch 'origin/master' into master-next 2020-01-08 09:57:24 -08:00
Arnold Schwaighofer
43c24be5cd Merge remote-tracking branch 'upstream/master' into master-next 2020-01-08 06:41:34 -08:00
Varun Gandhi
afc6ccdeb5 Re-land parsing and printing for Clang function types.
This reverts commit e805fe486e, which reverted
the change earlier. The problem was caused due to a simultaneous change to some
code by the PR with parsing and printing for Clang function types (#28737)
and the PR which introduced Located<T> (#28643).

This commit also includes a small change to make sure the intersecting region
is fixed: the change is limited to using the fields of Located<T> in the
`tryParseClangType` lambda.
2020-01-07 15:58:32 -08:00
Xi Ge
133e8a186f ModuleInterface: preserve AutolinkForceLoad option when generating .swiftmodule from .swiftinterface
This change ensures using .swiftmodule built from source has the same behavior as
using .swiftmodule built from .swiftinterface.

A swift-ide-test utility is added to print linked libraries from a Swift module for
testing purposes.

rdar://58057556
2020-01-06 21:17:02 -08:00
Saleem Abdulrasool
e805fe486e Revert "Clang function types v2: Electric Boogaloo (parsing + printing)" 2020-01-06 16:26:08 -08:00
Varun Gandhi
4a1a17d029 Merge pull request #28737 from varungandhi-apple/vg-v3-clang-types-in-swiftinterface
Clang function types v2: Electric Boogaloo (parsing + printing)
2020-01-06 15:42:30 -08:00
Varun Gandhi
96604470ae [AST] Add printing for Clang function types in the AST. 2020-01-06 13:00:04 -08:00
swift_jenkins
70bfa0cfc1 Merge remote-tracking branch 'origin/master' into master-next 2020-01-06 12:17:27 -08:00
Harlan Haskins
511db0c90a [ModuleInterface] Add printing for new attributes
Specially print @_hasMissingDesignatedInitializers and @_inheritsConvenienceInitializers in module interfaces

Fixes rdar://51249311
2020-01-06 10:15:07 -08:00
swift_jenkins
eee69d9bfa Merge remote-tracking branch 'origin/master' into master-next 2019-12-18 11:19:50 -08:00
Rintaro Ishizaki
c146c65e22 Merge pull request #28165 from rintaro/astprinter-rdar57033931
[ASTPrinter/CodeCompletion] Stop printing base type when possible
2019-12-18 11:03:56 -08:00
Rintaro Ishizaki
6da2ca7afa [ASTPrinter] Test case for moduleinterface with member typealiases 2019-12-17 16:26:41 -08:00
swift_jenkins
a812971ee5 Merge remote-tracking branch 'origin/master' into master-next 2019-12-17 15:00:16 -08:00
Xi Ge
cf79163764 test: update test to combine @available with @_originallyDefinedIn 2019-12-17 11:29:56 -08:00
Joe Groff
fb34044408 Merge remote-tracking branch 'origin/master' into master-next 2019-12-10 12:46:41 -08:00
Xi Ge
5a862e49bd Merge pull request #28369 from nkcsgexi/originally-defined-in-attribute
AST: introduce a new attribute @_originallyDefinedIn to the AST
2019-11-21 20:26:29 -08:00
Xi Ge
7f8c04e0b7 AST: introduce a new attribute @_originallDefinedIn to the AST
We need this attribute to teach compiler to use a different name from the current
module name when generating runtime symbol names for a declaration. This is to serve
the workflow of refactoring a symbol from one library to another without breaking the existing
ABI.

This patch focuses on parsing and serializing the attribute, so @_originallyDefinedIn
will show up in AST, swiftinterface files and swiftmodule files.

rdar://55268186
2019-11-21 14:25:57 -08:00
Harlan Haskins
22bab7c5f7 [ModuleInterface] Fix indentation for private(set) vars
Previously, we would print

```swift
public private(set) var x: Int
```

as

```swift
@_hasStorage public var x: Swift.Int {
  get
  }
```

which is a) incorrectly indented, and b) shouldn't have newlines in part
of the Generated Interface.

Fixes [SR-9816](https://bugs.swift.org/browse/SR-9816)
2019-11-21 13:56:07 -08:00
swift_jenkins
f584bc4b9c Merge remote-tracking branch 'origin/master' into master-next 2019-11-21 04:00:10 -08:00
Suyash Srijan
4c85dd65ae Merge pull request #28216 from theblixguy/fix/SR-11762
[Typechecker] Fix _modify for properties using a property wrapper
2019-11-21 11:42:03 +00:00
swift_jenkins
f919e12436 Merge remote-tracking branch 'origin/master' into master-next 2019-11-17 15:40:26 -08:00
Michael Gottesman
269762eee3 [ownership] Enable ownership lowering /after/ the diagnostic passes.
I also updated the last group of straggling tests.
2019-11-17 11:34:43 -08:00
Suyash Srijan
0cd59069d3 [Test] Update a few failing tests 2019-11-16 16:32:39 +00:00
swift-ci
06850c23dc Merge remote-tracking branch 'origin/master' into master-next 2019-11-11 21:10:01 -08:00
Harlan Haskins
9d08d4f48c [ModuleInterface] Don't print @_staticInitializeObjCMetadata
This attribute is computed during the build and is rejected by the
parser. Make sure not to print it.

Fixes rdar://56923079
2019-11-11 17:25:35 -08:00
Xi Ge
64c0680686 Merge remote-tracking branch 'apple/master' into master-next 2019-10-28 10:19:36 -07:00
Daniel Rodríguez Troitiño
eaae6f73d7 XFAIL SDKDependencies test in Windows.
Windows paths attack again. Some paths from the dependency tracker have
mixed folder separators, so comparing textually fail. Additionally some
paths seems to be extended paths (\\?\) which seems not to be liked by
LLVM path utilities.
2019-10-17 10:09:51 -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
Harlan Haskins
bcd6b0f202 [ModuleInterfaces] Don't diagnose @NSManaged properties with accessors
Normally, we diagnose @NSManaged properties that have getters and
setters because they are actually supposed to be stored properties with
special synthesized accessors. Since we print those accessors in module
interfaces, just don't error when we see them.

Fixes rdar://56111556
2019-10-14 18:08:51 -07:00
Varun Gandhi
f969320883 Emit traces related to sdk dependencies and mark test case failing.
Exposes the issue in rdar://problem/55752426.
2019-10-11 17:23:07 -07:00
swift-ci
2ff9c51fe1 Merge remote-tracking branch 'origin/master' into master-next 2019-10-02 23:49:45 -07:00
Harlan Haskins
ce531be1bc Merge pull request #27469 from harlanhaskins/target-acquired
[ModuleInterfaces] Combine the normalized target triple into the cache hash
2019-10-02 23:35:24 -07:00
Harlan Haskins
c0908160a6 [ModuleInterfaces] Combine the normalized target triple into the cache hash
Previously, we'd combine just the target architecture, and rely on the
fact that the .swiftinterface is in a reasonably-target-specific
subdirectory to include enough entropy to avoid hash collisions. But in
the presence of a VFS or if two targets are sharing the same
.swiftinterface file (which can sometimes happen in tests), they will
collide since the hash only includes architecture.

Instead, use the same normalization that the serialized module loader
uses, and serialize the normalized target triple instead.

Fixes rdar://55881335
2019-10-02 11:43:55 -07:00