Commit Graph

95 Commits

Author SHA1 Message Date
Michael Gottesman
8437819b5a [CMake] Revert recent changes.
These changes caused a number of issues:

1. No debug info is emitted when a release-debug info compiler is built.
2. OS X deployment target specification is broken.
3. Swift options were broken without any attempt any recreating that
functionality. The specific option in question is --force-optimized-typechecker.

Such refactorings should be done in a fashion that does not break existing
users and use cases.

This reverts commit e6ce2ff388.
This reverts commit e8645f3750.
This reverts commit 89b038ea7e.
This reverts commit 497cac64d9.
This reverts commit 953ad094da.
This reverts commit e096d1c033.

rdar://30549345
2017-02-15 22:26:06 -08:00
Chris Bieneman
e096d1c033 [CMake] Simplify add_swift_library
This patch splits add_swift_library into two functions one which handles
the simple case of adding a library that is part of the compiler being
built and the second handling the more complicated case of "target"
libraries, which may need to build for one or more targets.

The new add_swift_library is built using llvm_add_library, which re-uses
LLVM's CMake modules. In adapting to use LLVM's modules some of
add_swift_library's named parameters have been removed and
LINK_LIBRARIES has changed to LINK_LIBS, and LLVM_LINK_COMPONENTS
changed to LINK_COMPONENTS.

This patch also cleans up libswiftBasic's handling of UUID library and
headers, and how it interfaces with gyb sources.

add_swift_library also no longer has the FILE_DEPENDS parameter, which
doesn't matter because llvm_add_library's DEPENDS parameter has the same
behavior.
2017-02-14 14:28:10 -08:00
Saleem Abdulrasool
08751a8bb2 stdlib: add sys.user module for Linux
sys/user.h provides definitions for registers.  It would previously get
merged into the sys module which could result in it being multiply
included (as in the case of libdispatch).  Add an explicit submodule.
Noticed when building libdispatch on Linux AArch64.
2017-02-11 14:50:56 -08:00
Joe Groff
808d4d7e51 Merge pull request #4788 from amraboelela/glibc.modulemap.gyb
Added module ifaddrs
2017-01-17 14:36:24 -08:00
Han Sangjin
a8dec7fa43 [stdlib] Fixed for Cygwin
- CYGWIN symbol is used to distinguish Cygwin environment from other OS
  and other environment in Windows.
