Commit Graph

1960 Commits

Author SHA1 Message Date
swift-ci
beab182f92 Merge remote-tracking branch 'origin/master' into master-next 2018-02-28 18:52:15 -08:00
Bob Wilson
b124a51570 Merge pull request #14880 from bob-wilson/sr7038
Restore build and install of the swiftImageInspectionShared library
2018-02-28 18:38:44 -08:00
swift-ci
d4e8e40537 Merge remote-tracking branch 'origin/master' into master-next 2018-02-28 17:32:08 -08:00
Saleem Abdulrasool
6d1f4f0b55 Merge pull request #14879 from compnerd/windows-stubs
Windows stubs
2018-02-28 17:25:44 -08:00
swift-ci
631ba2828d Merge remote-tracking branch 'origin/master' into master-next 2018-02-28 13:31:35 -08:00
Bob Wilson
a62cfa0de9 Restore build and install of the swiftImageInspectionShared library
Commit 0c42b57962 ("ELF: restructure image metadata registration")
removed the swift_install_in_component lines for both
swiftImageInspectionStatic and swiftImageInspectionShared libraries,
even though only the former library was removed in that change. As a
result, the swiftImageInspectionShared was not being built or
installed. This should fix SR-7038.
rdar://problem/37710244
2018-02-28 11:22:52 -08:00
Saleem Abdulrasool
c6eed1f19b runtime: make Windows build again
Windows does not have `strndup` and `asprintf`.  Provide equivalents in
terms of other available APIs.  This enables us to build the standard
library for Windows again.
2018-02-28 11:16:18 -08:00
Saleem Abdulrasool
0393bd6b51 runtime: add initializeTypeFieldLookup on COFF
The runtime needs this method to initialize the type fields when loading
the images.  This was added to the ELF side of the initialization path
but not the COFF side.  It repairs the swiftCore.dll build for Windows.
2018-02-28 11:09:26 -08:00
swift-ci
00dfc9cff2 Merge remote-tracking branch 'origin/master' into master-next 2018-02-28 08:12:19 -08:00
John McCall
4e49329393 Make is-reflectable a type descriptor flag instead of a separate field.
Also fix a test for 32-bit compatibility.
2018-02-28 00:38:00 -05:00
John McCall
8d93cee012 Add a superclass reference to class descriptors. 2018-02-28 00:38:00 -05:00
swift-ci
96b5717d8f Merge remote-tracking branch 'origin/master' into master-next 2018-02-26 11:09:40 -08:00
John McCall
dd99536d31 Move the metadata-pattern header into the type context descriptor.
This is yet another waypoint on the path towards the final
generic-metadata design.  The immediate goal is to make the
pattern a private implementation detail and to give the runtime
more visibility into the allocation and caching of generic types.
2018-02-26 12:10:24 -05:00
swift-ci
fbf8af847b Merge remote-tracking branch 'origin/master' into master-next 2018-02-23 23:11:13 -08:00
Michael Gottesman
ba9946a131 Add a dumper/verifier for OpaqueExistentialContainers (i.e. Any) in c++.
The dumper method dumps:

1. The container's metadata pointer.
2. A pointer to the container's value.
3. Whether or not said value is stored inline in the container.

This provides a general overview that can be used even when working with SIL
code in the debugger by grabbing a pointer to swift Anys and then calling the
c++ any method upon them.

The verifier is intended to be used in conjunction with ASAN for maximum
effect to catch use-after-frees of existential boxes.

