Commit Graph

13406 Commits

Author SHA1 Message Date
David Smith
1cce12f20c Add an Array-based NSMutableArray subclass 2019-09-24 18:15:33 -07:00
David Smith
698bcade38 Merge pull request #27266 from Catfish-Man/the-deep-blue-c
Add C calling convention shims for creating arrays and strings from buffers
2019-09-24 17:46:02 -07:00
David Smith
90037745ad Add C calling convention shims for creating arrays and strings from buffers 2019-09-24 13:06:54 -07:00
Joe Groff
83b34ab8d3 Merge pull request #27306 from jckarter/remove-reflection-offsets
Reflection: Remove vestigial Offset fields from ReflectionInfo
2019-09-24 10:04:20 -07:00
Joe Groff
bc3795eb53 Reflection: Remove vestigial Offset fields from ReflectionInfo
These are now always zero, because memory readers handle virtual address mapping.
The `swift_reflection_info_t` structure used by the C RemoteMirror API keeps
its offset fields because it's supposed to be a stable API, but we now assert that
the values are always zero.
2019-09-23 14:32:26 -07:00
swift-ci
3d35249f89 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-20 20:23:34 -07:00
Saleem Abdulrasool
64ed0a4077 stdlib: silence a unused function warning (NFC)
Pre-process away the unused function on Darwin.  NFC.
2019-09-20 17:34:17 -07:00
Jonas Devlieghere
61d2efc822 [Compatibility50] Include dlfcn.h 2019-09-18 19:30:03 -07:00
Ravi Kandhadai
61fd4b1431 [OSLog][Test] Update the new oslog overlay implementation to use
@_semantics("constant_evaluable") annotation to denote constant
evaluable functions.

Add a test suite that uses the sil-opt pass ConstantEvaluableSubsetChecker.cpp
to check the constant evaluability of function in the OSLog
overlay.
2019-09-18 10:44:48 -07:00
Saleem Abdulrasool
c4f448578e Revert "runtime: add a workaround for Windows build"
This reverts commit efaf1fbefa.
Add a much more palatable workaround for the unit tests.  Rather than
adding the dllimport for the symbols, locally define the required
symbols.  This list is sufficient to restore the ability to build tests
for Windows.
2019-09-16 15:31:01 -07:00
Saleem Abdulrasool
efaf1fbefa runtime: add a workaround for Windows build
The runtime tests will statically link the runtime and dynamically link
to the standard library.  This fails to build on Windows.  This is a
horrible workaround for the time being.
2019-09-16 09:20:49 -07:00
Joe Groff
4c3f044a46 Merge pull request #27185 from jckarter/fast-path-short-mangling-lookups
Runtime: Fast path lookup for short manglings.
2019-09-14 07:34:33 -07:00
Joe Groff
78ed70cbb8 Runtime: Fast path lookup for short manglings.
Mangling these common types takes only two bytes, which is shorter than a symbolic reference. We
know where their metadata is in the standard library, too, so we don't need to search the lookup
tables for them.
2019-09-13 18:40:25 -07:00
Joe Groff
413100be33 Merge pull request #27181 from jckarter/demangler-symbolic-reference-api-refactor
Demangler: Make symbolic reference resolver part of `demangle(Symbol|Type)` calls.
2019-09-13 18:12:04 -07:00
Joe Groff
f1e84994ed Demangler: Make symbolic reference resolver part of demangle(Symbol|Type) calls.
This makes for a cleaner and less implicit-context-heavy API, and makes it easier for symbolic
reference resolvers to do context-dependent things (like map the in-memory base address back to a
remote address in MetadataReader).
2019-09-13 15:47:08 -07:00
David Smith
b8fb2e5eae Merge pull request #27155 from Catfish-Man/shim-shim-sher-ee-2
Remove stdlib and runtime dependencies on Foundation and CF
2019-09-13 09:43:38 -07:00
Doug Gregor
5285afdbe6 [SIMD] Use @_alwaysEmitIntoClient rather than @_transparent 2019-09-12 21:31:36 -07:00
David Smith
1efa946caf Remove stdlib and runtime dependencies on Foundation and CF 2019-09-12 18:03:14 -07:00
Doug Gregor
87516934cd [SIMD] Add disambiguating += and -= operators.
The introduction of += and -= default implementations on
AdditiveArithmetic introduces an ambiguity with the += and -=
implementations on SIMD (where Scalar: FloatingPoint). Break the
ambiguity by adding another set of definitions of += and -= on
AdditiveArithmetic & SIMD where Self.Scalar: FloatingPoint.

