Commit Graph

84526 Commits

Author SHA1 Message Date
Mike Ash
b51b60b227 [RemoteMirror] Add missing test.swift file for interop tests. 2019-03-25 20:51:17 -04:00
swift-ci
bfc2753976 Merge pull request #23466 from compnerd/driving-to-completion 2019-03-21 14:31:57 -07:00
Saleem Abdulrasool
3192eb3221 Merge pull request #22208 from linux-on-ibm-z/s390x-storetag-fix
Fix storeEnumTagSinglePayload on big-endian systems
2019-03-21 14:18:12 -07:00
Davide Italiano
8702c23afa Merge pull request #23464 from dcci/rdar49043621
[Reflection] Add an utility to stress test the metadata reader.
2019-03-21 13:56:27 -07:00
Julian Lettner
8ed0ebe5f3 Merge pull request #23455 from apple/build-compile_rt-with-libdispatch-support
Build compiler-rt with TSan interception for libdispatch on non-Apple platforms
2019-03-21 12:11:41 -07:00
Saleem Abdulrasool
d655c3dfa0 test: improve test coverage rate for Windows
Strip the use of `env` on Windows which will swallow the error code if
the GnuWin32 version (which is recommended/used by LLVM) is used.  Since
SDKROOT should not be set on Windows anyways, this should not matter
much in practice but will help improve the test coverage on Windows.

Additionally, remove the path lowercasing on Windows as the path is kept
in the proper case, even on the nightlies.  This should help improve the
number of Driver tests that pass.

