Commit Graph

13406 Commits

Author SHA1 Message Date
Mike Ash
c09adf0394 Add caching based on ABI name to _findContextDescriptor.
This is a one-to-many cache that's more speculative than the cache mapping mangled names to context descriptors. Entries found in the cache need to be verified for a match before they can be returned. However, this allows scanning conformance records up front and building up the cache in one scan rather than performing an expensive scan of all conformance records every time the mangled name cache misses.

rdar://problem/53560010
2019-08-09 11:18:43 -07:00
Joe Groff
625a7c7f1f Merge pull request #26476 from Azoy/fix-tuple-metadata-crash
[Runtime] Fix crash on tuple metadata dump
2019-08-08 18:16:57 -07:00
Scott Perry
6c992d91b2 Return nil on applying() failure instead of crashing (rdar://problem/53663769) 2019-08-08 16:50:13 -07:00
Ben Langmuir
327c666b8a Revert "[CMake][NFC] Introduce component targets for proper dependency tracking" 2019-08-08 16:35:59 -07:00
swift-ci
fd0626216c Merge pull request #25118 from xiaobai/cmake_component_targets 2019-08-08 14:06:49 -07:00
Karoy Lorentey
178e755733 Merge pull request #26549 from lorentey/unified-yields
[stdlib] Unify _NativeDictionary.subscript._modify’s two yields to work around SR-10604
2019-08-08 12:55:14 -07:00
Alex Langford
50a0e87c69 [CMake][NFC] Introduce component targets for proper dependency tracking
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.

This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.
2019-08-08 11:50:35 -07:00
Alexander Shaposhnikov
791ca54397 Add .note.swift_reflection_metadata 2019-08-08 01:02:46 -07:00
Karoy Lorentey
d7e57347ee [stdlib] Unify _NativeDictionary.subscript._modify’s two yields to work around SR-10604 2019-08-07 17:15:04 -07:00
David Smith
5a1f068415 Remove dead shim code 2019-08-07 16:50:47 -07:00
swift-ci
b2d83d4c99 Merge pull request #26422 from Catfish-Man/its-about-sending-a-message 2019-08-07 15:57:00 -07:00
David Smith
d0ed51925b Review comments and subsequent build fix on https://github.com/apple/swift/pull/26422 2019-08-07 13:42:51 -07:00
Michael Munday
bb2740e540 IRGen: fix enum bit packing on big-endian platforms.
This change modifies spare bit masks so that they are arranged in
the byte order of the target platform. It also modifies and
consolidates the code that gathers and scatters bits into enum
values.

All enum-related validation tests are now passing on IBM Z (s390x)
which is a big-endian platform.
2019-08-07 03:54:16 -04:00
Doug Gregor
8340e0b745 Merge pull request #26509 from DougGregor/runtime-protocol-extension-fail-fast-search
[Runtime] Short-circuit search for context descriptor for protocol extensions
2019-08-06 15:26:49 -07:00
Stephen Canon
fb2128b33b Remove doc comments from concrete floating-point types (#26399)
* Remove doc comments from concrete floating-point types

... when they are already present on the protocol. I don't *think* that we need them anymore for xcode documentation purposes. There are reasonable arguments both ways on this:
1. when you're editing the concrete implementations, it's sometimes nice to have the doc comment right there.
2. but it needlessly repetitive, and introduces the opportunity for comments to get out of sync.
3. it also adds noise; it would be nice for information density if the implementation only had implementation notes.

* Add examples to documentation for FloatingPoint.isCanonical

In particular, document that subnormal encodings are treated as non-canonical zeros on platforms that flush to zero.

* Additional fixes by @xwu and @natecook1000 .
2019-08-06 18:17:37 -04:00
Mike Ash
9fd03e24ad [Runtime] Avoid function pointer indirection in refcounting functions.
Functions like swift_retain call through a function pointer so that Instruments can interpose. This slows down the common case where there is no interposition. Instead, initialize the function pointers to NULL and call through directly to the real implementation when it's NULL. The compiler is smart enough to inline this call and the result is a single conditional branch rather than a function pointer call.

rdar://problem/18307425
2019-08-06 14:29:51 -04:00
Doug Gregor
17b917fef9 [Runtime] Short-circuit search for context descriptor for protocol extensions
When looking for a context descriptor for a protocol extension, we
search based on the mangled name--"x", a generic type parameter with
depth and index 0--and are guaranteed to fail because there is no such
concrete type. However, _findContextDescriptor will fail very slowly,
spinning through all of the types and conformances in all of the
loaded images. Moreover, negative results aren't cached, so this can
happen repeatedly.

Short-circuit _findContextDescriptor when it receives a dependent
generic type parameter type, avoiding the expensive search when it
will find nothing.

Potential fix for rdar://problem/53560010.
2019-08-05 22:05:53 -07:00
Daniel Rodríguez Troitiño
7e332e4437 Merge pull request #23208 from buttaface/droid
[android] Add support for natively building on Android
2019-08-05 08:39:40 -07:00
Azoy
ab5ef84046 Fix crash on tuple metadata dump 2019-08-03 01:27:44 -04:00
David Smith
0887299d9e Fix sub-scalar index distances in foreign UTF8 views 2019-08-02 16:45:42 -07:00
Alex Langford
184d942ba0 [CMake] add_swift_target_library shouldn't implicitly set INSTALL_IN_TARGET
This makes it more explicit what the install component of a target
library is if you don't see one (and its marked as IS_SDK_OVERLAY).
Explicit in this case makes more sense, as you don't have to rely on
knowledge of how `add_swift_target_library` is implemented to understand
what component is used to install the target.
2019-08-02 13:51:52 -07:00
swift-ci
749d4b018d Merge pull request #26442 from alexshap/fix_glibc 2019-08-02 10:32:07 -07:00
David Smith
c5fc715746 Reimplement the CF stub system using ObjC. The primary effect of this is to break the link-time dependency on the CF symbols, but it also improves performance a bit.
One additional tweak (setting the scalar-aligned bit on foreign indices) had to be made to avoid a performance regression for long non-ASCII foreign strings.
2019-08-01 19:56:45 -07:00
swift-ci
e6ae7867bf Merge pull request #26441 from alexshap/linux_compile_flags 2019-08-01 18:46:57 -07:00
swift-ci
d5d4ac672b Merge pull request #26338 from xiaobai/debride-option 2019-08-01 18:42:33 -07:00
Alexander Shaposhnikov
4a66d9f55f [Glibc] Add missing entry for link.h 2019-07-31 16:35:09 -07:00
Alexander Shaposhnikov
6febe07dec Introduce SWIFT_COMPILE_FLAGS_LINUX 2019-07-31 16:28:04 -07:00
JF Bastien
31e6a989f5 [NFC] Don't use LLVM_ALIGNAS (#26411)
It's not useful anymore, and I'm about to remove it in upstream.
2019-07-30 13:14:02 -07:00
Karoy Lorentey
a25e53468e [gardening] Delete StringGutsVisitor.swift (#26393) 2019-07-29 19:08:46 -07:00
Butta
796d6ade9a [android] Add support for natively building on Android
Check if building on Android through the ANDROID_DATA environment variable, then set
SWIFT_ANDROID_NATIVE_SYSROOT to the default layout for the Termux app, and key all the
include, lib, and other SDK paths off of that. The system libc and a few other libraries
are linked against from /system/lib[64]. Finally, check if lit is running natively on
Android and don't use adb if so.
2019-07-30 00:38:36 +05:30
Steve (Numerics) Canon
0fb8510da3 Replace @_fixed_layout with @frozen in private/OSLog
This one slipped through when the main search and replace pass happened,
becausee it's not in public.
2019-07-29 13:48:35 -04:00
Xiaodi Wu
a078c33ceb [stdlib] Change documented behavior of FloatingPoint.significand (#26390) 2019-07-29 11:08:04 -04:00
Karoy Lorentey
62c1cf31d2 Merge pull request #26022 from anandabits/Identifiable
Add Identifiable protocol to the standard library
2019-07-26 17:38:26 -07:00
David Smith
e7b1107212 Merge pull request #26374 from Catfish-Man/unindex-set
Remove unused Foundation subclasses
2019-07-26 17:09:45 -07:00
David Smith
48266a6f56 Remove unused Foundation subclasses 2019-07-26 14:47:43 -07:00
Ross Bayer
28e90d6f8f [Build System: CMake] Include the stdlib/toolchain directory before the stdlib/public directory, otherwise the clang resource directory symlink is not installed correctly. 2019-07-25 16:05:36 -07:00
swift-ci
f34ef5db85 Merge pull request #24356 from zetasq/zetasq-fix-KVO 2019-07-25 15:14:18 -07:00
Alex Langford
a16c71cc86 [CMake] Remove TARGET_LIBRARY option from add_swift_target_library
If you're calling add_swift_target_library, you already know it's a
target library.
2019-07-24 14:55:08 -07:00
Saleem Abdulrasool
f26048df0e Merge pull request #26210 from compnerd/dynamic-only
stdlib: prevent static builds on Darwin
2019-07-23 19:22:54 -07:00
Saleem Abdulrasool
de2dc570dc Merge pull request #26295 from Lukasa/cb-crash-on-invalid-random-buffer-size
Avoid uninitialized "random" bytes on Windows.
2019-07-23 19:17:33 -07:00
Ross Bayer
3257761ae0 [Build System: CMake] Move the CompatibilityDynamicReplacements library into the stdlib/toolchain source directory. 2019-07-23 15:34:17 -07:00
Ross Bayer
1a8dff82be [Build System: CMake] Move the Compatibility50 library into the stdlib/toolchain source directory. 2019-07-23 15:34:17 -07:00
Ross Bayer
6d0450a688 [Build System: CMake] Move the legacy_layouts content into stdlib/toolchain, a new directory of content that is installed only in the toolchain. 2019-07-23 14:15:36 -07:00
Cory Benfield
c2b6c8aa16 Avoid uninitialized "random" bytes on Windows.
__swift_size_t on Windows is a size_t, which makes it potentially a
64-bit integer. ULONG, however, is always a 32-bit integer, and so this
cast risks shrinking the apparent size of the cbBuffer argument to
BCryptGenRandom. The effect of that will be to underfill the buffer,
leaving it full of uninitialized memory that we would treat as random.

The actual risk from this in the current implementation is basically
zero, as user code can only ever invoke this with an argument size of 8.
There's no good reason to leave this sharp edge on the API though.
2019-07-23 17:50:34 +01:00
Saleem Abdulrasool
9fb525006c stdlib: prevent static builds on Darwin
Static builds of the standard library and the SDK overlay are
unsupported post ABI stability.  Disallow building of the standard
library and SDK overlay statically for Darwin platforms.
2019-07-19 08:05:57 -07:00
Paul Hudson
06f82a53b5 Replaced the majority of ' : ' with ': '. 2019-07-18 20:46:07 +01:00
eeckstein
63a1a42643 Merge pull request #26185 from eeckstein/old-condfail
Support the old single-parameter Builtin.condfail
2019-07-18 13:38:47 +02:00
swift-ci
70d4630690 Merge pull request #26194 from Catfish-Man/if-it-quacks-like-a-key 2019-07-17 20:39:55 -07:00
David Smith
5e83f80d6f Let NSMutableDictionary check for -copy on keys, rather than doing it ourselves with a full (slow) conformance check 2019-07-17 15:50:03 -07:00
Michael Gottesman
eb9b24104e Merge pull request #26158 from gottesmm/pr-ed0fb2c51d1ce701156c957f511f6ee3b57f1e7a
[ast] Refactor Builtin printing logic from ASTPrinter -> BuiltinInst.
2019-07-17 11:24:56 -07:00