- Added windows and windowsCygnus to OSVersion in StdlibUnittest
2017-01-17 02:31:16 +09:00
Stephen Canon
6ff95dad03 Mark several C macros imported from <float.h> as deprecated. (#6796)
* Mark several C macros imported from <float.h> as deprecated.

These macros all have straightforward replacements in terms of static properties on FloatingPoint or BinaryFloatingPoint. It is necessary to add 1 in a few places because of differences between how C and Swift count significand bits and normalize the significand, but this is expected to have minimal impact on code in practice (and when it does have impact, using the Swift definition is generally simpler).

* Address review notes from @moiseev.

This fixes <rdar://problem/27871465>
2017-01-13 21:33:43 -05:00
Max Moiseev
a1c5a0b528 Deprecating M_SQRT2 and M_SQRT1_2
Now that square root is being propoerly inlined and optimized away, it
is safe to deprecate these two constants in favor of a Swiftier API.

Fixes: <rdar://problem/30003973>
2017-01-13 10:40:28 -08:00
Maxim Moiseev
0d0dc79ce8 Deprecating M_PI and a few other constants in favor of better API (#6764)
* Deprecating M_PI and a few other constants in favor of better API

Deprecating `M_PI`, `M_PI_2`, `M_PI_4`.
Sugesting using `Double.pi` or even just `.pi` to allow type be inferred
and avoid a type-cast.

Fixes: <rdar://problem/26602190>
2017-01-12 16:36:08 -08:00
Robert Widmann
cde11ae1ee Resolve comments from last code review 2017-01-10 10:45:18 -07:00
Alsey Coleman Miller
8157194e83 [stdlib] Added POSIXErrorCode for Linux 2017-01-10 10:40:00 -07:00
swift-ci
294359bd69 Merge pull request #4804 from kstaring/master 2017-01-10 00:01:46 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Saleem Abdulrasool
96974a2179 Windows: add a ucrt.io module
This module covers the ucrt corecrt_io.h header.  We can further refine
the module if necessary later.
2016-12-17 16:37:41 -08:00
practicalswift
5bc293cc09 [gardening] Add missing licensing headers. 2016-11-28 21:40:06 +01: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
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
K Staring
fb70a1bfad incoorporate @jeremyandrews' suggestion 2016-10-22 12:00:36 +02:00
K Staring
8bda672c70 Merge branch 'master' of https://github.com/apple/swift 2016-10-15 18:36:36 +02:00
Ankit Aggarwal
e7a6ce07ab [GlibcModuleMap] Add sys/file.h to glibc modulemap 2016-10-05 12:35:47 +05:30
K Staring
69085ae4eb Merge branch 'master' of https://github.com/apple/swift 2016-09-29 07:24:25 +02:00
Maxim Moiseev
69b3cc0946 [overlay] Declaring MAP_FAILED (#4971)
Clang importer is unable to handle `((void *)-1)`, therefore manually
declaring the said constant in both Darwin and Glibc modules.

rdar://problem/26689135
2016-09-23 14:48:48 -07:00
K Staring
7edc3100bf fix unbalanced '% if'/'% end', found by gribozavr 2016-09-22 20:28:10 +02:00
swift-ci
88741f93c6 Merge pull request #4899 from Nirma/gardening_mach_error 2016-09-21 10:42:24 -07:00
Nicholas Maccharoli
384b2e3b83 [gardening] fix enum value spacing 2016-09-21 18:03:22 +09:00
K Staring
7c50ccde5e fix cut/paste typo 'CMAKE_SDK != "FreeBSD"' to 'CMAKE_SDK in ["FreeBSD"]' (assuming some time more kqueue-supported platforms will want to support Swift) 2016-09-20 03:53:36 +02:00
K Staring
98a8b58957 add //FIXME for FreeBSD outcommented code, add sys/event.h for kqueue (untested) 2016-09-20 03:46:35 +02:00
K Staring
b267fda3c8 Merge branch 'master' of https://github.com/apple/swift 2016-09-18 13:09:34 +02:00
practicalswift
3a4ee89034 [gardening] Use consistent formatting. 2016-09-17 12:12:49 +02:00
K Staring
4dbf4de036 don't try to link "dl" on FreeBSD 2016-09-16 20:49:22 +02:00
Amr Aboelela
dbca4f031a Added module ifaddrs 2016-09-14 17:47:11 -07:00
K Staring
afc95a5e2a disable handy pthread wrappers on FreeBSD since they don't compile
Things like: PthreadBarriers.swift:114:50: error: cannot convert value of type 'UnsafeMutablePointer<pthread_mutex_t>' (aka 'UnsafeMutablePointer<OpaquePointer>') to expected argument type 'UnsafeMutablePointer<pthread_mutex_t?>' (aka 'UnsafeMutablePointer<Optional<OpaquePointer>>')
on barrier.pointee.mutex . I need to do more research to understand this
2016-09-13 11:08:00 +02:00
Michael Gottesman
739874c08b [cmake][gardening] Eliminate a level of indentation by inverting a conditional and using continue. 2016-08-28 14:41:43 -07:00
Paulo Faria
1ed756ec84 Add sendfile to Glibc 2016-08-21 17:43:20 -07:00
Dave Abrahams
011c280383 Merge pull request #4065 from apple/withVaList
Prefer withVaList over getVaList
2016-08-07 11:06:03 -07:00
Dave Abrahams
8d3ac46448 Prefer withVaList over getVaList 2016-08-06 06:48:13 -07:00
Dmitri Gribenko
92d19ae7e9 Merge pull request #3926 from aciidb0mb3r/pty_glibc
Add pty to Glibc modulemap
2016-08-05 00:52:48 -07:00
Ankit Agarwal
d86e8b7d14 Add pty to Glibc modulemap 2016-08-05 09:07:25 +05:30
Michael Gottesman
06a70d3942 [cmake] Add cmake support for only applying tsan to the swift stdlib/runtime. 2016-08-03 17:53:57 -07:00
Saleem Abdulrasool
4ce4157037 stdlib: remove unnecessary externs in definitions
The definition may be tagged with `extern`, however, this does nothing.  In the
header, it may be used to indicate to other TUs that the definition is external
to the TU.  Remove the unnecessary modifier.  NFC.
2016-07-27 21:16:15 -07:00
Bob Wilson
58395b3b2f [SE-0127] Add "to:" argument label to withUnsafe[Mutable]Pointer.
rdar://problem/26529498
2016-07-26 17:44:33 -07:00
Andrew Trick
a18d490d6a Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3773)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 14:21:15 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
Arnold Schwaighofer
d7856e2ab1 dprintf's format argument is read-only
SR-1958
2016-07-20 07:14:20 -07:00
Chris Lattner
a0d34852bb Revert "Fix the build."
This reverts commit 932fe9d6b9.
2016-07-17 12:35:42 -07:00
Michael Gottesman
932fe9d6b9 Fix the build.
This reverts commit 4242af7503.
This reverts commit 76cf339694.
This reverts commit e97ed133a8.
This reverts commit 66961fcda8.
2016-07-17 01:02:48 -07:00
Chris Lattner
76cf339694 Implement the first half of SE-0109: Remove the Boolean protocol
This removes conformance of DarwinBool and ObjCBool to the Boolean protocol,
and makes the &&/||/! operators be concrete w.r.t. Bool instead of abstract
on Boolean.

This fixes some outstanding bugs w.r.t diagnostics, but exposes some cases
where an existing diagnostic is not great.  I'll fix that in a later patch
(tracked by rdar://27391581).
2016-07-16 23:23:45 -07:00
Saleem Abdulrasool
1689363786 stdlib: shim errno access
errno is implemented as a macro in many environments.  The accessor hidden
behind the macro is not a standard function, so we ended up with an
implementation specific handling across all the targets.  Shim the function in C
where it can be hidden behind the CPP.  This simplifies the implementation on
the swift side.
2016-07-15 22:16:27 -07:00
Dmitri Gribenko
61fcdf5fcf Merge pull request #3527 from practicalswift/gardening-20160715
[gardening] Header fixes. Don't compare to false.
2016-07-15 13:12:17 -07:00
Stephen Canon
cc024d0710 Generic implementations of math functions implementable on FloatingPoint. (#3524)
Replace the non-generic tgmath functions with generic <T: FloatingPoint> implementations where possible, and move the global sqrt() operation into tgmath.
2016-07-15 08:19:08 -04:00