Fixes rdar://problem/55278156.
2019-09-12 17:54:46 -07:00
Karoy Lorentey
2411be9586 Merge pull request #27115 from lorentey/identification-friend-or-foe
[doc] Avoid the use of "iff" in public API documentation
2019-09-11 12:23:23 -07:00
Joe Groff
74d47f4f42 Merge pull request #27068 from jckarter/compatibility-hook-high-bit
Compatibility50: Fix for high-bit characters.
2019-09-11 10:38:59 -07:00
Nate Cook
06102a9ffa Minor additional revisions 2019-09-11 10:09:55 -05:00
Karoy Lorentey
9638e9167c [doc] ManagedBuffer: Fix cross-reference to isKnownUniquelyReferenced 2019-09-10 18:52:26 -07:00
Karoy Lorentey
6bc4c85005 [doc] Avoid use of “iff” in public API documentation 2019-09-10 18:52:01 -07:00
Nate Cook
ce28cdee93 Update the error message when subscripting String with Int. (#27069)
Instead of referring to a doc comment that isn't really accessible to the
developer, let's be accurate about what type they should be using here.
2019-09-10 12:23:09 -05:00
swift-ci
656fe89752 Merge pull request #26936 from mikeash/null-was-a-mistake 2019-09-09 10:27:17 -07:00
Mike Ash
5decec24e7 [Runtime] Fix gatherWrittenGenericArgs crashing when description is NULL.
rdar://problem/54775582
SR-11374
2019-09-09 10:58:22 -04:00
Joe Groff
427ed9c79d Compatibility50: Fix for high-bit characters. 2019-09-06 18:19:19 -04:00
ravikandhadai
d1c5663958 Merge pull request #26863 from ravikandhadai/oslog-strings
[oslog][stdlib-private] Add support for interpolating strings in the new os_log APIs.
2019-09-05 19:31:30 -07:00
Joe Groff
624ad4fcb0 Compatibility50: Backport objc_getClass hook patch.
We don't want older runtimes trying to chase rogue symbolic references through objc_getClass
either. rdar://problem/55036306
2019-09-05 10:46:15 -07:00
Saleem Abdulrasool
f1690b09f5 Merge pull request #26915 from xiaobai/depend-on-clang-headers
[CMake] Correct dependencies for clang headers components
2019-09-04 11:16:45 -07:00
Alex Langford
d57c841445 [CMake] Correct dependencies for clang headers components
When building swift as a part of LLVM (as opposed to standalone) the components
related to swift headers should explicitly depend on the clang target to produce
those. On LLVM 9 and up, that would be `clang-resource-headers` and on lower
versions it would be `clang-headers`. It is important that we check for
`clang-resource-headers` first because `clang-headers` refers to something
different in LLVM 9 and up.
2019-09-03 09:15:38 -07:00
Ravi Kandhadai
03c6365671 [oslog][stdlib-private] Add support for interpolating strings
in the new os_log APIs.
2019-08-30 17:04:39 -07:00
ravikandhadai
dcd0893efe Merge pull request #26815 from ravikandhadai/oslog-integer-types
[oslog][stdlib-private] Refactor and generalize interpolation of Int type in the new os_log APIs so as to extend to other integer types.
2019-08-30 16:22:18 -07:00
swift-ci
b8f42d6165 Merge pull request #26466 from nvzqz/is_concrete_builtin 2019-08-28 19:10:37 -07:00
Michael Ilseman
d30ec5ba79 Merge pull request #26884 from milseman/cache_alignment
[test] Disable misaligned indices test prior to 5.1
2019-08-28 14:23:11 -07:00
Joe Groff
5354f9f921 Merge pull request #26911 from jckarter/objc_getClass-untrusted-demangler
Runtime: Hook the ObjC runtime with an untrusted demangler.
2019-08-28 14:22:01 -07:00
swift-ci
7039277e4d Merge pull request #26906 from amartini51/master 2019-08-28 13:44:31 -07:00
swift-ci
f804efd5af Merge pull request #25430 from natecook1000/nc-prefixwhile-degyb 2019-08-28 13:21:05 -07:00
Joe Groff
a49e0d5a2e Runtime: Hook the ObjC runtime with an untrusted demangler.
We don't want objc_getClass and NSClassFromString to be able to feed arbitrary symbolic reference
pointers into the Swift runtime. Fixes rdar://problem/54724618.
2019-08-28 11:56:45 -07:00
Nate Cook
55f9be3291 Switch "may" to "might" per comments from @amartini51. 2019-08-28 13:37:00 -05:00
Alex Martini
64c32f3331 Add missing ) and code voice.
rdar://problem/46680213
2019-08-28 10:36:34 -07:00
Mike Ash
9e61d532ed Merge pull request #26516 from mikeash/retain-release-avoid-function-pointer-indirection
[Runtime] Avoid function pointer indirection in refcounting functions.
2019-08-28 10:37:34 -04:00
Michael Gottesman
447f00892a [ownership] Enable ownership lowering on overlays. I still need to flip the switch to enable this on the tests/rest of the world. 2019-08-27 18:26:15 -07:00
Nikolai Vazquez
6e542bf22a Annotate Swift._isConcrete with @_transparent
Returns `false` otherwise in Debug builds because it is generic.
2019-08-27 16:51:09 -07:00
Nikolai Vazquez
890409effd Elaborate in docs for Swift._isConcrete 2019-08-27 16:51:09 -07:00
Nikolai Vazquez
ba0612f2e9 Add Builtin.isConcrete<T>(T.Type) -> Int1
Returns `true` if `T.Type` is known to refer to a concrete type. The
implementation allows for the optimizer to specialize this at -O and
eliminate conditional code.

Includes `Swift._isConcrete<T>(T.Type) -> Bool` wrapper function.
2019-08-27 16:51:09 -07:00
Michael Ilseman
774788ac18 [test] Disable misaligned indices test prior to 5.1
Misaligned indices were fixed in 5.1, but we should disable the test
when testing back deployment.

Adds a shared helper to StdlibUnittest for the run time check.
2019-08-27 15:13:38 -07:00
Karoy Lorentey
9a663b6ae3 Merge pull request #26853 from rudedogg/master
[AppKit] Fix incorrect rawValue for NSEvent.SpecialKey.deleteForward
2019-08-27 13:55:12 -07:00
Karoy Lorentey
895f13657f Merge pull request #26760 from lorentey/♪-hold-me-use-me-autorelease-me-♬
[stdlib] AutoreleasingUnsafeMutablePointer: eliminate questionable pointer use
2019-08-27 10:22:04 -07:00