Commit Graph

14 Commits

Author SHA1 Message Date
Arnold Schwaighofer
f88190ab8b Reapply "stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent""
This reapplies commit r22864 - it is not changing the public api as we initially
thought. sqrt() was never available without importing Darwin.

This change only changes where sqrt() gets "forwarded" to. Before 'sqrt' called
the builtin '_sqrt' defined in BuiltinMath now it just calls the math library's
'sqrt' function.

I also added a stdlib test.

rdar://18371371

Swift SVN r22870
2014-10-21 23:52:37 +00:00
Arnold Schwaighofer
d95b9c9ab8 Revert "stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent"
This reverts commit 22864. The change is under discussion.

Swift SVN r22865
2014-10-21 17:46:24 +00:00
Arnold Schwaighofer
b0e5358624 stdlib: libm's sqrt and llvm.sqrt are not semantically equivalent
llvm.sqrt(-1.0) is undefined, while sqrt(-1.0) is defined as nan.

rdar://18371371

Swift SVN r22864
2014-10-21 17:26:59 +00:00
Erik Eckstein
a4c7d89671 fix coding style in stdlib: move non-attribute keywords in same line as function declaration
Swift SVN r22275
2014-09-25 08:43:55 +00:00
Dave Abrahams
21669b3aee [stdlib] Add "Mutable" to [Autoreleasing]UnsafePointer
UnsafePointer becomes UnsafeMutablePointer
AutoreleasingUnsafePointer becomes AutoreleasingUnsafeMutablePointer

Swift SVN r20316
2014-07-22 16:56:23 +00:00
Greg Parker
bde0d301fc Fix fmod() covers. Add CGFloat to the math.h tests.
<rdar://problem/17275152> Can't call C fmodf() from stdlib


Swift SVN r19777
2014-07-10 03:54:27 +00:00
Doug Gregor
9e2b68c4f9 Introduce CGFloat as a distinct struct type.
CGFloat is 32-bit on 32-bit architectures and 64-bit on 64-bit
architectures for historical reasons. Rather than having it alias
either Float (32-bit) or Double (64-bit), introduce a distinct struct
type for CGFloat. CGFloat provides a complete set of comparisons and
arithmetic operators (including tgmath functions), initializers allows
explicit conversion between it an Int, UInt, Float, and Double, as
well as conforming to all of the protocols that Float/Double do.

This formulation of CGFloat makes use of CGFloat
architecture-independent, although it still requires a number of casts.
Fixes <rdar://problem/17224725>

Swift SVN r19689
2014-07-08 19:00:18 +00:00
Jordan Rose
da29f099f0 Update stdlib for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19672
2014-07-08 02:17:46 +00:00
Joe Groff
c34b4f6a9e Enable string-to-pointer conversions and remove CString.
There is some follow-up work remaining:

- test/stdlib/UnicodeTrie test kills the type checker without manual type annotations. <rdar://problem/17539704>
- test/Sema/availability test raises a type error on 'a: String == nil', which we want, but probably not as a side effect of string-to-pointer conversions. I'll fix this next.

Swift SVN r19477
2014-07-02 19:15:10 +00:00
Dave Abrahams
8e7d45f2c0 [stdlib] Normalize .gyb files
- Follow LLVM conventions for emacs mode specification

- Use local variables suffix to make the output read-only (at least on
  Emacs)

- But drop the admonitions not to edit the generated files;
  line-directive mostly takes care of that problem now.

Swift SVN r19381
2014-06-30 23:24:17 +00:00
Jordan Rose
cca27d02a0 Tag everything in the standard library with accessibility attributes.
Keep calm: remember that the standard library has many more public exports
than the average target, and that this contains ALL of them at once.
I also deliberately tried to tag nearly every top-level decl, even if that
was just to explicitly mark things @internal, to make sure I didn't miss
something.

This does export more than we might want to, mostly for protocol conformance
reasons, along with our simple-but-limiting typealias rule. I tried to also
mark things private where possible, but it's really going to be up to the
standard library owners to get this right. This is also only validated
against top-level access control; I haven't fully tested against member-level
access control yet, and none of our semantic restrictions are in place.

Along the way I also noticed bits of stdlib cruft; to keep this patch
understandable, I didn't change any of them.

Swift SVN r19145
2014-06-24 21:32:18 +00:00
Pete Cooper
653a9d2d99 Create builtin's for math functions exposed as LLVM intrinsics. Use these builtin's in the wrappers for functions such as sqrt(Float) and cos(Double). rdar://problem/16709244
Swift SVN r18968
2014-06-18 00:27:13 +00:00
Greg Parker
fc3794d7e9 <rdar://16978397> Overlay most of the rest of math.h.
Swift SVN r18821
2014-06-12 01:48:00 +00:00
Greg Parker
8548760762 <rdar://16978397> Add overlays for most of tgmath.h.
Swift SVN r18808
2014-06-11 21:56:25 +00:00