While implementing this I refactored some code from ExistentialTypeMetadata into
methods on OpaqueExistentialContainer. ExistentialTypeMetadata just calls these
methods now instead of implementing the code inline.
2018-02-23 23:03:55 -08:00
swift-ci
a1dc2330aa Merge remote-tracking branch 'origin/master' into master-next 2018-02-22 14:32:06 -08:00
Mike Ash
35e4d1e07a Merge branch 'master' into remove-reflectionlegacy 2018-02-22 14:44:41 -05:00
Mike Ash
03476e919e Merge branch 'master' into remove-reflectionlegacy 2018-02-22 11:44:55 -05:00
swift-ci
fc39bb57bb Merge remote-tracking branch 'origin/master' into master-next 2018-02-21 17:45:02 -08:00
Pavel Yaskevich
9288b71b60 [MetadataLookup] Enable field descriptor cache 2018-02-21 15:26:19 -08:00
Mike Ash
c250a844d0 [Runtime] Add a declaration for swift_demangle to the header file and export it.
rdar://problem/20356017
2018-02-21 17:22:09 -05:00
Mike Ash
50697a7778 [Runtime] Guard ReflectionMirror's vw_destroy call to avoid emitting it when +0 is enabled.
rdar://problem/20356017
2018-02-21 14:33:05 -05:00
Mike Ash
29eb740bf3 [Runtime] Style fixes in new ReflectionMirror code.
rdar://problem/20356017
2018-02-21 14:32:17 -05:00
swift-ci
c93e69746b Merge remote-tracking branch 'origin/master' into master-next 2018-02-21 10:59:05 -08:00
swift-ci
8a1cc43d82 Merge remote-tracking branch 'origin/master' into master-next 2018-02-20 19:18:13 -08:00
Pavel Yaskevich
94017f7ee7 [IRGen] Remove 'FieldNames' field from type context descriptor
All of the information contained by this field (list of property names)
is already encoded as part of the field reflection metadata and
is accessible via `swift_getFieldAt` runtime method.
2018-02-20 18:49:00 -08:00
Joe Groff
eb316818c5 Demangler: Fill in places we need to handle symbolic references and OtherNominalTypes when demangling bound generic types. 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
194c84e0a4 [MetadataLookup] Properly setup Demangler symbolic ref resolver 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
3323ae36bf [Metadata] Use ownership info from _typeByMangledName 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
7bcd7306c0 [Runtime/Metadata] Move swift_getFieldAt to new generic context framework 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
50785df558 [Runtime] NFC: Update names of the field section to swift5_fieldmd 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
7a7825ff50 [Runtime/Reflection] Switch enum mirrors to use runtime get field method 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
877c70bae9 [Runtime/Metadata] Add support for dynamic field descriptor registration 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
c44ad571c8 [Runtime/ABI] Add ownership info to the name-to-type metadata builder 2018-02-20 18:20:09 -08:00
Pavel Yaskevich
0da5e48a0e [Runtime/Reflection] Add swift_getFieldAt runtime accessor
Use information from reflection section of the binary to lookup
type field info such as name and it's type and return it using
new `swift_getFieldAt` method based on nominal type and field index.
2018-02-20 18:20:09 -08:00
Pavel Yaskevich
bc1c170a45 [Runtime] Register type field metadata section 2018-02-20 18:18:48 -08:00
John McCall
23fa44e56c Render TypeContextDescriptor into a proper hierarchy; NFC.
The purpose here is to make it easier to add type-specific fields to the
descriptor.
2018-02-20 15:20:32 -05:00
Mike Ash
0cff498db4 [Reflection] Use getClassObject() when testing for ObjCness rather than blindly casting to ClassMetada, which turns out to be completely incorrect. 2018-02-20 15:15:14 -05:00
swift-ci
aa5c530a36 Merge remote-tracking branch 'origin/master' into master-next 2018-02-19 17:09:06 -08:00
Pavel Yaskevich
855e2286cd [Metadata/TypeByName] Don't try to check for dot syntax in presence of symbolic references
If symbolic references are present in the mangled name don't try
to check for convenience dot syntax as well since they can't appear
together.
2018-02-19 14:54:34 -08:00
Mike Ash
fa2ea034d1 Merge branch 'master' into remove-reflectionlegacy 2018-02-19 09:56:57 -05:00
Mike Ash
44d9b2f5cd [Runtime] Move swift_demangle to Demangle.cpp. It seems more at home there. 2018-02-16 16:55:11 -05:00
Mike Ash
33990583df [Runtime] Have ReflectionMirror.mm get SwiftObject declarations from SwiftObject.h. 2018-02-16 16:20:12 -05:00
Mike Ash
4045edf886 [Runtime] Remove old-style mirrors in ReflectionLegacy.swift.
The old-style mirrors were the basis for non-custom, reflection based Mirrors. As part of removing old-style mirrors, reflection based Mirrors are reimplemented without them. Reflection.mm is deleted and replaced with ReflectionMirror.mm, which borrows a chunk of the old code but presents a simpler API to the Swift side. ReflectionMirror.swift then uses that API to implement a reflection-based Mirror init.

rdar://problem/20356017
2018-02-16 16:05:40 -05:00
swift-ci
91376db8cb Merge remote-tracking branch 'origin/master' into master-next 2018-02-16 11:29:49 -08:00
Doug Gregor
800e3818b7 [Type metadata] @objc protocol conformance requirements don't have arguments.
@objc protocols don't have witness tables. However, both type metadata
(in the nominal type descriptors) and the runtime code to demangle
type names into metadata weren't acknowledging this. Fix type metadata
emission to not count an "extra argument" for @objc protocol
conformance requirements, and teach the runtime code to properly look
for conformances to @objc protocols (through the Objective-C runtime)
and not record witness tables for them.
2018-02-15 14:07:46 -08:00
swift-ci
934240baba Merge remote-tracking branch 'origin/master' into master-next 2018-02-14 22:29:26 -08:00
Pavel Yaskevich
33996de39c Merge pull request #14649 from xedin/objc-existential-type-by-name
[Runtime] Existential types marked as @objc should satisfy class requirement
2018-02-14 22:28:37 -08:00
Pavel Yaskevich
73f09ecbf5 [Runtime] Existential types marked as @objc should satisfy class requirement
Make sure that `checkGenericRequirements` properly enforces
"class requirement" constraint on the generic parameters.
2018-02-14 21:16:44 -08:00
swift-ci
6dd6a9213b Merge remote-tracking branch 'origin/master' into master-next 2018-02-14 15:49:04 -08:00