Commit Graph

21434 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
f0773bcba1 Rename '__subscript' -> 'subscript'.
Since 'subscript' is a keyword, it cannot conflict with a function name.

Swift SVN r8787
2013-09-30 19:17:29 +00:00
Joe Groff
3d4c1251f1 Rename 'byref' attribute to 'inout'.
Swift SVN r8661
2013-09-25 20:56:52 +00:00
Anna Zaks
b8c4019c2a Make Int's init() 128-bit-Int-proof.
Following Jordan suggestion to r8446, replace the current version of Int's
init() to make it 128 bit-proof.

Swift SVN r8531
2013-09-20 23:24:28 +00:00
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
Anna Zaks
818cd1a1cc Add transparent constructors to integer types.
This time by modifying the FixedPoint.gyb and auto-generating FixedPoint.swift.

(Thanks Dmitry!)

Swift SVN r8448
2013-09-19 16:23:47 +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
Greg Parker
974f1e4ea9 Clean up -force_load and linkage of libswift_runtime.a. Fixes test Interpreter/Union.swift.
Swift SVN r8398
2013-09-18 06:28:53 +00:00
Doug Gregor
7d774c55d6 Replace "constructor" with "init" in a number of Swift sources.
Swift SVN r8393
2013-09-18 04:37:12 +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
Joe Groff
35e5a1ffbe Link swift_stdlib_core with -all_load so it links in all .o files from swift_runtime.
Swift SVN r8349
2013-09-17 21:04:43 +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
5dd6b2a12c Reinstate workaround for rdar://14897572 (slow arm64 compilation)
Swift SVN r8318
2013-09-17 01:28:49 +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
f627c439c9 Remove some Int128 assumptions from FixedPoint generator.
Swift SVN r8247
2013-09-14 07:07:35 +00:00
Greg Parker
db0cf2518a Split Foundation.swift because NSRect is not in Foundation on iOS.
Swift SVN r8246
2013-09-14 06:15:09 +00:00
Greg Parker
d3d00c3456 Use OS names -darwin / -darwin_ios / -darwin_sim to match build_llvm better.
Swift SVN r8245
2013-09-14 06:00:52 +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
63ecd5c9d1 Add UIKit module.
Swift SVN r8178
2013-09-13 01:39:54 +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
Dave Zarzycki
462fe42725 Adopt [transparent] more
Swift SVN r7980
2013-09-06 02:44:37 +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
Dave Abrahams
0d34c37048 [stdlib] FixedPoint.gyb/.swift: factor out more of the boilerplate repetition
Swift SVN r7805
2013-08-30 22:07:14 +00:00
Dave Zarzycki
d1e19306c0 Email feedback from DaveA
Swift SVN r7784
2013-08-30 17:07:05 +00:00
Dave Zarzycki
32c305949a '-=' is valid on both signed/unsigned types
Also, make the output easier to review output "tables" of operators.

Swift SVN r7780
2013-08-30 16:28:33 +00:00
Dave Zarzycki
2da92327c4 Adopt [transparent] in a bunch of places
Swift SVN r7779
2013-08-30 16:28:13 +00:00
Dave Abrahams
930f786725 [stdlib] Add regeneration instructions to FixedPoint.swift
Swift SVN r7761
2013-08-29 23:00:52 +00:00
Dave Abrahams
40d3f9e022 [stdlib] Add "gyb" templating engine; use it to generate FixedPoint.swift
Eventually gyb should be integrated with the build system, but for now
we are only using it to generate one Swift file.

Swift SVN r7759
2013-08-29 22:57:09 +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
Jordan Rose
45fba0438f Autoconf build: add missing source file to swiftObjectiveC library.
Swift SVN r7592
2013-08-26 21:05:37 +00:00
Jordan Rose
3e992a64fa Use -module-link-name to encode library names in standard library modules.
...which allows us to drop the hardcoded logic to load specific libraries
in immediate modes.

Swift SVN r7585
2013-08-26 18:57:50 +00:00
Jordan Rose
940d53c864 Fix definition of "nil": it has to be null, not a default-initialized NSObject.
This ended up being easiest with a runtime function. I couldn't push this
into the standard library because the standard library doesn't know about
NSObject, and I couldn't compile the ObjectiveC module as -parse-stdlib
because it uses standard library types and doesn't otherwise know how to
find the "swift" module.

Swift SVN r7581
2013-08-26 18:57:45 +00:00
Chris Lattner
087b035414 Refactor assign lowering out to a helper function.
Make sure that all assigns are lowered by the memory promotion pass, even those
that don't refer to a box.  These are always assignments, not initializations.



Swift SVN r7543
2013-08-23 23:36:30 +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
Chris Lattner
d4a0c16baa revert my r7505 patch to 'assign'. It turns out that changing
assign in this way doesn't actually make things simpler, and the
former model for assign is simpler to work with.


Swift SVN r7537
2013-08-23 22:40:56 +00:00
Chris Lattner
f6a5c78df2 Per John's advice (a few weeks ago), rework the 'assign' instruction
to being a semantic assign.  The functional difference here is only
for unowned pointers, where now the conversion from strong to unowned 
is implicit in the assign.

The logic behind this is that 'assign' is really part of SILGen, that
is only moved later to make it easier to make it be flow sensitive.
Since it is part of SILGen and will be using some of the type lowering
functionality used by SILGen, we should play by its rules.

No functionality change.


Swift SVN r7507
2013-08-23 18:15:21 +00:00
Adrian Prantl
97cdb29f5d Turn on (swift) debug symbols for debug builds. This gives us a bunch of
additional test coverage for free.

Swift SVN r7468
2013-08-22 18:36:05 +00:00
Jordan Rose
bee99803b2 Build modules alongside object files for the standard library.
...rather than as a separate step. This avoids duplicating Parse and Sema
work for these. (This is the new and correct version of r7377.)

Also, remove leftover code for building "swift.swift" and friends in lieu
of proper modules. We're not going back to those days. :-)

Swift SVN r7420
2013-08-21 20:15:00 +00:00
Jordan Rose
beb743aa53 [runtime] Push swift_getObjectType down into the runtime.
It's used for class-bounded protocols, not just Foundation objects.
No test because I couldn't figure out how to write a non-compilation test.

Swift SVN r7367
2013-08-20 20:37:00 +00:00