Commit Graph

31 Commits

Author SHA1 Message Date
Greg Clayton
cbf6e8ab5c Fix the Makefile to use "Enum.cpp" instead of the old "Union.cpp".
Swift SVN r8512
2013-09-20 20:34:17 +00:00
Joe Groff
e109124186 Replace 'union' keyword with 'enum'.
This only touches the compiler and tests. Doc updates to follow.

Swift SVN r8478
2013-09-20 01:33:14 +00:00
Joe Groff
c10340433c IRGen: Forward extra inhabitants through single-payload unions.
If a single-payload union doesn't use up all of its payload's extra inhabitants, it can claim the remaining ones as its own. While we're here, specialize the extra inhabitants implementation for no-payload unions to generously (and more efficiently) give out all integer values within its storage type above the largest discriminator as extra inhabitants, instead of relying entirely on the spare bits mask.

Swift SVN r8470
2013-09-19 23:16:53 +00:00
Greg Parker
f05641d208 Don't #include internal header <os/tsd.h> on platforms that don't need it.
Swift SVN r8468
2013-09-19 23:13:23 +00:00
Joe Groff
8f061188b9 Remove unused, nonexistent header.
Swift SVN r8447
2013-09-19 15:19:21 +00:00
Greg Parker
1a07770bbc Remove x86-specific code that was unused on x86.
Swift SVN r8446
2013-09-19 10:58:32 +00:00
Joe Groff
d749169a80 runtime: Fix stride calculation for dynamic single-payload union value witness.
Swift SVN r8366
2013-09-17 23:50:31 +00:00
John McCall
d01e725fee Fix Makefile build of unittests.
Swift SVN r8330
2013-09-17 07:22:27 +00:00
Joe Groff
000d8e4953 Runtime: Add functions for dynamic single-payload dispatch.
Add functions to dynamically query the extra inhabitants of a single-payload union's payload metadata, then identify or store bit patterns used to represent empty cases, whether they happen to use extra inhabitants or added tag bits.

Swift SVN r8320
2013-09-17 01:29:35 +00:00
Greg Parker
6a1df4bb3f Remove Int128 because it is unreliable or incomplete on some architectures.
Swift SVN r8249
2013-09-14 11:07:27 +00:00
Greg Parker
8e13188209 Consolidate some build flags for .swift files. Add cross-compilation support.
Swift SVN r8181
2013-09-13 01:51:48 +00:00
Greg Parker
ebebd988b2 Workaround rdar://14883575 muloti missing from libcompiler_rt on arm64.
Swift SVN r8177
2013-09-13 01:25:33 +00:00
Joe Groff
7410a83165 Replace Bool._getBuiltinLogicValue stub with a Swift implementation.
We can switch over unions now.

Swift SVN r8114
2013-09-11 22:00:49 +00:00
Greg Parker
1200ef4fab Move benchmark machinery out of stdlib.
Swift SVN r7961
2013-09-05 21:18:23 +00:00
Greg Parker
9c0f1fafd1 Update slow versions of FastEntryPoints.
Swift SVN r7938
2013-09-05 02:45:34 +00:00
Joe Groff
33d2122ce9 IRGen/Runtime: Change generic metadata template to use a fill function.
Instead of hardcoding a walk of a list of fill ops, have generic metadata templates carry a pointer to a fill function for swift_getGenericMetadata to invoke to perform the fill operations. For types with dynamic layout, we will need to be able to perform more complex fill operations than a simple transfer of arguments into generic metadata slots.

Swift SVN r7893
2013-09-04 02:13:34 +00:00
Joe Groff
19fb7d6b64 runtime: Allocate refcounted storage for swift_NSStringToString.
Instead of letting swift_NSStringToString leak malloced memory, use swift_allocPOD to allocate storage for the converted String, and stash the heap object into the created string.

Swift SVN r7872
2013-09-03 22:27:40 +00:00
Joe Groff
691ce0e943 runtime: Add swift_allocPOD entry point.
swift_allocPOD allocates a heap object capable of holding POD data of some given size and alignment. This will allow 'alloc_box' and 'alloc_array' to lower specially without instantiating do-nothing heap metadata for POD types, as described in <rdar://problem/13129334>. Update the dynamic swift_allocBox entry point to use swift_allocPOD for POD types. This can also be used by other runtime functions that need to allocate reference-counted scratch memory, such as swift_NSStringToString, as noted in <rdar://problem/14646715>.

Swift SVN r7860
2013-09-03 20:49:02 +00:00
John McCall
6de3df22c2 Define _getBool purely in swift.
Swift SVN r7738
2013-08-29 20:34:34 +00:00
Jordan Rose
e1f346b342 Update comment for print_double to mention that NaNs don't need ".0" either.
Swift SVN r7655
2013-08-28 00:21:12 +00:00
Jordan Rose
9b42f8f81f Don't append ".0" to "inf" and "-inf".
We may want a prettier representation of floating-point infinities, but
"inf.0" is a particularly bad one.

Swift SVN r7638
2013-08-27 22:41:01 +00:00
Joe Groff
46fd1c91b3 IRGen: Emit metadata and value witness tables for nongeneric unions.
And remove the hokey hardcoded metadata for Bool from the runtime.

Swift SVN r7541
2013-08-23 23:09:26 +00:00
John McCall
14cb7001b3 Implement basic support for [weak].
Swift SVN r7041
2013-08-08 04:04:51 +00:00
John McCall
b77c430848 Add SIL-gen and some missing runtime support for [unowned].
Swift SVN r6881
2013-08-03 08:46:54 +00:00
Jordan Rose
674a03b085 Replace "oneof" with "union"...everywhere.
We haven't fully updated references to union cases, and enums still are not
their own thing yet, but "oneof" is gone. Long live "union"!

Swift SVN r6783
2013-07-31 21:33:33 +00:00
Argyrios Kyrtzidis
d02ac70be2 [CMake] Pass "-isysroot ${MODULES_SDK}" for building stdlib/runtime.
This is because objc/NSObject.h, included by SwiftObject.mm, only exists in the 10.9 SDK.

Swift SVN r6343
2013-07-18 01:12:54 +00:00
Argyrios Kyrtzidis
341962ce92 [CMake] Introduce add_swift_compiler_flags() and add_swift_optimization_flags() to reduce copy-pasting.
Swift SVN r6342
2013-07-18 01:12:53 +00:00
John McCall
7b86817b3c Basic value structure for [weak] and [unowned] references.
Add a bunch of new entrypoints and give them terrible
implementations.

Swift SVN r6322
2013-07-17 09:20:20 +00:00
Dmitri Hrybenko
e662ec5bf8 Re-export libobjc from swift_stdlib_core
This fixes rdar://14265543 Building a program with a class requires Cocoa at
link time


Swift SVN r5982
2013-07-04 00:06:23 +00:00
Dmitri Hrybenko
0e26015bb2 Splitting the standard library: move POSIX declarations from stdlib/core/Misc.swift to stdlib/POSIX
Swift SVN r5890
2013-06-28 23:46:01 +00:00
Dmitri Hrybenko
ea43c46262 Splitting the standard library: move runtime -> stdlib/runtime
Swift SVN r5887
2013-06-28 22:41:38 +00:00