Commit Graph

13406 Commits

Author SHA1 Message Date
simon gladman
be81f917ee fix version numbers 2019-03-11 16:51:58 +00:00
simon gladman
5d63ddea51 Fix version numbers 2019-03-11 16:50:38 +00:00
simon gladman
6e502046c5 version number fix. 2019-03-11 16:47:24 +00:00
simon gladman
3cf79534b6 Accelerate vDSP Fill, Clear, and Generation Operations
A suite of Swift overlays to vDSP's fill, clear, window, and ramp generation operations.
2019-03-11 16:32:17 +00:00
simon gladman
6b2467337e Reorder parameters in comments. 2019-03-11 13:47:57 +00:00
simon gladman
f7360adac4 Swift Overlays to Accelerate.vDSP Integration Operations 2019-03-11 13:46:41 +00:00
USAMI Kosuke
aa9a0d4b16 Fix document : Numeric -> AdditiveArithmetic 2019-03-11 21:58:43 +09:00
Saleem Abdulrasool
14d771436c WinSDK: add some constants from CommCtrl
This exposes the common control window class name constants to the Swift
side enabling the use of these constants to create Windows.
2019-03-10 21:23:59 -07:00
Saleem Abdulrasool
0e7ff6582a WinSDK: add CW_USEDEFAULT to the SDK overlay 2019-03-10 18:34:24 -07:00
Simon Gladman
d840cd9a21 Code Review Fixes
* Correct copyright year from 2017 to 2019
* `towardsZero` -> `towardZero`
* `towardsNearestInteger` -> `towardNearestInteger`
2019-03-09 15:26:59 +00:00
Saleem Abdulrasool
2c5fe7dbd8 build: try to fix swift-reflection-test harder
Ensure that the symbol is marked for DLL import rather than just as a local.
2019-03-08 21:33:59 -08:00
swift-ci
70a0d4a5a1 Merge pull request #23182 from davezarzycki/latest_clang_build_fix 2019-03-08 11:02:18 -08:00
simon gladman
e9e9b4eac7 Fix availability check in tests. 2019-03-08 17:39:11 +00:00
David Zarzycki
b032d0b38f [Runtime] NFC: Move LLVM_ATTRIBUTE_USED from declaration to definition
This is both more correct and now required to keep building with
top-of-tree clang.
2019-03-08 12:35:53 -05:00
Saleem Abdulrasool
fbd456b84d SwiftRemoteMirror: repair the windows build
This symbol is meant to be exposed to users of the SwiftRemoteMirror
library which requires that it is explicitly marked with the appropriate
DLL storage on Windows.  This should repair the Windows build.
2019-03-08 07:59:21 -08:00
Saleem Abdulrasool
d4757d4b7a Merge pull request #22857 from compnerd/foreign-imports
IRGen: lazy initialize ForeignClassMetadata
2019-03-07 21:34:31 -08:00
Michael Gottesman
993347d132 Merge pull request #23176 from gottesmm/pr-ab2244e640285dbd76ecd7672e5cfe8338125021
[cmake] Do not generate the sib targets by default
2019-03-07 21:32:08 -08:00
Karoy Lorentey
5b9ab59515 [Foundation] NSSet, NSDictionary: Use as! casts to force-bridge elements
This traps with a clear runtime error on failure, rather than simply crashing in the runtime.
2019-03-07 19:57:13 -08:00
Michael Gottesman
cfbb97af79 [cmake] Add an option to enable/disable creation of "sib" stdlib targets and disable it by default.
These aren't really being used and generating these cause unnecessary configure
time in cmake.
2019-03-07 19:43:39 -08:00
Andrew Trick
404cf73ca6 Merge pull request #23111 from atrick/dominating-access-algo
Change the algorithm for the AccessEnforcementDom pass.
2019-03-07 16:51:18 -08:00
Saleem Abdulrasool
3f829c28d2 IRGen: lazy initialize ForeignClassMetadata
This is needed for Windows which does not support cross-module data
references without indirection.  By lazy initializing the data, we can
indirect through the IAT for the data pointer and fill in the parent
pointer.
2019-03-07 16:19:07 -08:00
Saleem Abdulrasool
68cb52a351 Merge pull request #23168 from compnerd/invalid-invalid
WinSDK: overwrite `INVALID_FILE_ATTRIBUTES`
2019-03-07 15:14:50 -08:00
swift-ci
74d1322a72 Merge pull request #23119 from ravikandhadai/array-init-semantics 2019-03-07 14:17:34 -08:00
Andrew Trick
3da2cc9e06 Clarify comments. 2019-03-07 13:48:41 -08:00
Mike Ash
c4434fe2a9 Merge pull request #23064 from mikeash/dynamically-select-is-swift-bit
[Runtime] Dynamically select the is-Swift bit at runtime on Apple platforms.
2019-03-07 16:48:15 -05:00
Saleem Abdulrasool
52054d2443 WinSDK: overwrite INVALID_FILE_ATTRIBUTES
`INVALID_FILE_ATTRIBUTES` is imported as a signed value which will
overflow the unsigned usage.  Explicitly create it in the SDK overlay.
2019-03-07 13:30:47 -08:00
Andrew Trick
f4c7d4611f Change the algorithm for the AccessEnforcementDom pass.
This adds a mostly flow-insensitive analysis that runs before the
dominator-based transformations. The analysis is simple and efficient
because it only needs to track data flow of currently in-scope
accesses. The original dominator tree walk remains simple, but it now
checks the flow insensitive analysis information to determine general
correctness. This is now correct in the presence of all kinds of nested
static and dynamic nested accesses, call sites, coroutines, etc.

