Commit Graph

88048 Commits

Author SHA1 Message Date
Michael Gottesman
24cff27f0c Revert "Revert "[ownership] If we have an undef address, do not treat it as being owned. It is any.""
This reverts commit 7a28a02189.
2019-06-24 11:14:45 -07:00
Xi Ge
1e3c674f56 Merge pull request #25710 from nkcsgexi/ownership-revert
Revert some ownership changes that causes source compatibility failures
2019-06-24 11:07:31 -07:00
Xi Ge
107d27a6e5 Revert "[mark-uninit-fixup] Change a SILBuilder => SILBuilderWithScope."
This reverts commit 612cd9bd35.
2019-06-24 11:03:54 -07:00
Xi Ge
f9c586fae5 Revert "[ownership] Verify functions before we strip ownership."
This reverts commit 7bd15bdb81.
2019-06-24 11:03:41 -07:00
Xi Ge
f53525b0a1 Revert "[ownership] Ignore non-consuming uses in dead end blocks when we are analyzing objects that are consumed once in the same block in which they are defined."
This reverts commit 9a67f2d3ba.
2019-06-24 11:02:44 -07:00
Xi Ge
7a28a02189 Revert "[ownership] If we have an undef address, do not treat it as being owned. It is any."
This reverts commit e2c540461e.
2019-06-24 11:02:35 -07:00
Jordan Rose
b6680175f3 [ModuleInterface] Explicitly print implied Hashable et al on enums (#25650)
Enums have a handful of conformances that are implied by their
structure: Equatable and Hashable if they have no payloads, and
RawRepresentable if they have a raw value. In the spirit of making
implicit things explicit, these should be printed in the module
interface.

rdar://problem/50100142
2019-06-24 10:36:48 -07:00
David Ungar
e676a130eb Merge pull request #25694 from davidungar/delayed-parse-fix
[Parser] Handle TopLevelCode case
2019-06-24 10:07:40 -07:00
Slava Pestov
de3284baae Merge pull request #25686 from slavapestov/flag-day
Remove a couple of obsolete frontend flags
2019-06-24 10:10:12 -04:00
swift-ci
e9d827ca3c Merge pull request #25703 from gottesmm/pr-9ce7ee5ae4fd57ea34dec6d0684787ff04fcf634 2019-06-24 00:24:59 -07:00
swift-ci
dd9a9fe195 Merge pull request #25704 from gottesmm/pr-4bfe70900a409216e2b3f647d33d6644012367d6 2019-06-24 00:08:16 -07:00
Michael Gottesman
0627ea60e5 Merge pull request #25702 from gottesmm/pr-6780a2b72e15cebcf1c470110b4062997a910b41
[ownership] Ignore non-consuming uses in dead end blocks when we are …
2019-06-23 23:46:11 -07:00
swift-ci
f6c7c456b4 Merge pull request #25701 from gottesmm/pr-b1a6decb052267904eb3f0892f311d0512a5b023 2019-06-23 23:32:02 -07:00
Michael Gottesman
e2c540461e [ownership] If we have an undef address, do not treat it as being owned. It is any. 2019-06-23 23:06:51 -07:00
Michael Gottesman
7bd15bdb81 [ownership] Verify functions before we strip ownership.
Today before/after running optimizations, the driver always verifies the entire
SILModule. Sadly since we are stripping ownership in the /middle/ of the
pipeline, we do not get the same benefit for ownership SIL.

With this change, we verify before we strip ownership to ensure that the code is
[ossa] correct /before/ we strip.

This will only run in asserts builds unless -sil-verify-all is passed in.
2019-06-23 22:30:49 -07:00
swift-ci
898ba07563 Merge pull request #25700 from compnerd/stdlib-unittest-fp80 2019-06-23 22:18:06 -07:00
Michael Gottesman
9a67f2d3ba [ownership] Ignore non-consuming uses in dead end blocks when we are analyzing objects that are consumed once in the same block in which they are defined. 2019-06-23 22:15:26 -07:00
Saleem Abdulrasool
2a710f4bba StdlibUnittest: disable FP80 path on android
android x64 does not support FP80
2019-06-23 21:05:46 -07:00
Michael Gottesman
612cd9bd35 [mark-uninit-fixup] Change a SILBuilder => SILBuilderWithScope.
A small part of the effort to purge SILBuilder from the code base. Without this,
we will hit debug holes.
2019-06-23 20:39:43 -07:00
Michael Gottesman
934f34da53 Merge pull request #25693 from gottesmm/pr-2677daef7169119f14e1aaf6f7117ef39430deb8
[cast-opt] Improve handling of arguments when optimizing Swift -> Obj…
2019-06-23 16:47:25 -07:00
David Ungar
7c7c77c0ae Handle TopLevelCode case 2019-06-23 13:46:56 -07:00
Michael Gottesman
5d9675392e [cast-opt] Improve handling of arguments when optimizing Swift -> ObjC bridging casts.
Specifically:

1. I removed an extra defensive copy that we put in place some time ago that
isn't really warranted. We know that we have an @owned value, so can safely just
pass the value as a @guaranteed parameter. This also eliminates an ownership
error that would occur due to my not having updated this code for ownership in
tree.

2. I also ensured that if we are performing a loadable address bridging cast ->
value bridging cast that we store the loadable value back into memory after we
perform the cast. Otherwise, it appears to leak to the ownership verifier.

I also centralized the non-ownership tests for this into one place
(const_fold_objc_bridge.sil => constant_propagation_objc.sil).
2019-06-23 13:17:10 -07:00
ravikandhadai
bcdd46cdfe Merge pull request #25677 from ravikandhadai/constexpr-intliteral-trunc
[Const Evaluator] Make compile-time constant evaluator correctly handle s_to_s_checked_trunc_IntLiteral_IntNN where the bit width of the source symbolic value (an APInt) could be smaller than the destination bits
swift-DEVELOPMENT-SNAPSHOT-2019-06-23-a
2019-06-23 10:45:01 -07:00
swift-ci
f7d37aaedc Merge pull request #25690 from gottesmm/pr-ad3818118fc0e60f555fec49c0efbaa00d90d67c 2019-06-22 23:18:33 -07:00
Michael Gottesman
4b31d37307 [cast-opt] Rename misnamed variable.
This is actually an out parameter of the apply that we are then switching upon.
2019-06-22 22:12:00 -07:00
Slava Pestov
566e9dfea0 Frontend: Remove -enable-resilience flag 2019-06-22 21:37:04 -04:00
Slava Pestov
f01e384826 Frontend: Remove -enable-resilient-objc-class-stubs flag 2019-06-22 21:37:04 -04:00
Michael Gottesman
17d65dc861 Merge pull request #25673 from gottesmm/pr-346412d7746bf95e1c890610c95d7401bc4490c3
[update-checkout] Make SWIFT_SOURCE_ROOT customizable and add a basic clone test
2019-06-21 23:11:48 -07:00
Slava Pestov
5c5de29e85 Merge pull request #25678 from slavapestov/vtable-thunk-final-bug
SILGen: Fix generated vtable thunk when a final override is more visible than the base
2019-06-22 00:25:24 -04:00
Slava Pestov
e2d660f148 SILGen: Fix generated vtable thunk when a final override is more visible than the base
Don't re-dispatch to the override's vtable slot if the override
is final; there's no vtable slot and this will result in an
infinite loop.

Fixes <rdar://problem/52006394>.
2019-06-21 22:56:48 -04:00
Ravi Kandhadai
11efa58a6c [Const Evaluator] Make compile-time constant evaluator correctly handle
s_to_s_checked_trunc_IntLiteral_IntNN where the bit width of the source
symbolic value (an APInt) could be smaller than the destination bits.
2019-06-21 19:35:06 -07:00
Michael Gottesman
a9d384dac3 [update-checkout] Add a simple mock update-checkout test that makes sure that we can clone.
This commit is not meant to completely test update-checkout, but rather create
some scaffolding for testing update-checkout so we can create starter bugs to
fill out the rest of the functionality. Once we have enough testing in place, we
can start refactoring/simplifying update-checkout.

Design
------

This is just a standard python unittest test suite except that the tests expect
an environment variable (UPDATECHECKOUT_TEST_WORKSPACE_DIR) to be set that
specifies the directory that the unittests have for creating mock git repos
during setup/teardown. lit invokes the test by calling the unittests with the
environment variable set to the appropriate temporary directory.

In this temporary directory, each test creates a pristine set of "fake" remote
repos and a test-config.json file that can be passed to update-checkout to work
with these "fake" remote repos. This allows each test that we write to test
various update-checkout functionalities against a pristime set of git repos. I
choose the git clone test, just b/c it was really simple.

NOTE: One can also run the tests locally using the script
test_update_checkout.sh that uses /tmp/workspace as the workspace directory.
2019-06-21 18:25:08 -07:00
swift-ci
88a5c00b34 Merge pull request #25672 from akyrtzi/index-remove-module-hash 2019-06-21 18:16:29 -07:00
Michael Gottesman
e8ad3201f6 [update-checkout] Allow the source root to be passed in instead of hard coding to SWIFT_SOURCE_ROOT.
This enables mocking testing to work (otherwise we would create repos in
SWIFT_SOURCE_ROOT). SWIFT_SOURCE_ROOT is the default value so nothing changes
unless one specifies the argument explicitly.
2019-06-21 18:13:40 -07:00
Jordan Rose
15bcd23e37 [ModuleInterface] Propagate availability for nested types too (#25662)
Previously the module interface printing would scrape the
AvailableAttrs from the containing decl in order to print synthesized
extensions for conformances that wouldn't otherwise be printed...but
that missed the case where a containing lexical scope had the
availability attributes instead. Now it walks up the chain of parent
DeclContexts and collects the most specific AvailableAttr for each
platform.

This /still/ isn't formally correct because it doesn't merge
availability for one platform (if something inside is deprecated
unconditionally but outside has an "introduced" version), but it's
going to match the vast majority of code out there.

Pre-requisite for rdar://problem/50100142
2019-06-21 18:00:44 -07:00
Argyrios Kyrtzidis
3332b37d00 [Index/SourceKit] Remove the code related to calculating a module hash from the indexing walker
This has been an unnecessary code path for a long time now and should be removed particularly because it triggers wasteful `stat` calls.

rdar://51523161
2019-06-21 17:09:12 -07:00
Vlad Gorlov
62dd6bda10 Android build on macOS Cross-Compile host: Fixes wrong Ninja rules generation. (#25576)
* Fixes wrong Ninja rules generation for Android build on macOS Cross-Compile host.

* PR review fixes.
2019-06-21 17:04:51 -07:00
swift-ci
65d63f1ced Merge pull request #25671 from apple/update-checkout-sha-info 2019-06-21 16:42:09 -07:00
mishal_shah
5832743c5c [Update Checkout] Print sorted repo list 2019-06-21 16:04:44 -07:00
Ben Langmuir
f5f3b5c9cf Merge pull request #25654 from rintaro/ide-completion-declattr-independent-rdar50441643
[CodeCompletion] Don't attach attr to decl if blank line exists
2019-06-21 15:08:29 -07:00
Rintaro Ishizaki
bb3edd5dde [CodeCompletion] contextual attribute completion only on the same line
It's common to have decls on consecutive lines. Better to show too many
attributes than too few.
2019-06-21 14:03:09 -07:00
Mishal Shah
238f10cbcc Merge pull request #25665 from apple/update-checkout-sha-info
[Update Checkout] Print hashes at the end of the successful clone/update.
swift-DEVELOPMENT-SNAPSHOT-2019-06-21-a
2019-06-21 13:09:01 -07:00
swift-ci
21cbc868ef Merge pull request #25663 from aschwaighofer/fix_abi_v7k_test 2019-06-21 13:06:39 -07:00
Pavel Yaskevich
ef96e8904f Merge pull request #25638 from xedin/rdar-51576862
[Diagnostics] Don't suggest argument destructuring fix-it if closu…
2019-06-21 12:32:44 -07:00
mishal_shah
f5963923de [Update Checkout] Print hashes at the end of the successful clone/update.
- Support dump-hashes with skipped repos
- Remove duplicated code from dump hashes
2019-06-21 11:53:59 -07:00
Arnold Schwaighofer
b47aeb1ae8 Fix test/IRGen/abi_v7k.swift
rdar://51992998
2019-06-21 11:53:16 -07:00
Rintaro Ishizaki
bc037967d1 [CodeCompletion] Stop using DeclKind::Module as a isIndependent indicator 2019-06-21 11:15:25 -07:00
Arnold Schwaighofer
7e8ce6ce4a Merge pull request #25631 from aschwaighofer/ReplaceOpaqueTypesWithUnderlyingTypes_primary_file_mode
ReplaceOpaqueTypesWithUnderlyingTypes: In primary-file mode there mig…
2019-06-21 08:12:47 -07:00
Arnold Schwaighofer
7e030512fc Merge pull request #25573 from aschwaighofer/runtime_avail_rework
Rework getRuntimeFn runtime availability
2019-06-21 06:47:37 -07:00
Brent Royal-Gordon
29bff80d49 Unskip most of associated_type_demangle_private (#25657)
There’s only one specific case that isn’t working correctly right now; re-enable the rest of the test. rdar://problem/51959305
2019-06-20 21:34:38 -07:00