Commit Graph

45 Commits

Author SHA1 Message Date
Mike Ash
b51b60b227 [RemoteMirror] Add missing test.swift file for interop tests. 2019-03-25 20:51:17 -04:00
Mike Ash
2b89074944 [RemoteMirror] Add a call to the interop header to set the upcoming classIsSwiftMask value. 2019-02-13 14:59:05 -05:00
Slava Pestov
13a50c2d2d ASTDemangler: Add support for lowered metatypes 2019-01-29 19:15:17 -05:00
Slava Pestov
bbe6a56e22 ASTDemangler: Implement builtin types 2019-01-25 21:44:02 -05:00
Mike Ash
4ae12f3c3b [RemoteMirror] Fix lint errors in RemoteMirrorInterop/test.py, and make relative path args work when the working directory is not the script's enclosing directory. 2018-11-26 11:12:16 -05:00
Mike Ash
47be50cccc [RemoteMirror] Update interop to handle 4.2 libraries.
The Remote Mirror interop header now accepts an arbitrary number of remote mirror libraries so that it can have 4.1, 4.2, and 5.0 loaded side by side.

rdar://problem/45808282
2018-11-26 11:12:16 -05:00
Slava Pestov
d093fcb4a4 Reflection: Decode imported Objective-C classes and protocols as their own TypeRef
Right now we expect that every class and protocol has a field
descriptor that tells us if the entity is @objc or not.

For imported types, the descriptor will not exist if we did not
directly emit a field whose concrete type contains the imported
type. For example, in lldb, we might have a generic type whose
runtime substituted type includes an imported type.

In this case, TypeLowering would fail to produce a layout because
it did not find a field descriptor for the imported type.

A better approach is to have the TypeDecoder call a different
factory method for imported types, and handle them specially in
TypeLowering, bypassing the field type metadata altogether.
2018-11-02 00:47:11 -04:00
Mike Ash
979b75699a Merge branch 'master' into remotemirror-hide-reflection-sections 2018-03-16 16:24:57 -04:00
Mike Ash
32b48f4082 [RemoteMirrors] Use RTLD_LOCAL when loading the remote mirrors dylibs in the test program to avoid symbol clashes when loading two of them.
rdar://problem/37538580
2018-03-08 13:25:41 -05:00
Mike Ash
ac026128d1 [RemoteMirrors] Provide interop function for converting a raw metadata pointer into a swift_metadata_interop_t.
rdar://problem/37538580
2018-03-08 13:25:09 -05:00
Mike Ash
0e3044bd3a [RemoteMirrors] Provide interop types for typeinfo and childinfo.
rdar://problem/37538580
2018-03-08 10:28:11 -05:00
swift-ci
57e2fd3b52 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-03-07 18:38:16 -08:00
Huon Wilson
38029bab2a [ABI] Store a ValueOwnership directly, not a manual encoding of it. 2018-03-08 12:36:37 +11:00
swift-ci
eade62b1c0 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-03-05 10:18:36 -08:00
Mike Ash
83837ccd12 [RemoteMirrors] Clean up some documentation, comments and macros. Add an assert for pointer sizes that don't match what SwiftRemoteMirror.cpp was built with. 2018-03-01 15:39:14 -05:00
Mike Ash
b3522fa139 [RemoteMirrors] Read the TEXT segment into local memory when getting legacy reflection sections. Test that this works when memory is read into a dynamic buffer. 2018-03-01 13:56:29 -05:00
Mike Ash
c059ff2a5c [RemoteMirrors] Fix the ownership check for legacy libraries. The working implementation requires a non-legacy library to be present. Fall back to always saying "yes" otherwise. 2018-02-27 17:06:37 -05:00
Mike Ash
0b5876607e [RemoteMirrors] Implement object ownership interop for the legacy library. This avoids crashing when inspecting newer metadata with only the legacy library loaded. 2018-02-27 15:16:16 -05:00
Mike Ash
16c571f65f [RemoteMirrors] Make the test script work when executed from a different directory. 2018-02-27 15:16:15 -05:00
Mike Ash
71f1c391ab [RemoteMirrors] Move FreeBytesFunction from an out-parameter on ReadBytesFunction to a function pointer passed in when creating a reflection context. 2018-02-27 12:51:04 -05:00
Mike Ash
ff3a3ec44f [Reflection] Add some ad-hoc manually-run tests for the remote mirrors interop header.
rdar://problem/37538580
2018-02-26 16:40:09 -05:00
swift-ci
5e0546030e Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-06 09:59:05 -08:00
Arnold Schwaighofer
d981bb1d96 Mangling: noescape functions will be trivial and no longer compatible with escape function types.
Mangle escapeness as part of the type.