This is a better compromise than:

(a) disabling the pass and taking a major performance loss.

(b) converting the pass itself to full-fledged data flow driven
optimization, which would be more optimal because it could remove
accesses when nesting is involved, but would be much more expensive
and complicated, and there's no indication that it's useful.

The new approach is also simpler than adding more complexity to
independently handle to each of many issues:

- Nested reads followed by a modify without a false conflict.
- Reads nested within a function call without a false conflict.
- Conflicts nested within a function call without dropping enforcement.
- Accesses within a generalized accessor.
- Conservative treatment of invalid storage locations.
- Conservative treatment of unknown apply callee.
- General analysis invalidation.

Some of these issues also needed to be considered in the
LoopDominatingAccess sub-pass. Rather than fix that sub-pass, I just
integrated it into the main pass. This is a simplification, is more
efficient, and also handles nested loops without creating more
redundant accesses. It is also generalized to:
- hoist non-uniquely identified accesses.
- Avoid unnecessarily promoting accesses inside the loop.

With this approach we can remove the scary warnings and caveats in the
comments.

While doing this I also took the opportunity to eliminate quadratic
behavior, make the domtree walk non-recursive, and eliminate cutoff
thresholds.

Note that simple nested dynamic reads to identical storage could very
easily be removed via separate logic, but it does not fit with the
dominator-based algorithm. For example, during the analysis phase, we
could simply mark the "fully nested" read scopes, then convert them to
[static] right after the analysis, removing them from the result
map. I didn't do this because I don't know if it happens in practice.
2019-03-07 12:39:53 -08:00
Mike Ash
fbe990481b [Runtime] Dynamically select the is-Swift bit at runtime on Apple platforms.
Recent Swift uses 2 as the is-Swift bit when running on newer versions, and 1 on older versions. Since it's difficult or impossible to know what we'll be running on at build time, make the selection at runtime.
2019-03-07 10:12:27 -05:00
simon gladman
df1d85f6df [Accelerate] [vDSP] Large Vector Type Conversion Operations
This PR contains a suite of overlays to the vDSP conversion functions.
2019-03-07 13:53:14 +00:00
Erik Eckstein
0dd2495815 runtime: bail in createBoundGenericType if the number of generic parameters and arguments don't match.
This can happen if _typeByName() is called with an invalid mangled type name.
2019-03-06 14:37:03 -08:00
Erik Eckstein
d7fd45d74a Remangler: Use a bump-pointer allocated string instead of std::string
Done by replacing DemanglerPrinter with a bump-pointer allocated CharVector buffer.
This avoids malloc calls.

SR-10028
rdar://problem/48575729
2019-03-06 14:37:03 -08:00
Erik Eckstein
a60086f1dd Runtime: use lambdas to avoid allocations in std::function
Instead of capturing SubstGenericParametersFromMetadata and SubstGenericParametersFromWrittenArgs by value, capture by reference.
This avoids those instances to be copied and thus avoids a lot of mallocs.

