[ABI] Add the protocol conformance descriptor into a witness table.

Extend witness tables with a pointer to the protocol conformance
descriptor from which the witness table was generated. This will allow
us to determine (for example) whether two witness tables were
generated from the same (or equivalent) conformances in the future, as
well as discover more information about the witness table itself.

Fixes rdar://problem/36287959.
This commit is contained in:
Doug Gregor
2018-01-18 15:46:20 -08:00
parent 30589121e6
commit 40283f9b73
36 changed files with 208 additions and 124 deletions

View File

@@ -2682,6 +2682,12 @@ namespace {
// protocol _ObjectiveCBridgeable {
struct _ObjectiveCBridgeableWitnessTable {
/// The protocol conformance descriptor.
const void *protocolConformanceDescriptor;
static_assert(WitnessTableFirstRequirementOffset == 1,
"Witness table layout changed");
// associatedtype _ObjectiveCType : class
const Metadata * (*ObjectiveCType)(
const Metadata *parentMetadata,