Commit Graph

764 Commits

Author SHA1 Message Date
Erik Eckstein
4a492fc5a7 Mangling: Change new mangling for bound generic types.
Putting the nominal type in the first place increases the changes for common prefixes (for the trie).
2016-12-14 16:39:00 -08:00
swift-ci
d694e1e6b3 Merge pull request #6164 from eeckstein/mangling-changes 2016-12-09 11:31:25 -08:00
Xi Ge
6bbdf4a837 [Mangler] Check the order of generic type parameters before mangling them to avoid assertion hit. 2016-12-09 09:51:40 -08:00
Erik Eckstein
7cadbb29c1 Mangling: correct mangling/demangling/remangling of the error and unknown type 2016-12-09 09:05:18 -08:00
Erik Eckstein
b0c95278e1 Mangling: introduce ‘D’ for mangled types for the debugger.
This is what ‘_Tt’ was in the old mangling.
Maybe we don’t need this eventually. But currently at least swift-ide-test relies on having a special mangling for such symbols
2016-12-09 09:05:16 -08:00
Joe Groff
15a2432efb Merge pull request #6135 from jckarter/use-sil-box-field-accessors-4
Mangle SILBoxTypes with their layout.
2016-12-08 21:09:31 -08:00
Joe Groff
7429ffb228 Mangle SILBoxTypes with their layout.
Use a new mangling scheme that describes the layout of compound boxes. For compatibility with reflection-based clients, continue to use the legacy mangling for single-field boxes when emitting reflection TypeRefs until we fully support reflection for the new box implementation.
2016-12-08 20:02:44 -08:00
Slava Pestov
f3c72d8941 AST: Remove SubstitutedType 2016-12-07 17:03:07 -08:00
Michael Gottesman
1af1cbfb76 [gardening] Add a bunch of end namespace comments found by clang-tidy. 2016-12-06 19:22:52 -08:00
practicalswift
cfdaf9f14a [gardening] Fix invalid Swift URLs. 2016-12-06 20:12:20 +01:00
Erik Eckstein
0db5a17925 Mangling: merge a fix for an IDE crasher to the new ASTMangler 2016-12-05 13:57:18 -08:00
Erik Eckstein
786bd67bd0 Mangling: fix new mangling and de-mangling of private operators 2016-12-05 12:34:25 -08:00
Slava Pestov
1a991da16d AST: Assign interface types to ParamDecls
First, ensure all ParamDecls that are synthesized from scratch are given
both a contextual type and an interface type.

For ParamDecls written in source, add a new recordParamType() method to
GenericTypeResolver. This calls setType() or setInterfaceType() as
appropriate.

Interestingly enough a handful of diagnostics in the test suite have
improved. I'm not sure why, but I'll take it.

The ParamDecl::createUnboundSelf() method is now only used in the parser,
and no longer sets the type of the self parameter to the unbound generic
type. This was wrong anyway, since the type was always being overwritten.
This allows us to remove DeclContext::getSelfTypeOfContext().

Also, ensure that FuncDecl::getBodyResultTypeLoc() always has an interface
type for synthesized declarations, eliminating a mapTypeOutOfContext()
call when computing the function interface type in configureInterfaceType().

Finally, clean up the logic for resolving the DynamicSelfType. We now
get the interface or contextual type of 'Self' via the resolver, instead
of always getting the contextual type and patching it up inside
configureInterfaceType().
2016-12-04 00:02:21 -08:00
Erik Eckstein
684092d7d1 Mangling: mangler, demangler and remangler classes for the new mangling scheme.
Following classes provide symbol mangling for specific purposes:
*) Mangler: the base mangler class, just providing some basic utilities
*) ASTMangler: for mangling AST declarations
*) SpecializationMangler: to be used in the optimizer for mangling specialized function names
*) IRGenMangler: mangling all kind of symbols in IRGen

All those classes are not used yet, so it’s basically a NFC.

Another change is that some demangler node types are added (either because they were missing or the new demangler needs them).
Those new nodes also need to be handled in the old demangler, but this should also be a NFC as those nodes are not created by the old demangler.

My plan is to keep the old and new mangling implementation in parallel for some time. After that we can remove the old mangler.
Currently the new implementation is scoped in the NewMangling namespace. This namespace should be renamed after the old mangler is removed.
2016-12-02 15:55:30 -08:00