Commit Graph

1737 Commits

Author SHA1 Message Date
Erik Eckstein
268436aa9d Mangling: check if we can de-mangle everything we mangle
And don't compare old and new mangling trees if the old demangling didn't succeed
2016-12-20 13:47:48 -08:00
Erik Eckstein
3c207ae936 Mangling: fix de-mangling of ‘MC’ 2016-12-20 13:47:48 -08:00
swift-ci
7b1f753c31 Merge pull request #6345 from practicalswift/gardening-20161217 2016-12-17 14:46:43 -08:00
practicalswift
853ace8b3d [gardening] Use correct end-of-namespace comments. 2016-12-17 22:33:09 +01:00
practicalswift
9d0b2abfc2 [gardening] Normalize end-of-namespace comments 2016-12-17 22:29:07 +01:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
Erik Eckstein
eb9cadb501 Mangling: add a substitution for optional types (bound generic enum Swift.Optional) 2016-12-14 16:40:13 -08:00
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
Erik Eckstein
62e32a1044 Mangling: support for mangling of partial specializations 2016-12-13 11:03:21 -08:00
Bob Wilson
deddf19aae Merge remote-tracking branch 'origin/master' into master-next 2016-12-13 10:23:03 -08:00
Erik Eckstein
c285044706 Mangling: fix re-mangling of AssociatedTypeWitnessTableAccessor 2016-12-09 10:28:34 -08:00
Erik Eckstein
ad1c079632 Mangling: support new mangling of partial apply forwarders in IRGen 2016-12-09 10:28:34 -08:00
Erik Eckstein
af24045941 Mangling: correct mangling of partial apply forwarders
Plus some refactoring in the demangler
2016-12-09 09:05:18 -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
d94dd580f6 Mangling: de- and re-mangling of GenericTypeParamDecl
This is also missing in the old mangling
2016-12-09 09:05:17 -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
Erik Eckstein
65ce67036f Mangling: small fix in rem angler 2016-12-09 09:05:16 -08:00
Erik Eckstein
06c8459087 Mangling: Re-mangle uncurried function type as regular function type
The new mangling scheme does not distinguish between curried and uncurried function types
2016-12-09 09:05:15 -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
Michael Gottesman
16165482f4 [gardening] Eliminate dead never read variable. Found with clang-tidy. 2016-12-06 23:54:23 -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
e7489462de Mangling: fix a problem with punycode encoded identifiers which begin with an underscore 2016-12-05 14:07:05 -08:00
Erik Eckstein
786bd67bd0 Mangling: fix new mangling and de-mangling of private operators 2016-12-05 12:34:25 -08:00
Erik Eckstein
d03b555524 Mangling: support of new mangling in the demangler.
It can now demangle the old “_T” and new “_S” symbol names.
2016-12-05 08:49:07 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
Erik Eckstein
5e6c5a70d7 Mangling: Let the demangler handle the new mangling scheme 2016-12-02 15:55:30 -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
Erik Eckstein
76820edda9 Mangling: support for special encoding ASCII of characters which may not appear in symbol names.
Such characters (like ‘.’) can be punycode-encoded just like non-ASCII unicode characters.
2016-12-02 15:55:30 -08:00
Erik Eckstein
97f1fac11e Mangling: refactoring: use meta-programming for value witness mangling/demangling/remangling
Also add the missing DestructiveInjectEnumTag entry.
2016-12-02 15:55:30 -08:00
Erik Eckstein
f52f3559c8 Mangling: add a dumpNode function to make it easier from the debugger to dump a node tree 2016-12-02 15:55:30 -08:00
Hugh Bellamy
50e94af377 Generate empty *Revision.inc files during the build process 2016-12-02 17:13:28 +00:00
Hugh Bellamy
56dfb08727 Port swift/basic to Windows 2016-12-02 16:57:00 +00:00
Xi Ge
7a58f00b6d [utils] Modify writeEdit() to take multiple edits instead of a single one to help preserve the correct json format. NFC 2016-12-01 12:47:09 -08:00
practicalswift
ddfe0c4b2a [gardening] Fix headers. 2016-11-30 18:58:06 +01:00
Xi Ge
f1113b2677 [Utils] Expose edit serialization utility for more clients. 2016-11-28 12:55:27 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Slava Pestov
4e4d281aa7 stdlib: Rework swift_typeName() to use _swift_buildDemanglingForMetadata()
Previously we had two separate mechanisms to turn a metatype
into a string. The swift_typeName() function was used to print
the metatype in a human-readable fashion, whereas the
_swift_buildDemanglingForMetadata() was used when naming
generated generic Objective-C classes.

Unify them, since what swift_typeName() does is redundant;
instead of going directly from the metatype to a human-readable
string, we can get the mangling, and print that using the
demangler.

This fixes some issues with unnecessary parenthesis when
printing function types, and also allows Objective-C classes
to be instantiated with nested generic types as parameters.
2016-11-18 00:39:14 -08:00
Bob Wilson
f10ae47b9f Merge remote-tracking branch 'origin/master' into master-next 2016-11-15 17:32:28 -08:00
Xi Ge
6a9298cd36 [Demangle] Abort less eagerly to allow de-mangler recognizing global protocols. rdar://29188832 (#5715) 2016-11-15 10:28:53 -08:00
EMatejska
1fa8dd45bc Adding getSwiftRevision(). This is to aid cleaning up some lldb code that could use this API. 2016-11-07 00:06:22 -08:00
practicalswift
17503b0d85 [gardening] Use American English. 2016-11-06 10:12:04 +01:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Bob Wilson
b227f45b7e Merge remote-tracking branch 'origin/master' into master-next 2016-10-27 22:28:28 -07:00
Robert Widmann
6accc5989e Disable the ability to use '$' as an identifier harder
When in Swift 3 Compatibility Mode we now acceptable a standalone
'$' as an identifier.  In all other cases this is now disallowed
and must be surrounded by backticks.
2016-10-27 16:51:18 -04:00
Graydon Hoare
5cf343f8f6 Logically compare swift versions as though X == X.0 == X.0.0, etc. 2016-10-24 20:23:02 -07:00
Michael Gottesman
636311072c [gardening] Eliminate warning from build due to uncovered switch. 2016-10-19 10:49:15 -07:00
Michael Ilseman
5d540ababd [Swift version] Note all supported versions when -swift-version is misused. 2016-10-18 14:43:21 -07:00
Michael Ilseman
12efcc9db6 [Version] Don't allow effective sub-versions, only major versions
Also offer a note when the major version is valid on its own.
2016-10-18 14:43:21 -07:00
Joe Groff
aac85cb93f SIL: Introduce a 'closure' convention for unapplied invocation functions.
We don't want the machine calling conventions for closure invocation functions to necessarily be tied to the convention for normal thin functions or methods. NFC yet; for now, 'closure' follows the same behavior as the 'method' convention, but as part of partial_apply simplification it will be a requirement that partial_apply takes a @convention(closure) function and a box and produces a @convention(thick) function from them.
2016-10-17 15:55:04 -07:00