Part of:
SR-5441
rdar://36116691
2018-02-06 08:51:43 -08:00
swift-ci
621e99055a Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-09 16:14:46 -08:00
Doug Gregor
61884f7702 [Type decoder] Rework the builder contract for protocols.
TypeDecoder's interface with its builders already treated protocols as
a type (due to their being mangled as "protocol composition containing
one type"), and intermixed protocols with superclasses when forming
compositions. This makes for some awkwardness when working with
protocol descriptors, which are very much a distinct entity from a
type.

Separate out the notion of a "protocol declaration" (now represented
by the builder-provided BuiltProtocolDecl type) from "a protocol
composition containing a single type", similarly to the way we handle
nominal type declarations. Teach remote mirrors and remote AST to
handle the new contract.
2018-01-09 10:46:31 -08:00
Bob Wilson
390058972a [master-next] Use PRIVATE in target_link_libraries for executables
This is needed to work with LLVM r319840.
2017-12-06 21:55:22 -08:00
Pavel Yaskevich
622cc1c64a [ABI/IRGen] Add custom function parameter flags representation for metadata use 2017-11-07 12:45:32 -08:00
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
51d9542a2a [Reflection] Add label and flags to function type reference parameters 2017-10-16 16:46:45 -07:00
Pavel Yaskevich
3f58daba4a [RemoteAST] Extend MetadataReader to collect flags related to function parameters 2017-10-16 16:46:45 -07:00
Greg Parker
dd38ace506 [runtime] Fix more const cast warnings. (#11725)
* [runtime] Fix more const cast warnings.
2017-09-05 13:13:01 -07: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
Slava Pestov
f3761c1c2e Reflection: Update for subclass existentials and primitive AnyObject 2017-05-02 02:23:08 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
c6c6d5859d Reflection: Fixes for deriveSubstitutions() patch
Somehow ninja didn't rebuild everything, so I ended up pushing code
that didn't compile. I did a clean re-build and fixed a minor issue
in the logic, now the test passes.
2016-05-05 22:54:29 -07:00
Slava Pestov
73b1bd8f4e Reflection: Add TypeRef::deriveSubstitutions()
When deriving substitutions from closure contexts, we end up with
a problem where we have an original type and a substituted type,
and the original type is not necessarily a type parameter.
We need to decompose the original and substituted types to derive
the substitutions that produced the substitution.

For example, deriveSubstitutions(Foo<T -> Int>, Foo<String -> Int>)
will give us a substitution of T := Int.
2016-05-05 22:28:48 -07:00
Slava Pestov
a62d414086 Reflection: Add TypeRef::isConcreteAfterSubstitutions()
This is needed for closure context layout.
2016-05-05 22:28:48 -07:00
Slava Pestov
5858756651 Reflection: Correct handling of nested types in TypeRef substitution 2016-05-05 22:28:48 -07:00
practicalswift
8e3ba900b0 [gardening] Fix recently introduced headers. 2016-05-01 12:59:13 +02:00
David Farler
bfed7d0e01 unittest/Reflection: Test that TypeRefs remain unique after substitution
A TypeRef for C<T, U>, substituted to C<Int, Int>, should have the same
pointer identity as a C<Int, Int> created by other means. This prevents
repeating reflective layout work if we've already seen a particular
instantiation of a generic type.
2016-04-28 15:14:00 -07:00
David Farler
8e0412f84f Don't include Parent pointer in Nominal/BoundGeneric TypeRef uniquing
This information is already in the mangled type name.
2016-04-26 01:11:31 -07:00
David Farler
defe2b17a2 Include WasAbstract flag when uniquing MetatypeTypeRef 2016-04-26 00:11:46 -07:00
David Farler
50440abcd0 TypeRef Uniquing
We'd like to be able to compare TypeRefs with pointer equality,
but we can't link LLVMSupport, so make a lightweight TypeRefID
like FoldingSetID, that only supports the input types necessary
to unique TypeRefs.

rdar://problem/25924875
2016-04-25 23:56:28 -07:00