Files
swift-mirror/stdlib/toolchain/Compatibility50/Overrides.h
Joe Groff ca48939816 Compatibility51: Backport the 5.2 implementation of the conformance cache.
The runtime that shipped with Swift 5.1 and earlier had a bug that interfered with backward
deployment of binaries that dynamically check for protocol conformances on conditionally-available
tests. This was fixed in the top-of-tree Swift runtime by https://github.com/apple/swift/pull/29887;
however, that doesn't do much good for running binaries on older OSes that don't have that fix.
In order for binaries built with a newer Swift compiler to run successfully on older OSes,
introduce a compatibility hook that replaces the conformance cache implementation in the original
OS runtime with a version based on the current implementation that has the fix for the protocol
conformance bug. Fixes rdar://problem/59460603
2020-04-24 10:52:29 -07:00

31 lines
1.0 KiB
C++

//===--- Overrides.h --- Compat overrides for Swift 5.0 runtime ----s------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file provides compatibility override hooks for Swift 5.0 runtimes.
//
//===----------------------------------------------------------------------===//
#include "swift/Basic/LLVM.h"
#include "swift/Runtime/Metadata.h"
namespace swift {
using ConformsToProtocol_t =
const WitnessTable *(const Metadata *, const ProtocolDescriptor *);
const WitnessTable *
swift50override_conformsToProtocol(const Metadata * const type,
const ProtocolDescriptor *protocol,
ConformsToProtocol_t *original);
}