Commit Graph

1131 Commits

Author SHA1 Message Date
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
Arnold Schwaighofer
ff67cffe4f Merge remote-tracking branch 'upstream/master' into master-next 2019-10-02 10:12:33 -07:00
Arnold Schwaighofer
6a23ed5438 Revert "IRGen: Leave frame pointers off SIL functions marked [thunk]."
This reverts commit b3ac66aeeb.

This is problematic when [thunk] functions get inlined into and the
function from which we inline expects a framepointer.

Specifically, _swift_os_log_return_address() reads the framepointer.

rdar://55852225
2019-10-02 06:54:49 -07:00
swift-ci
448807f579 Merge remote-tracking branch 'origin/master' into master-next 2019-09-20 19:09:54 -07:00
Pavel Yaskevich
8eaeb51fe5 [ConstraintSystem] Introduce a fix for assignment type mismatch
Introduce a fix/diagnostic when there is a contextual mismatch
between source and destination types of the assignment e.g.:

```swift
var x: Int = 0
x = 4.0 // destination expects an `Int`, but source is a `Double`
```
2019-09-20 17:12:04 -07:00
swift-ci
bd0d9603b1 Merge remote-tracking branch 'origin/master' into master-next 2019-09-16 01:29:22 -07:00
Pavel Yaskevich
a1643d94f7 [Diagnostics] NFC: Update all of the improved test-cases 2019-09-13 22:35:52 -07:00
swift-ci
0c440ff5ef Merge remote-tracking branch 'origin/master' into master-next 2019-09-13 20:49:32 -07:00
Harlan Haskins
d3b8ce7ae2 [test] Update ParseableInterface to ModuleInterface
Also remove uses of -emit-parseable-module-interface from tests
2019-09-13 14:55:48 -07:00
Jordan Rose
73d5ebaad2 Rename "textual interface" to "parseable interface" (#19713)
We already have something called "module interfaces" -- it's the
generated interface view that you can see in Xcode, the interface
that's meant for developers using a library. Of course, that's also a
textual format. To reduce confusion, rename the new module stability
feature to "parseable [module] interfaces".
2018-10-04 17:49:55 -07:00
Jordan Rose
3ea754481e [Frontend] Allow -emit-interface with -typecheck (#19676)
Textual module interfaces don't actually depend on SILGen, so we
shouldn't need to run SILGen (or serialize an entire binary module) if
we're just trying to emit a textual interface. On the other hand, if
we /are/ going to run SILGen and then SIL diagnostics, we shouldn't
delay those diagnostics by spending time emitting a textual interface,
or for that matter a TBD file.

Using this, update all the ModuleInterface tests that use
`-emit-module -o /dev/null` to use `-typecheck` instead, except for
those using `-merge-modules`.
2018-10-03 15:07:31 -07:00
Harlan
8061358211 [InlinableText] Handle multiline #if conditions (#19675)
Previously, a #if of the form:

```swift
#if (
  false
)
print("x")
#endif
```

Would be emitted after #if-stripping as

```swift
  false
)
print("x")
```

Because the old logic assumed conditions will always appear on one line.
Instead, for active clauses that have conditions, skip to the next line
after the end of the condition instead.
2018-10-02 19:48:40 -07:00
Jordan Rose
c66fcf2e61 [SILGen] Don't SILGen an @objc entry point for a deinit with no body (#19472)
In general we'll want to investigate what we are and aren't SILGen-ing
for textual interfaces of resilient modules, but for fragile modules
we may as well generate everything we can for potential optimization
purposes.
2018-09-28 13:17:47 -07:00
Jordan Rose
61057b88db [ModuleInterface] Print names for @usableFromInline struct properties (#19465)
Because they weren't 'public' we were treating them as layout-only
properties and printing `var _`, but they get referenced in inlinable
functions. We need the actual name!
2018-09-26 14:57:44 -07:00
Jordan Rose
b29f010510 [ModuleInterface] Don't print extensions of internal types (#19440) 2018-09-26 14:57:23 -07:00