Commit Graph

7767 Commits

Author SHA1 Message Date
Max Moiseev
187aa923ff Fixing heterogeneous <, failable init from other ints, and init from floats 2017-03-10 17:09:15 -08:00
Joe Groff
a16daf1312 Merge pull request #8020 from jckarter/open-existential-helper
Sema: Add a stdlib-internal _openExistential helper.
2017-03-10 14:06:02 -08:00
ktopley-apple
56081a24c3 Add support for UnsafeRawBufferPointer to DispatchData (#8004)
* Add support for UnsafeRawBufferPointer to DispatchData

(Radar 28503167)

* Review comments.
2017-03-10 13:59:44 -08:00
Joe Groff
eb40d4303b Sema: Add a stdlib-internal _openExistential helper.
Leverage the "special type-checking semantics" hack to pass an opened existential down to an arbitrary subexpression. Please don't use this.
2017-03-10 13:41:00 -08:00
eeckstein
3db4630dfe Merge pull request #8013 from eeckstein/demangler-cmake
libraries: instead of including all demangler sources into a single C++ source file,
2017-03-10 08:27:25 -08:00
Erik Eckstein
b398098dcb libraries: instead of including all demangler sources into a single C++ source file, list them in the cmake file 2017-03-09 19:56:40 -08:00
Arnold Schwaighofer
49b3377101 Pass down the SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS flag to the runtime build. 2017-03-09 17:22:35 -08:00
eeckstein
cc6045b45a Merge pull request #8006 from eeckstein/demangle-lib
demangler: put the demangler into a separate library
2017-03-09 16:40:35 -08:00
Philippe Hausler
ce3ccfbd9b Change shims to always be counted as system headers via -isystem instead of conditionally marking them in debug versus non debug builds. (#7979) 2017-03-09 16:09:16 -08:00
Erik Eckstein
5e80555c9b demangler: put the demangler into a separate library
Previously it was part of swiftBasic.

The demangler library does not depend on llvm (except some header-only utilities like StringRef). Putting it into its own library makes sure that no llvm stuff will be linked into clients which use the demangler library.

This change also contains other refactoring, like moving demangler code into different files. This makes it easier to remove the old demangler from the runtime library when we switch to the new symbol mangling.

Also in this commit: remove some unused API functions from the demangler Context.

fixes rdar://problem/30503344
2017-03-09 13:42:43 -08:00
Erik Eckstein
002beb8e4f runtime: don’t use the old demangler for demangling ObjC class+protocol names.
Instead use  the new Demangler:: demangleObjCTypeName function
2017-03-09 13:05:15 -08:00
Brian King
29c1fc472b Generate an error message on protocol extensions with the final attribute. 2017-03-09 14:18:39 -05:00
Hugh Bellamy
78d51559dd Merge pull request #7765 from hughbe/runtime-asm
Cleanup uses of __asm__ in the runtime
2017-03-10 01:04:28 +07:00
Joe Groff
294913e114 Fix _stdlib_getErrorDefaultUserInfo to have the signature the runtime expects.
The ABI mismatch here would cause a crash in cases when the Foundation overlay wasn't available, or its implementation of swift_Foundation_getErrorDefaultUserInfo wasn't dynamically resolvable, such as in a stripped statically linked binary. Fixes rdar://problem/29173132.
2017-03-08 14:56:02 -08:00
Joe Groff
0ec27bdecf Runtime: Bridging an Error to NSError requires only checking its domain.
The lazy population of the NSError fields is ordered such that the domain is written into the object last with acq/rel ordering, so another thread only needs to check the domain to see whether the initialization has already happened. (The initialization itself is idempotent, so we can optimistically perform the initialization and discard the results if we race.) Checking the user info is redundant, and is also wrong for real NSError objects, since [NSError errorWithDomain:d code:c userInfo:nil] will in fact plant nil in the userInfo field of the object, leading us to attempt to bridge an already-native NSError.
2017-03-08 13:10:23 -08:00
Hugh Bellamy
4d45092c34 Cleanup uses of __asm__ in the runtime 2017-03-08 17:32:44 +07:00
Hugh Bellamy
329d437933 Fix Visual Studio squigglies/code-completion in GlobalObjects.cpp 2017-03-08 15:17:19 +07:00
swift-ci
6a0a199247 Merge pull request #7777 from gonzalolarralde/master 2017-03-07 21:23:23 -08:00
Max Moiseev
f4c7e0464b Merge remote-tracking branch 'origin/new-integer-protocols' into new-integer-protocols 2017-03-07 16:42:07 -08:00
Max Moiseev
835b8809d2 Merge branch 'master' into new-integer-protocols 2017-03-07 16:18:54 -08:00
practicalswift
95e74d54ad [gardening] Fix includes 2017-03-07 16:44:53 +01:00
Gonzalo Larralde
443e7614e4 Fixes on linker executable variables per target.
* `prefix` should be `sdk` in runtime cmake list file
* typo on variable existence checking
2017-03-07 10:00:58 -03:00
Ben Cohen
d07ba914b8 Merge pull request #7419 from therealbnut/therealbnut-fix-compile-time-warning
Fix swift build warning - 'default will never be executed'
2017-03-06 20:09:44 -08:00
swift-ci
8741d12001 Merge pull request #7900 from phausler/silgen_removal 2017-03-06 13:32:34 -08:00
Maxim Moiseev
98e6cafdc8 [stdlib] Adding a deprecated version of flatMap to warn misuses. (#7823)
Due to implicit promotion to optional it is possible to call flatMap
with a closure, that does not return an optional. This way the code
works, but is unnecessary inefficient. Such uses of flatMap can and
should be replaced with map.
2017-03-06 10:16:42 -08:00
Philippe Hausler
dc783c064c [Foundation] Remove @_silgen thunks and replace them with shims instead
This avoids indirection by making calls directly to the C implementations which prevents potentials of mismatched intent or changes of calling convention of @_silgen. The added benefit is that all of the shims in this case are no longer visible symbols (anyone using them was not authorized out side of the Foundation overlay). Also the callout methods in the headers now all share similar naming shcemes for easier refactoring and searching in the style of __NS<class><action> style. The previous compiled C/Objective-C source files were built with MRR the new headers MUST be ARC by Swift import rules.

The one caveat is that certain functions MUST avoid the bridge case (since they are part of the bridging code-paths and that would incur a recursive potential) which have the types erased up to NSObject * via the macro NS_NON_BRIDGED.

The remaining @_silgen declarations are either swift functions exposed externally to the rest of Swift’s runtime or are included in NSNumber.gyb which the Foundation team has other plans for removing those @_silgen functions at a later date and Data.swift has one external function left with @_silgen which is blocked by a bug in the compiler which seems to improperly import that particular method as an inline c function.
2017-03-06 09:59:37 -08:00
Gonzalo Larralde
85f3fd1ebf [SR-4166] Change on how __mode__ attribute presence is checked to fix compilation issue. 2017-03-05 21:23:39 -03:00
Dave Abrahams
7af65d9e09 Merge pull request #7870 from stephentyrone/FloatingPoint-Hashable
FloatingPoint should imply Hashable. 

 `Hashable` is related to `Equatable`, and `FloatingPoint` is `Equatable`, with enough additional constraints that `Hashable` conformance is practical.  

There's *almost* no excuse for any `Equatable` thing not to also be `Hashable`; the exception is when the underlying representation may be denormalized in some way that makes it impossible or expensive to normalize (e.g. `Set`).  Floating point numbers have denormalized forms, so this comes down to the cost of normalization.  Since we can't imagine a representation whose normalization is much more expensive than the subsequent hashing step, the conformance belongs.
2017-03-05 08:12:29 -08:00
Bob Wilson
2c44ad4ad1 Merge pull request #7469 from bob-wilson/disable-checks-macro
Replace a cmake option with a preprocessor macro.
2017-03-03 07:48:00 -08:00
Argyrios Kyrtzidis
9f62e5584f Fix -Wformat-pedantic warning. 2017-03-02 21:58:05 -08:00
Argyrios Kyrtzidis
6038e2d12e Fix -Wextra-semi warnings. 2017-03-02 21:56:40 -08:00
Hugh Bellamy
f7bac5dc6d Remove unecessary empty asm statement 2017-03-03 09:48:12 +07:00
swift-ci
d15f09c002 Merge pull request #7867 from hughbe/metadata 2017-03-02 06:27:32 -08:00
Hugh Bellamy
8d40749f6a Misc fixes to the runtime for MSVC compatability with it's public headers 2017-03-02 19:47:24 +07:00
Hugh Bellamy
bb34e2a959 Fix attribute fallout from new refcount representation 2017-03-02 19:44:37 +07:00
Stephen Canon
0130407e21 Make FloatingPoint imply Hashable. SR-4132. 2017-03-01 20:39:11 -05:00
Nate Cook
fa0ec5d18f [docs] Update replaceRange to replaceSubrange 2017-03-02 09:00:58 +09:00
Nate Cook
888f504d50 [docs] Fix gybbo in UnsafeRawBufferPointer docs 2017-03-01 14:30:51 +09:00
practicalswift
57fa66e9fe [gardening] Fix inconsistent headers 2017-02-28 17:15:39 +01:00
practicalswift
bf50a9ad4a [gardening] Fix double spaces 2017-02-28 17:14:44 +01:00
practicalswift
3c57c94d45 [gardening] Fix incorrect Swift URLs 2017-02-28 17:14:05 +01:00
Roman Levenstein
6c1eec81c4 Merge pull request #7557 from mtake/enhance-assume-single-threaded
Enhance -assume-single-threaded option (SR-3945)
2017-02-27 13:07:46 -08:00
Mikio Takeuchi
2741535ee0 Add non-atomic variants to SideTable 2017-02-27 23:41:20 +09:00
practicalswift
99ceb78c7d Merge pull request #7723 from practicalswift/gardening-20170223
[gardening] Shell fixes. Consistent headers. a-vs-an typos. Python fixes. Unused variables and methods.
2017-02-27 14:05:05 +01:00
Mikio Takeuchi
69768ad540 Update for the new reference counting mechanism 2017-02-27 16:56:32 +09:00
Mikio Takeuchi
4f68ccf86e Add swift_nonatomic_unowned(Retain|Release)_n 2017-02-27 12:25:58 +09:00
Mikio Takeuchi
d17bbc383f Fix typo 2017-02-27 12:25:57 +09:00
Mikio Takeuchi
5ff7b6a852 Replace std::getenv with a preprocessor macro to switch the atomicity of reference counting in native runtime 2017-02-27 12:25:57 +09:00
Mikio Takeuchi
488d531846 Enhance -assume-single-threaded option (SR-3945) 2017-02-27 12:17:53 +09:00
Saleem Abdulrasool
a99141cbc3 Merge pull request #7773 from compnerd/linker
build: permit overriding the linker
2017-02-26 16:39:04 -08:00