Commit Graph

7767 Commits

Author SHA1 Message Date
Philippe Hausler
9c0951b5b2 First draft at a new inlinable version of struct Data 2016-11-29 10:53:44 -08:00
Simon Evans
1daa3ee1f8 [SR-648] Add option to create statically linked binaries
- Add ImageInspectionStatic.cpp to lookup protocol conformance
  and metadata sections in static binaries

- For Linux, build libswiftImageInspectionShared.a and
  libswiftImageInspectionStatic.a for linking with libswiftCore.a.
  This allows static binaries to be built without linking to
  libdl. libswiftImageInspectionShared (ImageInspectionELF.cpp) is
  automatically compiled into libswiftCore.so

- Adds -static-executable option to swiftc to use along with
  -emit-executable that uses linker arguments in
  static-executable-args.lnk. This also requires a libicu
  to be compiled using the --libicu which has configure options
  that dont require libdl for accessing ICU datafiles

- Static binaries only work on Linux at this time
2016-11-29 13:36:19 +00:00
Simon Evans
70e79094e4 Optionally compile libicu
- Add --libicu option to compile icu from source. This allows the
  configuration to be controlled so that it is enabled for shared
  and static building and the static files dont require the use of
  the dynamic loader

- Add --install-libicu option to install the shared libraries into
  $prefix/lib/swift and the static ones into $prefix/lib/swift_static.
  This avoids interference with system installed versions

- Dont use find_package if building ICU from source
2016-11-29 13:36:18 +00:00
practicalswift
0b34f20318 Merge pull request #5962 from practicalswift/add-missing-license-headers
[gardening] Add missing licensing headers.
2016-11-29 09:40:39 +01:00
Simon Evans
c17ca759aa [runtime] Add platform independent version of dladdr() / Dl_info
- Win32 does not support dlfcn.h, Dl_info or dladdr() so add
  lookupSymbol() as a wrapper for ELF/MachO/Win32

