Commit Graph

49 Commits

Author SHA1 Message Date
Pavel Yaskevich
aa89c4f4a8 Revert "[ABI/IRGen] Add custom function parameter flags representation for metadata use"
This reverts commit f6b0d2d2cf.
2017-11-07 00:24:21 -08:00
Pavel Yaskevich
f6b0d2d2cf [ABI/IRGen] Add custom function parameter flags representation for metadata use 2017-11-06 11:16:46 -08:00
Pavel Yaskevich
3f58daba4a [RemoteAST] Extend MetadataReader to collect flags related to function parameters 2017-10-16 16:46:45 -07:00
Pavel Yaskevich
0ccf4fabd7 Merge pull request #12320 from xedin/rdar-31408030
[IRGen/Runtime] Update Function Metadata
2017-10-12 17:45:09 -07:00
Pavel Yaskevich
c5cff769c7 [IRGen] Update Function Metadata to use AnyFunctionType::Param
This changes layout of the parameter metadata from single tuple record
(in case of materializable type) to N records each corresponding to
invididual function parameter, where functions with no parameters
`() -> Void` get 0 records allocated.
2017-10-12 15:58:19 -07:00
Doug Gregor
cd3c63cbfd [AST] Stop including GenericSignature.h in other headers.
Except GenericEnvironment.h, because you can't meaningfully use a
GenericEnvironment without its signature. Lots less depends on
GenericSignature.h now. NFC
2017-10-12 14:23:46 -07:00
Slava Pestov
61639cf971 RemoteAST: Stop looking at parent metadata field 2017-09-25 15:45:16 -07:00
Slava Pestov
737174fe9f AST: Add a DeclContext field to ComponentIdentTypeRepr
Plumb this through and set it appropriately, but don't use it
for anything yet.
2017-07-18 22:10:33 -07:00
John McCall
590af0e373 Fix RemoteAST support for nested types involving generics.
rdar://31981929
2017-07-15 16:22:42 -04:00
Slava Pestov
23ded3cf6f Reflection: Fix crash when reflecting existential with fileprivate protocol member
Fixes <rdar://problem/31661662>, <rdar://problem/31668126>,
and probably many other crashes with the same backtrace.
2017-05-04 15:45:35 -07:00
Jordan Rose
c8d3506e55 Revert "[Mangling] Uniformly use "So" for imported decls." (#9233)
This reverts commit 25985cb764. For now,
we're trying to avoid spurious non-structural changes to the mangling,
so that the /old/ mangling doesn't appear to change. That doesn't mean
no changes at all, but we can save this one for later.
2017-05-03 16:13:29 -07:00
Slava Pestov
f3761c1c2e Reflection: Update for subclass existentials and primitive AnyObject 2017-05-02 02:23:08 -07:00
Jordan Rose
25985cb764 [Mangling] Uniformly use "So" for imported decls.
...and repurpose "SC" for (C)lang-importer-synthesized decls, instead
of just decls that are C-like instead of ObjC-like. (See next commits.)
2017-04-24 09:57:30 -07:00
practicalswift
a596961187 [gardening] Make parameter name comments match actual parameter names 2017-04-20 13:47:10 +02:00
Graydon Hoare
3a79d83233 Forward declare TypeRepr in TypeLoc.h, adjust other code to compensate. 2017-04-18 11:12:53 -07:00
Slava Pestov
d49f8fb6d9 AST: Introduce primitive AnyObject type
Add a 'hasExplicitAnyObject()' bit to ProtocolCompositionType
to represent canonical composition types containing '& AnyObject'.

Serialize this bit and take it into account when building
ExistentialLayouts.

Rename ProtocolCompositionType::getProtocols() to getMembers()
since it can contain classes now, and update a few usages that
need further attention with FIXMEs or asserts.

For now, nothing actually constructs these types, and they will
trigger arounds asserts. Upcoming patches will introduce support
for this.
2017-04-13 21:17:05 -07:00
Erik Eckstein
0f87b5efb2 Remove the useNewMangling function
NFC
2017-03-17 16:10:36 -07:00
Erik Eckstein
7d7dc5aaac Demangler: Use a bump-pointer allocator for node allocation.
This makes the demangler about 10 times faster.
It also changes the lifetimes of nodes. Previously nodes were reference-counted.
Now the returned demangle  node-tree is owned by the Demangler class and it’s lifetime ends with the lifetime of the Demangler.

Therefore the old (and already deprecated) global functions demangleSymbolAsNode and demangleTypeAsNode are no longer available.

Another change is that the demangling for reflection now only supports the new mangling (which should be no problem because
we are generating only new mangled names for reflection).
2017-02-24 19:04:13 -08:00
John McCall
3d9ac50e2c Teach MetadataReader how to skip artificial subclasses,
and improve RemoteAST to provide corresponding APIs.
2017-02-16 15:41:50 -05:00
Erik Eckstein
4d00ac1bba New mangling: add a -new-mangling-for-tests option.
This option enables the new mangling for everything except the Swift stdlib module.
Used to switch test files explicitly to the new mangling.
2017-01-24 15:27:45 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +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
Saleem Abdulrasool
ac6edab22e Merge pull request #6025 from hughbe/remote-msvc
Port swift/remote to Windows and MSVC
2016-12-10 12:54:35 -08:00
Hugh Bellamy
53744b9b5a Fix errors and warnings building swift/remote on Windows using MSVC 2016-12-10 16:05:01 +00:00
Erik Eckstein
11d8207d0e Mangling: Select the correct mangling scheme for the re-mangler in the compiler 2016-12-09 09:05:15 -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
Doug Gregor
8fab641da0 [AST] Simplify DependentMemberType creation and use isTypeParameter() more. NFC 2016-10-06 14:24:55 -07:00
Slava Pestov
173658a5d8 SIL: Round-trip DynamicSelfType properly
When DynamicSelfType occurs outside of a class body (for example,
inside of a SIL function), it is not enough to simply utter 'Self',
because then we lose the underlying type.

Instead, print it out as '@dynamic_self Foo', where 'Foo' is the
underlying class type or archetype, and add parser support for
the same.

Fixes <rdar://problem/27735857>.
2016-08-09 14:18:03 -07:00
Slava Pestov
57c58176bc AST: Remove noreturn bit from function types 2016-07-24 00:15:34 -07:00
Slava Pestov
27b951e1e5 Reflection: Demangling for lowered metatypes
Lowered types appear in capture descriptors.
2016-05-05 13:47:54 -07:00
Slava Pestov
86dae6850c Reflection: Add SILBoxTypeRef, which can come up in capture descriptors 2016-05-02 19:26:12 -07:00
Enrico Granata
01d4fd5a2f This code is supposed to fail when the read fails. Make it so 2016-04-29 14:03:39 -07:00
John McCall
f33c84fb3d RemoteAST: implement getOffsetOfMember for structs and classes. 2016-04-28 16:29:20 -07:00
John McCall
83dc7cffe8 RemoteAST: implement member-offset calculations for tuples. 2016-04-27 19:00:30 -07:00
John McCall
312aa06901 Start fleshing out RemoteAST's storage-offset API. 2016-04-26 16:22:28 -07:00
John McCall
92cf4a6d39 Teach MetadataReader how to handle ObjCClassWrapper metadata. 2016-04-26 13:04:02 -07:00
John McCall
627e2325d3 Read tuple labels in MetadataReader and preserve them in RemoteAST.
The metadata system doesn't actually unique based on labels
correctly, so the test case has to play some games.  That's
something that will be easier to fix when there are fewer
clients poking at the internals of the metadata runtime.
2016-04-25 22:33:41 -07:00
Slava Pestov
c0c02a3148 Reflection: ProtocolTypeRefs now store a mangled name
This is better for field metadata lookups. Clients that want the
module name and decl name can demangle, just like they do with
NominalTypeRefs.
2016-04-25 20:08:49 -07:00
John McCall
56052cfe61 Apparently the right way to look up imported declarations is to just ask the importer to look things up. 2016-04-25 19:03:08 -07:00
John McCall
812557ca24 Reorganization within RemoteAST. Basic error propagation.
Initial stabs towards reading foreign class metadata, although
these do not yet successfully resolve the declaration.
2016-04-25 16:57:19 -07:00
Enrico Granata
bd9e3e4a49 Actually add the getKindForRemoteTypeMetadata entry point to the main RemoteASTContext class 2016-04-25 13:57:43 -07:00
Enrico Granata
5d315ae30b Add a getKindForRemoteTypeMetadata() API to the RemoteAST - LLDB plans to use this API to decide whether certain kinds of existential containers need a two-level type resolution (e.g. if an existential box points to a class, the true type that we want to resolve is the type that the class's ISA refers to, not the static type that the box refers to) 2016-04-25 11:50:03 -07:00
John McCall
5a735b5589 RemoteAST: type-check TypeReprs within a TopLevelCodeDecl
instead of just a ModuleDecl.

Fixes simple generic types.
2016-04-22 18:47:04 -07:00
John McCall
590706a8c6 Pass around address/buffer pairs in the MetadataReader instead of
just the address.  Use this to avoid repeatedly reading metadata so
often (even if it's cached, this is better).  Fix some bugs involving
nominal type parents.
2016-04-21 21:47:14 -07:00
John McCall
eb662ed62f Look through Type nodes in findDeclContext to allow the direct use
of a top-level type demangling.
2016-04-21 16:25:19 -07:00
John McCall
22f193d254 Use the right demangling API when demangling nominal types. 2016-04-21 15:05:34 -07:00
John McCall
17625abbb9 Invoke the type-checker from RemoteAST to build generic types. 2016-04-20 13:53:49 -07:00
John McCall
093009b3ef Enhance the Remote / RemoteAST libraries with an error mechanism.
Nothing is producing meaningful errors yet, however.
2016-04-20 11:44:34 -07:00
John McCall
e758ba3569 Stub out a RemoteAST library for translating remote metadata
pointers into a local AST.

This is intended primarily for the use of LLDB and does not have
a stable ABI.
2016-04-19 16:36:57 -07:00