Commit Graph

68 Commits

Author SHA1 Message Date
Doug Gregor
d42e385371 Remove UnstructuredUnresolvedType.
Swift SVN r6241
2013-07-13 05:10:38 +00:00
John McCall
18a9290cbe Add ReferenceStorageType.
The idea for now is that this is a SIL-only type used for
representing the storage of a weak or unowned reference.
Having it be its own type is pretty vital for reasonable
behavior in SIL and IR-generation, and it's likely that
this will surface into runtime metadata as well (hence
the mangling).

I've implemented a bunch of things that technically I don't
think are necessary if this stays out of the typechecker,
but it's easier to implement half-a-dozen "recurse into
the child type" methods now that it would be to find them
all later if we change our minds.

Swift SVN r6091
2013-07-09 08:37:40 +00:00
Doug Gregor
2c49592c3a Mangle declarations imported from Clang with the context SC.
Fixes <rdar://problem/14221244>.


Swift SVN r6022
2013-07-05 22:08:57 +00:00
Doug Gregor
4239e3db85 Mangle all Clang module contexts as "5__C__".
This partly rolls back <rdar://problem/14221244>, which caused the
ListMaker build to break. We need to mirror the Clang module structure
properly into Swift to actually get entities mangling into the right
contexts.


Swift SVN r5968
2013-07-03 16:49:53 +00:00
Joe Groff
9d4328380a Mangle: Always mangle decl contexts.
Our mangling grammar says that entities should always be mangled with a context, so in cases where we weren't (Clang module contexts and top-level code), do so. Additionally, for ObjC protocols, mangle them into the special "So" context so we can catch global ObjC runtime namespace collisions with them. Fixes <rdar://problem/14221244>.

Swift SVN r5851
2013-06-27 23:07:06 +00:00
Doug Gregor
9a5c96a8c1 Introduce basic support for LLVM vectors as builtins.
This adds builtin types Builtin.VecNxT, where N is a natural number
and T is a builtin type, which map down to the LLVM type <N x T>. 

Update varous builtins to support vector arguments, e.g., binary
operations, comparisons, negation. Add InsertElement and
ExtractElement builtins for vectors.

On top of these builtins, add Vec4f and Vec4b structs to the standard
library, which provide 4xFloat and 4xBool vectors, respectively, with
basic support for arithmetic. These are mostly straw men, to be burned
down at our leisure.

Some issues as yet unresolved:
  - Comparisons of Vec4f'ss are producing bogus Vec4b's, which I
  haven't tracked down yet.
  - We still don't support the shuffle builtin, although it should be
  easy
  - More testing!



Swift SVN r5820
2013-06-26 21:16:36 +00:00
Doug Gregor
cace751e86 Eliminate DeducibleGenericParamType.
The type was used by the old type coercion code; it is no longer relevant.


Swift SVN r5799
2013-06-25 16:32:44 +00:00
Joe Groff
062fbf7edb Don't crash mangling single-protocol<T> types.
Swift SVN r5685
2013-06-19 19:13:54 +00:00
Joe Groff
87f6b96d5a Mangle: Fix archetype depth calculation.
We were re-counting archetype depth levels and ended up mangling the triangular number of the archetype depth instead of the linear archetype depth. Measure archetype depth starting from zero to fix this.

Swift SVN r5546
2013-06-08 21:10:20 +00:00
Joe Groff
fdb1033e80 Fix protocol type mangling harder.
Didn't take substitutions into account last time. Always mangle a single-protocol type as a single protocol list, so that substituted protocols mangle as 'PS<n>__' as expected. Also, actually update the tests this time.

Swift SVN r5541
2013-06-08 04:51:25 +00:00
Joe Groff
075e0031d7 Fix mangling of single-protocol types.
The protocol type mangling is 'P' protocol+ '_', and so needs a trailing '_' to terminate the list, but we were missing the '_' for single-protocol types, which we tried to mangle as a nominal type context.

Swift SVN r5539
2013-06-08 03:11:07 +00:00
Joe Groff
e1c838962e Revert "Remove [objc_block] attribute from Swift type system."
Implementing SIL bridging is going to take more IRGen work than I anticipated.

Swift SVN r5113
2013-05-09 16:32:18 +00:00
Jordan Rose
77ce3f31cb Add a DeclContextKind for Swift modules.
Swift SVN r5095
2013-05-08 18:33:34 +00:00
Joe Groff
38f13e56f5 Remove [objc_block] attribute from Swift type system.
We will handle Swift-function-to-ObjC-block bridging in SILGen as part of general Cocoa-to-Swift type bridging. Temporarily disable building swiftAppKit and tests that exercise block bridging until the new implementation lands.

Swift SVN r5090
2013-05-08 16:52:12 +00:00
Joe Groff
a2341a4cde Add Unicode symbol characters to operator charset.
Remove '@' from the operator character set, but add the math, symbol, punctuation, arrow, and line- and box-drawing characters. Also allow operators to contain (but not start with) combining characters--this should be safe, because identifiers can't start with combining characters either, and we don't allow them anywhere else.

Swift SVN r5019
2013-05-01 23:13:48 +00:00
Joe Groff
1013781bcc Parse: Allow Unicode identifier characters.
Extend the character set for identifiers according to WG14 N1518, which recommends an extended character set for identifier start and continuation characters in C. Mangle identifiers containing non-ASCII characters by borrowing the Punycode encoding used for international domain names.

No Unicode operators just yet.

Swift SVN r4968
2013-04-28 21:39:02 +00:00
Joe Groff
5b4519d12b Mangle operator fixity and tuple variadicity.
Tweak the mangling rules to fix some collisions I found:

- Mangle variadic tuples with a lowercase 't' to distinguish them from nonvariadic tuples with a slice as their final element.
- Mangle the fixity of operators using 'op' for prefix, 'oP' for postfix, and 'oi' for infix, so that operator declarations that differ only in fixity can coexist.

While we're here, 'Slice' seems worthy of a standard substitution, so mangle it to 'Sa'.

This fixes <rdar://problem/13757744> and <rdar://problem/13757750>.

Swift SVN r4965
2013-04-28 15:48:18 +00:00
Joe Groff
0566088bf2 Move name mangling into SIL.
Sever the last load-bearing link between SILFunction and SILConstant by naming SILFunctions with their mangled symbol names. Move the core of the mangler up to SIL, and teach SILGen how to use it to mangle a SILConstant.

Swift SVN r4964
2013-04-28 03:32:41 +00:00