Commit Graph

12 Commits

Author SHA1 Message Date
Arnold Schwaighofer
9d8c381ab4 Remove resilient tag indices 2018-03-20 13:19:56 -07:00
Joe Groff
7f9e322d98 [+0-all-args] Knock out some inappropriate "unreachable"s in the runtime.
Future Swifts may add new metadata kinds, so it isn't appropriate to crash when
we see one. In the case of reflection, we can fall back to opaque behavior.

rdar://34222540
2018-03-09 22:44:04 -08:00
John McCall
f2bb319bdb Change the pattern of generic class metadata instantiation.
Minimize the generic class metadata template by removing the
class header and base-class members.  Add back the set of
information that's really required for instantiation.
Teach swift_allocateGenericClass how to allocate classes without
superclass metadata.  Reorder generic initialization to establish
a stronger phase-ordering between allocation (the part that doesn't
really care about the generic arguments) and initialization (the
part that really does care about the generic arguments and therefore
might need to be delayed to handle metadata cycles).

A similar thing needs to happen for resilient class relocation.
2018-03-04 00:01:56 -05: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
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
Mike Ash
03476e919e Merge branch 'master' into remove-reflectionlegacy 2018-02-22 11:44:55 -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
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
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