Skip to content

Commit 22c4832

Browse files
committed
---
yaml --- r: 345334 b: refs/heads/master c: 2bbf2c5 h: refs/heads/master
1 parent 4cd10bd commit 22c4832

21 files changed

+691
-325
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: c2f9ba7c271d5ea4a7a0f1e7c71ad7a80bc42f12
2+
refs/heads/master: 2bbf2c5f272e03265d84fb02f61fda7cf42f0bcf
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/AST/DiagnosticsModuleDiffer.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ ERROR(super_class_removed,none,"%0 has removed its super class %1", (StringRef,
7272

7373
ERROR(super_class_changed,none,"%0 has changed its super class from %1 to %2", (StringRef, StringRef, StringRef))
7474

75+
ERROR(nominal_type_kind_changed,none,"%0 has been changed to a %1", (StringRef, StringRef))
76+
7577
#ifndef DIAG_NO_UNDEF
7678
# if defined(DIAG)
7779
# undef DIAG

trunk/include/swift/Runtime/Metadata.h

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,39 @@ void swift_initStructMetadata(StructMetadata *self,
580580
///
581581
/// This function is only intended to be called from the relocation function
582582
/// of a resilient class pattern.
583+
///
584+
/// The metadata completion function must complete the metadata by calling
585+
/// swift_initClassMetadata().
583586
SWIFT_RUNTIME_EXPORT
584587
ClassMetadata *
585588
swift_relocateClassMetadata(ClassDescriptor *descriptor,
586589
ResilientClassMetadataPattern *pattern);
587590

588-
/// Initialize the field offset vector for a dependent-layout class, using the
589-
/// "Universal" layout strategy.
591+
/// Initialize various fields of the class metadata.
592+
///
593+
/// Namely:
594+
/// - The superclass field is set to \p super.
595+
/// - If the class metadata was allocated at runtime, copies the
596+
/// vtable entries from the superclass and installs the class's
597+
/// own vtable entries and overrides of superclass vtable entries.
598+
/// - Copies the field offsets and generic parameters and conformances
599+
/// from the superclass.
600+
/// - Initializes the field offsets using the runtime type layouts
601+
/// passed in \p fieldTypes.
602+
///
603+
/// This initialization pattern in the following cases:
604+
/// - The class has generic ancestry, or resiliently-sized fields.
605+
/// In this case the metadata was emitted statically but is incomplete,
606+
/// because, the superclass field, generic parameters and conformances,
607+
/// and field offset vector entries require runtime completion.
608+
///
609+
/// - The class is not generic, and has resilient ancestry.
610+
/// In this case the class metadata was allocated from a resilient
611+
/// class metadata pattern by swift_relocateClassMetadata().
612+
///
613+
/// - The class is generic.
614+
/// In this case the class metadata was allocated from a generic
615+
/// class metadata pattern by swift_allocateGenericClassMetadata().
590616
SWIFT_RUNTIME_EXPORT
591617
void swift_initClassMetadata(ClassMetadata *self,
592618
ClassMetadata *super,
@@ -595,6 +621,24 @@ void swift_initClassMetadata(ClassMetadata *self,
595621
const TypeLayout * const *fieldTypes,
596622
size_t *fieldOffsets);
597623

624+
#if SWIFT_OBJC_INTEROP
625+
/// Initialize various fields of the class metadata.
626+
///
627+
/// This is a special function only used to re-initialize metadata of
628+
/// classes that are visible to Objective-C and have resilient fields.
629+
///
630+
/// This means the class does not have generic or resilient ancestry,
631+
/// and is itself not generic. However, it might have fields whose
632+
/// size is not known at compile time.
633+
SWIFT_RUNTIME_EXPORT
634+
void swift_updateClassMetadata(ClassMetadata *self,
635+
ClassMetadata *super,
636+
ClassLayoutFlags flags,
637+
size_t numFields,
638+
const TypeLayout * const *fieldTypes,
639+
size_t *fieldOffsets);
640+
#endif
641+
598642
/// Given class metadata, a class descriptor and a method descriptor, look up
599643
/// and load the vtable entry from the given metadata. The metadata must be of
600644
/// the same class or a subclass of the descriptor.

trunk/include/swift/Runtime/RuntimeFunctions.def

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,21 @@ FUNCTION(InitClassMetadata,
773773
SizeTy->getPointerTo()),
774774
ATTRS(NoUnwind))
775775

776+
// struct FieldInfo { size_t Size; size_t AlignMask; };
777+
// void swift_updateClassMetadata(Metadata *self,
778+
// Metadata *super,
779+
// ClassLayoutFlags flags,
780+
// size_t numFields,
781+
// TypeLayout * const *fieldTypes,
782+
// size_t *fieldOffsets);
783+
FUNCTION(UpdateClassMetadata,
784+
swift_updateClassMetadata, C_CC,
785+
RETURNS(VoidTy),
786+
ARGS(TypeMetadataPtrTy, TypeMetadataPtrTy, SizeTy, SizeTy,
787+
Int8PtrPtrTy->getPointerTo(),
788+
SizeTy->getPointerTo()),
789+
ATTRS(NoUnwind))
790+
776791
// void *swift_lookUpClassMethod(Metadata *metadata,
777792
// ClassDescriptor *description,
778793
// MethodDescriptor *method);

0 commit comments

Comments
 (0)