With this change, I now can get all the Driver tests to pass locally.
2019-03-21 11:03:24 -07:00
Daniel Rodríguez Troitiño
4dcf60ca0f [test] Fix FixedPointConversion tests (#23220)
Fix several problems with FixedPointConversion generation code.

The first problem is that at some point `repr(value)` was being used,
which turn the number into a string. That was great for printing the
number, but make the test against the value of the number (like
`testValue < otherMin` always false. There were a number of tests that
were never performed, specifically the integer tests.

The second problem was using doubles in the Python code. For Float32 and
Float64 the tests were generated correctly, but in the case of Float80,
the test adding or removing a quantity to the maximum/minimum were
failing because of the lack of precission (Adding 0.1 to a very
big/small number is the same as not adding anything). Switching to
Decimal should keep enough precission for the tests.

Finally the last problem was that the bounds of the conversions are not
actually `selfMin` and `selfMax`, but the values returned by the utility
function `getFtoIBounds`. For example for unsigned types, the lower
bound is always -1, not zero (every value between -1 and zero is rounded
to zero, and doesn't fail).

Instead of using nested gyb templates, use lit.cfg %target-ptrsize,
which should be faster, cleaner, and provides correct line-directive
output.

Remove a bunch of warnings in Swift when compiling the generated result
of FixedPointConversion.swift.gyb.

Co-authored-by: Gwynne Raskind <gwynne@users.noreply.github.com>
2019-03-21 13:58:30 -04:00
Davide Italiano
3a17628611 [Reflection] Add an utility to stress test the metadata reader.
lldb now uses this quite extensively so we want to make sure
we don't crash on invalid.

<rdar://problem/49043621>
2019-03-21 10:34:33 -07:00
Saleem Abdulrasool
65d4199c7b Merge pull request #23400 from drodriguez/remove-incorrect-docs
[stdlib] Remove documentation piece that it is not longer true.
2019-03-21 09:30:34 -07:00
Joe Groff
cdf9de950f Merge pull request #23442 from linux-on-ibm-z/s390x-enum-fixes
IRGen: simplify getSpareBitsForType
2019-03-21 09:28:23 -07:00
Slava Pestov
f157cdc1ed Merge pull request #23458 from slavapestov/tuple-conversions-part-1
Split off ArgumentShuffleExpr from TupleShuffleExpr
2019-03-21 11:17:41 -04:00
Arnold Schwaighofer
2ebd24bb9f Merge pull request #23429 from aschwaighofer/fix_enable_private_import_get_effective_access_level_symbolic_references_property_desc
Property descriptor and symbolic type references need to ignore enable-private-import
2019-03-21 08:11:05 -07:00
Slava Pestov
428c709491 AST: Remove argument list-specific parts of TupleShuffleExpr
Before extending TupleShuffleExpr to represent all tuple
conversions allowed by the constraint solver, remove the
parts of TupleShuffleExpr that are no longer needed; this is
support for default arguments, varargs, and scalar-to-tuple and
tuple-to-scalar conversions.
2019-03-21 02:18:41 -04:00
Slava Pestov
d470e9df4d AST: Split off ArgumentShuffleExpr from TupleShuffleExpr
Right now we use TupleShuffleExpr for two completely different things:

- Tuple conversions, where elements can be re-ordered and labels can be
  introduced/eliminated
- Complex argument lists, involving default arguments or varargs

The first case does not allow default arguments or varargs, and the
second case does not allow re-ordering or introduction/elimination
of labels. Furthermore, the first case has a representation limitation
that prevents us from expressing tuple conversions that change the
type of tuple elements.

For all these reasons, it is better if we use two separate Expr kinds
for these purposes. For now, just make an identical copy of
TupleShuffleExpr and call it ArgumentShuffleExpr. In CSApply, use
ArgumentShuffleExpr when forming the arguments to a call, and keep
using TupleShuffleExpr for tuple conversions. Each usage of
TupleShuffleExpr has been audited to see if it should instead look at
ArgumentShuffleExpr.

In sequent commits I plan on redesigning TupleShuffleExpr to correctly
represent all tuple conversions without any unnecessary baggage.

Longer term, we actually want to change the representation of CallExpr
to directly store an argument list; then instead of a single child
expression that must be a ParenExpr, TupleExpr or ArgumentShuffleExpr,
all CallExprs will have a uniform representation and ArgumentShuffleExpr
will go away altogether. This should reduce memory usage and radically
simplify parts of SILGen.
2019-03-21 02:18:41 -04:00
Pavel Yaskevich
8fcd4e6ee3 Merge pull request #23311 from theblixguy/fix/throw-in-defer
[Diag] [Typechecker] Diagnose throw in defer properly
2019-03-20 20:44:38 -07:00
Harlan Haskins
155c6a9e46 Merge pull request #23450 from harlanhaskins/can-can-you-do-the-import
[ParseableInterface] Add test for #if canImport
2019-03-20 18:35:40 -07:00
Julian Lettner
552ab0c467 Build compile-rt with libdispatch interception to support TSan on Linux
I recently enabled TSan interceptors for libdispatch on non-Apple
platforms in upstream. This is on by default on Apple platforms. Let's
try to switch it on for other platforms too.
2019-03-20 17:39:35 -07:00
Xi Ge
c280dab306 Merge pull request #23447 from nkcsgexi/diagnose-api-checker
swift-api-checker: teach the script to also diagnose the breakages between two previous dumps
2019-03-20 17:38:46 -07:00
Xi Ge
c2f77291ea Merge pull request #23445 from nkcsgexi/install-swift-api-checker
cmake: install swift-api-checker into the tools component.
2019-03-20 17:38:32 -07:00
Saleem Abdulrasool
4f5feba597 Merge pull request #23395 from drodriguez/fix-dry-run
[build-script] Respect dry-run when building/testing ICU
2019-03-20 16:59:53 -07:00
Xi Ge
6a502aaefd swift-api-checker: allow users to specify the path of a swift-api-digester 2019-03-20 14:49:16 -07:00
Harlan Haskins
8b099cd0e7 [ParseableInterface] Add test for #if canImport
This works correclty as-is, but it should be tested.

rdar://48733713
2019-03-20 13:57:16 -07:00
Michael Gottesman
384882d5f3 Merge pull request #23201 from compnerd/patience-is-not-always-a-virtue
build: introduce and switch to GYB_SOURCES
2019-03-20 13:27:32 -07:00
Andrew Trick
71b012e8f0 Merge pull request #23190 from atrick/cleanup-accessopts
Cleanup/fix AccessEnforcementOpts
2019-03-20 13:15:55 -07:00
Xi Ge
51bd604a1a swift-api-checker: teach the script to also diagnose the breakages between two previous dumps 2019-03-20 12:26:35 -07:00
Arnold Schwaighofer
168c4f948c Merge pull request #23426 from aschwaighofer/sema_cdecl_not_dynamic
Sema: Don't implicitly mark functions with a cdecl as dynamic
2019-03-20 12:23:02 -07:00
Arnold Schwaighofer
d2631c2cec SILGen: Fix property descriptor emission when enable-private-imports is enabled 2019-03-20 11:59:13 -07:00
Arnold Schwaighofer
2c33b72b11 IRGen: Mangle symbolic type references as private types even with enable-private-imports 2019-03-20 11:54:56 -07:00
Xi Ge
5c0013e371 cmake: install swift-api-checker into the tools component. 2019-03-20 11:24:33 -07:00
Duncan P. N. Exon Smith
43e771e55b Reapply ClangImporter changes to leverage Clang's module cache
This reapplies four commits for the ClangImporter.  They broke the build
on master because the associated commits on swift-clang's
swift-5.1-branch never made it to stable due to automerger woes.  This
time I'll push everything through manually.

These are the commits being reapplied:

- a42bc62397 "ClangImporter: Share a module cache between CompilerInstances"
- 9eed34235b "ClangImporter: Adjust to r355777, PCMCache => ModuleCache"
- da8a1c57e8 "ClangImporter: Use the new CacheGeneratedPCH in Clang"
- 2134b17a20 "ClangImporter: Test that PCHs are actually cached in memory"

rdar://problem/48545366
2019-03-20 09:59:58 -07:00
Ben Langmuir
f5a216fc04 Merge pull request #23411 from benlangmuir/cc-1-close
[code-completion] Add type context for single-expression closures
2019-03-20 06:56:49 -07:00
Suyash Srijan
731c516ce5 [test] update tests 2019-03-20 12:35:32 +00:00
Suyash Srijan
8f79bb8912 Merge branch 'master' into fix/throw-in-defer 2019-03-20 11:25:35 +00:00
Michael Munday
cacf9c72b6 IRGen: simplify getSpareBitsForType
Use an APInt to create the spare bit mask for integer values. This
will allow us to byte swap it when we make the SpareBitVector
strictly little-endian even when targeting big-endian machine.

While editing this code I've also got rid of the goto statement
since it seemed unnecessary.
2019-03-20 09:56:42 +00:00
Rintaro Ishizaki
1b3c4ad4a5 Merge pull request #23372 from rintaro/ide-completion-escapedident-16232627
[CodeCompletion] Escape declaration base name if needed
2019-03-19 22:22:32 -07:00
Suyash Srijan
25e0a9f749 [Typechecker] Fix an issue with redeclaration checking (#23227)
* [typechecker] fix an issue with redeclaration checking

* [typechecker] use mapSignatureFunctionType in getOverloadSignatureType() to compute the type for the enum element decl, etc

* [typechecker] allow matching enums to functions as well, not just functions to enums

* [typechecker] fix the check for two enums

* [typechecker] check for nominal types as well when comparing enum elements

* [test] add more tests

* [typechecker] check for typealias as well
2019-03-20 00:25:42 -04:00
Xi Ge
0c923e0550 Merge pull request #23434 from nkcsgexi/add-wrapper-api-digester
utils: add a convenient python wrapper for swift-api-digester
2019-03-19 19:49:27 -07:00
swift-ci
d7cc984cb9 Merge pull request #23422 from davezarzycki/silence_silopt_warning 2019-03-19 18:27:27 -07:00
Xi Ge
6c0e0ee4f5 utils: add a convenient python wrapper for swift-api-digester
Based on the same concept of swift-api-dump, this python wrapper
provides framework authors a convenient way to generate baseline or
diagnose ABI/API breakages from an existing toolchain where it has
swift-api-digester installed.

cmake installation part will be added in a separate PR.

rdar://problem/29649661
2019-03-19 17:48:16 -07:00
Jordan Rose
1bec714519 [Serialization] Recover when a typealias can't be deserialized (#23419)
We already detected when a typealias /changed/ incompatibly; being
unable to deserialize it at all is just a very dramatic version of
that, right?

https://bugs.swift.org/browse/SR-9811
2019-03-19 16:45:57 -07:00
Rintaro Ishizaki
df473f641d [CodeCompletion] Escape declaration base name if needed
There should be escaped identifiers in code completion:
- As primary expression: Any keyword name except for `self` and `Self`.
- After dot: Something named `init`.

rdar://problem/16232627
2019-03-19 16:42:46 -07:00
eeckstein
5ff468ce41 Merge pull request #23401 from eeckstein/fix-cow-arrayopt
SILOptimier: Fix a miscompile in COWArrayOpt.
2019-03-19 15:59:30 -07:00
Andrew Trick
462df6cef3 Cleanup/fix the loop access summary in AccessEnforcementOpts.
Reuse AccessStorageAnalysis to summarize accesses.

Don't ignore call sites in loops.

Don't consider a read access in a loop to conflict with a read
outside.

Use the unidentified access flag from the analysis.

Remove extraneous code, some of which was unreachable.

General cleanup.
2019-03-19 15:29:59 -07:00
Suyash Srijan
a750f22f3a [test] update test formatting 2019-03-19 21:36:05 +00:00
Erik Eckstein
c2a8c71191 SILOptimier: Fix a miscompile in COWArrayOpt.
If a make_mutable operation is done conditionally in a loop, the hoisting of this operation can cause an over-release of the array buffer in some cases.

rdar://problem/48906146
2019-03-19 13:23:38 -07:00
Suyash Srijan
814d0abbf2 [typechecker] diagnose throw in defer the same way as other control flows 2019-03-19 19:54:33 +00:00
Arnold Schwaighofer
6b807d9cc4 Sema: Don't implicitly mark functions with a cdecl as dynamic
This does not work without more work.
2019-03-19 12:43:53 -07:00
Rintaro Ishizaki
de65d30ef3 Merge pull request #23410 from rintaro/ide-completion-case-rdar35943849
[CodeCompletion] 'case' keyword completion at the top of 'switch' stmt
2019-03-19 12:30:31 -07:00
Arnold Schwaighofer
d4088e9722 Merge pull request #23420 from aschwaighofer/defer_body_not_dynamic
Sema: Don't add dynamic to defer bodies
2019-03-19 11:35:19 -07:00
Xi Ge
0d830d6174 Merge pull request #23423 from nkcsgexi/rdar49026133
Temporarily disable several tests failing on CI
2019-03-19 11:27:08 -07:00