- Win32 version needs an implementation, currently it just returns
  an error for `cannot lookup address'
2016-11-29 00:05:11 +00:00
Max Moiseev
3aba0f7f2b Removing unary + for floating point types and changing the unary - to a static method
Addresses: <rdar://problem/16424438>
2016-11-28 15:56:22 -08:00
Max Moiseev
70b2343626 Merge branch 'master' into new-integer-protocols 2016-11-28 15:25:01 -08:00
Max Moiseev
164232d346 adding type hints in signum implementation 2016-11-28 15:24:08 -08:00
practicalswift
5bc293cc09 [gardening] Add missing licensing headers. 2016-11-28 21:40:06 +01:00
swift-ci
82a3aa3cdd Merge pull request #5941 from compnerd/stdlib-target-sdks 2016-11-27 17:44:59 -08:00
swift-ci
b5bf13a142 Merge pull request #5944 from compnerd/windows-runtime 2016-11-27 17:44:58 -08:00
Saleem Abdulrasool
44fbfd6e93 runtime: repair windows build
The header `dlfcn.h` does not exist for windows targets, guard the including.
Correct the structure initializers which had the members inverted.  Finally,
include the required `vector` header.
2016-11-27 17:05:19 -08:00
Saleem Abdulrasool
d4b5ceabfd stubs: match types in the stubs
The various uses where using `unsigned char` rather than `char`.  Adjust the one
instance accordingly.  Noticed when building the stubs for Windows.
2016-11-27 17:01:39 -08:00
Saleem Abdulrasool
f238d65a33 stdlib: use ALL_APPLE_PLATFORMS where applicable
Convert a few instances of fully listing all apple platforms with the special
`ALL_APPLE_PLATFORMS` value for `TARGET_SDKS`.
2016-11-27 14:33:06 -08:00
practicalswift
01fe943de5 [gardening] Fix typo. 2016-11-24 17:58:40 +01:00
Rintaro Ishizaki
f6668a263d [stdlib] Adjust precedence of '->' operator
Precedence of '->' was too low.
`_ = () -> Int` was folded as:
  (arrow
    (assign
      (discard_assignment_expr)
      (tuple_expr))
    (unresolved_declref))
It should be:
  (assign
    (discard_assignment_expr)
    (arrow
      (tuple_expr)
      (unresolved_declref)))
2016-11-24 10:46:36 +09:00
Dave Abrahams
1f19884c01 Assertion failures from StdlibUnittest dump their descriptions 2016-11-23 02:14:39 -08:00
practicalswift
2fe4254cb7 Merge pull request #5878 from practicalswift/https-swift-org
[gardening] Use the correct base URL (https://swift.org) in references to the Swift website
2016-11-22 09:17:57 +01:00
practicalswift
02d88d73ed [gardening] Fix inconsistent headers. 2016-11-20 19:30:20 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
93aa6bfef5 Merge pull request #5881 from practicalswift/remove-initializepointer
Remove unused internal struct _InitializePointer<T>
2016-11-20 17:34:44 +01:00
practicalswift
a08f2f9777 Merge pull request #5882 from practicalswift/remove-isuniqueorpinnedreference
Remove unused internal function _isUniqueOrPinnedReference()
2016-11-20 17:34:36 +01:00
practicalswift
e8cb435d99 Remove unused variable CountableSelf 2016-11-20 13:59:55 +01:00
practicalswift
40d3b60f73 Remove unused internal function _isUniqueOrPinnedReference() 2016-11-20 13:59:21 +01:00
practicalswift
81e93c7ca6 Remove unused internal struct _InitializePointer<T> 2016-11-20 13:58:38 +01:00
Alexis Beingessner
28656578be Merge pull request #5850 from Gankro/empty
[runtime] statically initialize the empty Dictionary and Set singletons
2016-11-19 16:51:48 -05:00
Max Moiseev
c0d624f6e2 Minor improvements 2016-11-18 18:56:26 -08:00
Max Moiseev
28b0da2faf Avoiding recursive calls to init(extendingOrTruncating:) and speeding up == 2016-11-18 18:36:32 -08:00
Max Moiseev
deead1f1a4 Faster comparisons with integer literals 2016-11-18 16:05:06 -08:00
Alexis Beingessner
ae648c1564 Merge pull request #5840 from Gankro/docit
minor cleanup in HashedCollections
2016-11-18 17:53:54 -05:00
Alexis Beingessner
21405f1ac1 [runtime] statically construct the Dictionary and Set singletons 2016-11-18 13:56:57 -05:00
Jordan Rose
cc1c02f459 Merge pull request #5852 from jrose-apple/XCTest-overrelease
[SDK] Fix overrelease in the XCTest overlay, and re-enable the XCTest tests.
2016-11-18 10:54:05 -08:00
Max Moiseev
97981907e1 Merge branch 'master' into new-integer-protocols 2016-11-18 09:36:02 -08:00
Ben Cohen
3016d5e960 Merge pull request #5845 from airspeedswift/replace-as-with-is
Replace (x as? Y) != nil with x is Y
2016-11-18 09:31:38 -08:00
Slava Pestov
b3bc749d35 stdlib: Linux build fix 2016-11-18 01:13:54 -08:00
Slava Pestov
9a4c0488ba stdlib: SetIndex and DictionaryIndex can now be nested types of Set and Dictionary
Resolves ABI FIXME #34 and <rdar://problem/17002096>.
2016-11-18 00:39:15 -08:00
Slava Pestov
4e4d281aa7 stdlib: Rework swift_typeName() to use _swift_buildDemanglingForMetadata()
Previously we had two separate mechanisms to turn a metatype
into a string. The swift_typeName() function was used to print
the metatype in a human-readable fashion, whereas the
_swift_buildDemanglingForMetadata() was used when naming
generated generic Objective-C classes.

Unify them, since what swift_typeName() does is redundant;
instead of going directly from the metatype to a human-readable
string, we can get the mangling, and print that using the
demangler.

This fixes some issues with unnecessary parenthesis when
printing function types, and also allows Objective-C classes
to be instantiated with nested generic types as parameters.
2016-11-18 00:39:14 -08:00
Joe Groff
e9ce682a75 Merge pull request #5846 from jckarter/refactor-section-registration
Runtime: Refactor platform-dependent image inspection code.
2016-11-17 18:33:22 -08:00
Jordan Rose
b3124f1cad [SDK] Fix overrelease in the XCTest overlay.
...introduced by me in 2e560b0, and tracked down by Greg Parker.
Thanks, Greg!

rdar://problem/29067451
2016-11-17 17:03:20 -08:00
Joe Groff
87b27c6451 Runtime: Refactor platform-dependent image inspection code.
The code we use to interface with the platform dynamic linker is turning into a rat's nest of conditionals that's hard to maintain and extend. Since ELF, Mach-O, and PE platforms have pretty fundamentally different dynamic linker interfaces and capabilities, it makes sense to factor that code into a separate file per-platform, instead of trying to conditionalize the logic in-line. This patch factors out a much simpler portable interface for lazily kicking off the protocol conformance and type metadata lookup caches, and factors the guts out into separate MachO, ELF, and Win32 backends. This should also be a much cleaner interface to interface static binary behavior into, assisting #5349.
2016-11-17 16:50:04 -08:00
Tony Parker
dcb027e683 Remove a "fix-it" overload of URL.resourceValues(forKeys:).
Even though this overload is always unavailable, the compiler was
confusing it with the real one, causing ambiguous error messages.

Fixes SR-3144.
2016-11-17 16:28:52 -08:00
Max Moiseev
3faa9aac0b optimizing preconditions 2016-11-17 16:24:59 -08:00
Max Moiseev
716a378d62 Merge branch 'master' into new-integer-protocols 2016-11-17 12:19:41 -08:00
K Staring
6a121fb6e3 Merge branch 'master' of https://github.com/apple/swift 2016-11-17 21:13:04 +01:00
K Staring
5462fb235d different solution for detecting icu (not needed on Darwin, required on other platforms) 2016-11-17 21:08:44 +01:00
Ben Cohen
05b63ebffb Replace (x as? Y) != nil with x is Y 2016-11-17 11:26:36 -08:00
Alexis Beingessner
8caa9f4cd1 minor cleanup in HashedCollections 2016-11-17 13:33:15 -05:00
Ben Cohen
44b3a0016e Fix typo in RRC.removeSubrange comment example 2016-11-17 09:22:36 -08:00
Slava Pestov
1c7a50dcc5 Reflection: Fix class layout, again
There were a few problems here with subclasses of Objective-C classes.
Use the InstanceStart field from rodata to correctly lay out instance
variables, and verify the results match with dynamic and static layout.

Better fix for <rdar://problem/27932061>.
2016-11-16 19:31:18 -08:00
Max Moiseev
953d919a22 Merge branch 'master' into new-integer-protocols 2016-11-16 14:46:31 -08:00