- Change type attribute printing logic (in astprinter and the demangler)
to print in the new syntax
- Change the swift parser to only accept type attributes in the new syntax.
- Update canParseTypeTupleBody to lookahead over new-syntax type attributes.
- Update the testsuite to use the new syntax.
Swift SVN r9273
(Optional is an hardcoded substitution, so even if its definition changes, the mangling won't change, and the demangler has to keep up!)
Swift SVN r8609
This is only useful for unique-identification uses of the mangler, like in SourceKit,
which has to deal with invalid code.
Since this is not related to ABI, we can change the encoding anytime we want.
Swift SVN r8557
Use the ordinal archetype manglings only for the primary archetypes of a generic context, and define a mangling for associated types relative to their parent archetype. This will make the archetype mangling resilient in the face of our planned improvements to associated type and protocol conformance ABI. It also correctly mangles self and associated types of protocols, which my previous attempt utterly failed to accomplish.
Swift SVN r8174
This should allow declarations inside protocols to mangle successfully, which is needed by SourceKit to be able to use mangled names as unique decl identifiers. I'm also planning to use mangled protocol decls to name generic curry thunk symbols.
This only introduces a mangling for independent associated types. I think we will eventually want to mangle dependent associated types (such as T.AssocType for an archetype T : SomeProtocol) with a non-indexed mangling too, but this doesn't do that yet.
Swift SVN r8148
k = UncurriedFunctionType
k = UncurriedFunctionMetaType
k = Type
k = MetaType
to:
k = UncurriedFunctionType
k = MetaType
This should help Greg parse uncurried functions with greater ease
Swift SVN r7964
A function will now be demangled as:
module.function (args) -> retType vs. module.function : (args) -> retType
Also clearing out a couple warnings that Greg pointed out
Swift SVN r7725
The previous implementation of the tree structure for the demangler had a bug in the low-level tree management code which caused the tree structure to diverge depending on whether
nodes were added as siblings or children. This checkin fixes the issue by making sure that the tree of nodes is kept coherent at all times.
Some adjustments are necessary to ensure the nodes were still generated properly and correctly turned into strings
Added a new test case
Swift SVN r7643
Previously, substitutions were treated as unstructured text chunks, but this was causing problems when using the demangler as a source of structured type information
This patch ensures that substitutions are properly stored as the type they represent for later semantic reconstruction
Swift SVN r7494
This commit changes the Swift demangler to produce a tree-like list of tokens instead of a string.
This is mostly useful for LLDB since we can use the inherent structure in a Swift mangled name to make more informed decisions about matters such as type information extraction from modules
The ability to convert the tokenized output into a plain string for viewing purposes is of course preserved
Swift SVN r7297
These value witness table entries will be conditionally available for types that support specialized union representation through extra inhabitants and/or spare bits and for union value witnesses:
- storeExtraInhabitant, to store an extra inhabitant representation;
- getExtraInhabitantIndex, to recognize an extra inhabitant representation;
- getUnionTag, to get a union's discriminator; and
- inplaceProjectUnionData, to extract the value in place from a union.
This just sets up the enumerators and related IR types and mangling; nothing emits these witnesses yet.
Swift SVN r7234
integration
Motivation: libIDE clients should be simple, and they should not have to
translate token-based SourceRanges to character locations.
This also allows us to remove the dependency of DiagnosticConsumer on the
Lexer. Now the DiagnosticEngine translates the diagnostics to CharSourceRanges
and passes character-based ranges to the DiagnosticConsumer.
Swift SVN r7173
Added a -v(verbose) option to swift that will trigger verbose printing in SIL
Printer. SIL Printer will print the location info only in the verbose mode.
Here is the example of the format - only the line and colon are displayed for
brevity:
%24 = apply %13(%22) : $[cc(method), thin] ((), [byref] Bool) -> Builtin.Int1 // user: %26 line:46:10
(This will be used to test the validity of SILLocation info.)
Swift SVN r6991
around everywhere
Fixes:
rdar://14585108 Code completion does not work at the beginning of the file
rdar://14592634 Code completion returns zero results at EOF in a function
without a closing brace
Swift SVN r6820
We need to handle three cases:
- If a protocol conformance has no associated types, or the associated type witnesses all have statically resolvable metadata, we can expose a *direct* witness table symbol.
- If a protocol conformance has associated types with runtime-instantiated metadata, we need to gate the witness table behind a *lazy* initializer function to fill in the metadata fields.
- If a protocol conformance has associated types where the type or one of its conformances are *dependent* on its parent's generic parameters, we need to instantiate multiple witness tables at runtime.
Swift SVN r6805
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
the debug info, to aid the debugger in figuring out the implementation
language of a given type in multi-language environments.
FYI, where applicable, we also emit the
DW_AT_APPLE_runtime_class(DW_AT_lang_Swift) attribute.
The demangler accepts type names with the "_Tt" prefix without the --type
switch.
Swift SVN r6714