SR-10028
rdar://problem/48575729
2019-03-06 14:37:03 -08:00
Erik Eckstein
3bd7f027f8 Runtime: use SmallVector instead of std::vector to avoid memory allocations in most cases.
This dramatically reduces the number of needed malloc calls.
Unfortunately I had to add the implementation of SmallVectorBase::grow_pod to the runtime, as we don't link LLVM. This is a bad hack, but better than re-inventing a new SmallVector implementation.

SR-10028
rdar://problem/48575729
2019-03-06 14:37:03 -08:00
David Smith
909868fd67 Merge pull request #21845 from numist/numist/diffing
Ordered Collection Diffing
2019-03-05 23:08:03 -08:00
Ravi Kandhadai
6c662f7a6c [stdlib][Semantics annotation] Add ".empty" suffix to the semantics attribute of
array.init() and add semantics annotation to the compiler-intrinsic:
Array._allocateUninitializedArray
2019-03-05 17:09:34 -08:00
Max Moiseev
041eda1f27 Merge pull request #23105 from moiseev/max-datagram-size-abi
Add availability annotations to NWConnection.maximumDatagramSize
2019-03-05 15:04:41 -08:00
Maxim Moiseev
52c6e03c44 Add availability annotations to NWConnection.maximumDatagramSize
Since it did not exist pre-ABI.
<rdar://problem/48314607>
2019-03-05 10:55:14 -08:00
Scott Perry
fcf6550506 Merge branch 'master' into numist/diffing 2019-03-04 21:29:12 -08:00
Patrick Pijnappel
24282df850 [stdlib] Fix typo in comment 2019-03-05 12:05:00 +11:00
Saleem Abdulrasool
618d525b91 runtime: enable stack traces on Windows
We would not previously symbolicate the stack trace and as a result
would not display the stack trace.  Add symbolication support to the
runtime to actually make use of the captured stack trace.  This allows
us to get a stack trace when the standard library or swift code reports
a fatal error.
2019-03-04 10:39:10 -08:00
Michael Ilseman
dc89cc06e6 Merge pull request #23026 from milseman/client_helper_emitted
[stdlib] Some cleanup enabled by _alwaysEmitIntoClient.
2019-03-04 07:40:17 -08:00
Michael Ilseman
19014a85af [stdlib] Some cleanup enabled by _alwaysEmitIntoClient.
Refactor some copy-pasted code into a helper computed variable and
outline some cold paths.
2019-03-03 14:10:01 -08:00
Saleem Abdulrasool
a19a62351d Merge pull request #23029 from compnerd/list-the-ways-that-everything-is-terrible
stdlib: use the correct va_list type on Windows
2019-03-01 21:22:41 -08:00
Saleem Abdulrasool
08cf801152 Merge pull request #23030 from compnerd/this-shall-be-part-of-my-legacy
stdlib: link against legacy_stdio_definitions on Windows
2019-03-01 21:22:12 -08:00
Saleem Abdulrasool
3f849d45db Merge pull request #23011 from compnerd/file-the-line-with-the-registry
Windows test accomodations
2019-03-01 15:01:39 -08:00
Saleem Abdulrasool
c826deadb4 stdlib: link against legacy_stdio_definitions on Windows
Because Microsoft inlines the definitions of the printf family of
functions, we end up with undefined references to them.  Add an explicit
request to link against the `legacy_stdio_definitions` library when
`ucrt.C.stdio` is used which provides out-of-line definitions for them.
This fixes the building of the `stdlib/VarArgs' test.
2019-03-01 14:50:46 -08:00
Saleem Abdulrasool
75e31751ba stdlib: use the correct va_list type on Windows
Windows uses `char *` for the `va_list` type even on x86_64.  Restore
the correct selection of `__VaListBuilder` for Windows x86_64.  This
partially fixes variadic functions.
2019-03-01 14:25:26 -08:00
Saleem Abdulrasool
45fa39c855 Merge pull request #23001 from compnerd/shims
SwiftShims: update shims copying logic
2019-03-01 11:03:35 -08:00
Saleem Abdulrasool
6da949dda7 stdlib: address a compiler warning
Explicit template specialization may not have a storage class.  Remove
the extraneous storage class.
2019-02-28 23:56:12 -08:00
Saleem Abdulrasool
a227273ff4 stdlib: correct floating point parsing behaviour
These are supposed to be processed in the C locale always, irrespective
of the current locale.  We were not doing this and so we would parse the
value incorrectly.
2019-02-28 23:56:12 -08:00