mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC] Rename swift_runtime_unreachable to swift_unreachable and make it use LLVM's support when available.
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include "swift/Basic/RelativePointer.h"
|
||||
#include "swift/Demangling/Demangle.h"
|
||||
#include "swift/Demangling/ManglingMacros.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "../../../stdlib/public/SwiftShims/HeapObject.h"
|
||||
#if SWIFT_OBJC_INTEROP
|
||||
#include <objc/runtime.h>
|
||||
@@ -4664,7 +4664,7 @@ int32_t TargetTypeContextDescriptor<Runtime>::getGenericArgumentOffset() const {
|
||||
return llvm::cast<TargetStructDescriptor<Runtime>>(this)
|
||||
->getGenericArgumentOffset();
|
||||
default:
|
||||
swift_runtime_unreachable("Not a type context descriptor.");
|
||||
swift_unreachable("Not a type context descriptor.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4682,7 +4682,7 @@ TargetTypeContextDescriptor<Runtime>::getFullGenericContextHeader() const {
|
||||
return llvm::cast<TargetStructDescriptor<Runtime>>(this)
|
||||
->getFullGenericContextHeader();
|
||||
default:
|
||||
swift_runtime_unreachable("Not a type context descriptor.");
|
||||
swift_unreachable("Not a type context descriptor.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4699,7 +4699,7 @@ TargetTypeContextDescriptor<Runtime>::getGenericParams() const {
|
||||
case ContextDescriptorKind::OpaqueType:
|
||||
return llvm::cast<TargetOpaqueTypeDescriptor<Runtime>>(this)->getGenericParams();
|
||||
default:
|
||||
swift_runtime_unreachable("Not a type context descriptor.");
|
||||
swift_unreachable("Not a type context descriptor.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4717,7 +4717,7 @@ TargetTypeContextDescriptor<Runtime>::getForeignMetadataInitialization() const {
|
||||
return llvm::cast<TargetStructDescriptor<Runtime>>(this)
|
||||
->getForeignMetadataInitialization();
|
||||
default:
|
||||
swift_runtime_unreachable("Not a type context descriptor.");
|
||||
swift_unreachable("Not a type context descriptor.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4735,7 +4735,7 @@ TargetTypeContextDescriptor<Runtime>::getSingletonMetadataInitialization() const
|
||||
return llvm::cast<TargetClassDescriptor<Runtime>>(this)
|
||||
->getSingletonMetadataInitialization();
|
||||
default:
|
||||
swift_runtime_unreachable("Not a enum, struct or class type descriptor.");
|
||||
swift_unreachable("Not a enum, struct or class type descriptor.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4753,7 +4753,7 @@ TargetTypeContextDescriptor<Runtime>::getCanonicicalMetadataPrespecializations()
|
||||
return llvm::cast<TargetClassDescriptor<Runtime>>(this)
|
||||
->getCanonicicalMetadataPrespecializations();
|
||||
default:
|
||||
swift_runtime_unreachable("Not a type context descriptor.");
|
||||
swift_unreachable("Not a type context descriptor.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef SWIFT_ABI_PROTOCOLDISPATCHSTRATEGY_H
|
||||
#define SWIFT_ABI_PROTOCOLDISPATCHSTRATEGY_H
|
||||
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
|
||||
namespace swift {
|
||||
|
||||
@@ -46,7 +46,7 @@ inline bool protocolRequiresWitnessTable(ProtocolDispatchStrategy strategy) {
|
||||
return true;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled ProtocolDispatchStrategy in switch.");
|
||||
swift_unreachable("Unhandled ProtocolDispatchStrategy in switch.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//===--- Unreachable.h - Implements swift_runtime_unreachable ---*- C++ -*-===//
|
||||
//===--- Unreachable.h - Implements swift_unreachable ---*- C++ -*-===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
@@ -10,13 +10,25 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines swift_runtime_unreachable, an LLVM-independent
|
||||
// implementation of llvm_unreachable.
|
||||
// This file defines swift_unreachable, which provides the
|
||||
// functionality of llvm_unreachable without necessarily depending on
|
||||
// the LLVM support libraries.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef SWIFT_RUNTIME_UNREACHABLE_H
|
||||
#define SWIFT_RUNTIME_UNREACHABLE_H
|
||||
#ifndef SWIFT_BASIC_UNREACHABLE_H
|
||||
#define SWIFT_BASIC_UNREACHABLE_H
|
||||
|
||||
#ifdef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
|
||||
|
||||
// The implementation when LLVM is available.
|
||||
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#define swift_unreachable llvm_unreachable
|
||||
|
||||
#else
|
||||
|
||||
// The implementation when LLVM is not available.
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
@@ -24,10 +36,12 @@
|
||||
#include "swift/Runtime/Config.h"
|
||||
|
||||
SWIFT_RUNTIME_ATTRIBUTE_NORETURN
|
||||
inline static void swift_runtime_unreachable(const char *msg) {
|
||||
inline static void swift_unreachable(const char *msg) {
|
||||
assert(false && msg);
|
||||
(void)msg;
|
||||
abort();
|
||||
}
|
||||
|
||||
#endif // SWIFT_RUNTIME_UNREACHABLE_H
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "swift/Demangling/Demangler.h"
|
||||
#include "swift/Demangling/NamespaceMacros.h"
|
||||
#include "swift/Runtime/Portability.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Strings.h"
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include <vector>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "swift/Reflection/TypeLowering.h"
|
||||
#include "swift/Reflection/TypeRef.h"
|
||||
#include "swift/Reflection/TypeRefBuilder.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
@@ -1302,7 +1302,7 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled MetadataSourceKind in switch.");
|
||||
swift_unreachable("Unhandled MetadataSourceKind in switch.");
|
||||
}
|
||||
|
||||
/// Read metadata for a captured generic type from a closure context.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "swift/ABI/MetadataValues.h"
|
||||
#include "swift/Remote/MetadataReader.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
|
||||
namespace swift {
|
||||
namespace reflection {
|
||||
@@ -856,7 +856,7 @@ public:
|
||||
#include "swift/Reflection/TypeRefs.def"
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled TypeRefKind in switch.");
|
||||
swift_unreachable("Unhandled TypeRefKind in switch.");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "swift/ABI/TypeIdentity.h"
|
||||
#include "swift/Runtime/ExistentialContainer.h"
|
||||
#include "swift/Runtime/HeapObject.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
@@ -923,7 +923,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled MetadataKind in switch");
|
||||
swift_unreachable("Unhandled MetadataKind in switch");
|
||||
}
|
||||
|
||||
TypeLookupErrorOr<typename BuilderType::BuiltType>
|
||||
@@ -1295,7 +1295,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled IsaEncodingKind in switch.");
|
||||
swift_unreachable("Unhandled IsaEncodingKind in switch.");
|
||||
}
|
||||
|
||||
/// Read the offset of the generic parameters of a class from the nominal
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define SWIFT_RUNTIME_DEBUG_HELPERS_H
|
||||
|
||||
#include "swift/Runtime/Config.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include <atomic>
|
||||
#include <cstdarg>
|
||||
#include <functional>
|
||||
@@ -79,7 +79,7 @@ static inline void crash(const char *message) {
|
||||
CRSetCrashLogMessage(message);
|
||||
|
||||
SWIFT_RUNTIME_BUILTIN_TRAP;
|
||||
swift_runtime_unreachable("Expected compiler to crash.");
|
||||
swift_unreachable("Expected compiler to crash.");
|
||||
}
|
||||
|
||||
// swift::fatalError() halts with a crash log message,
|
||||
|
||||
@@ -9,6 +9,8 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
set_swift_llvm_is_available()
|
||||
|
||||
add_swift_host_library(swiftAST STATIC
|
||||
AbstractSourceFileDepGraphFactory.cpp
|
||||
AccessRequests.cpp
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set_swift_llvm_is_available()
|
||||
|
||||
add_swift_host_library(swiftASTSectionImporter STATIC
|
||||
ASTSectionImporter.cpp
|
||||
LLVM_LINK_COMPONENTS core)
|
||||
|
||||
@@ -4,6 +4,8 @@ set(SWIFT_GYB_FLAGS
|
||||
add_gyb_target(generated_sorted_cf_database
|
||||
SortedCFDatabase.def.gyb)
|
||||
|
||||
set_swift_llvm_is_available()
|
||||
|
||||
add_swift_host_library(swiftClangImporter STATIC
|
||||
CFTypeInfo.cpp
|
||||
ClangAdapter.cpp
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set_swift_llvm_is_available()
|
||||
|
||||
set(swiftDriver_sources
|
||||
Action.cpp
|
||||
Compilation.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftFrontend STATIC
|
||||
ArgsToFrontendInputsConverter.cpp
|
||||
ArgsToFrontendOptionsConverter.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftFrontendTool STATIC
|
||||
FrontendTool.cpp
|
||||
ImportedModules.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftIDE STATIC
|
||||
CodeCompletion.cpp
|
||||
CodeCompletionCache.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftIRGen STATIC
|
||||
AllocStackHoisting.cpp
|
||||
ClassLayout.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftLLVMPasses STATIC
|
||||
LLVMSwiftAA.cpp
|
||||
LLVMSwiftRCIdentity.cpp
|
||||
|
||||
@@ -47,6 +47,8 @@ swift_install_in_component(FILES ${datafiles}
|
||||
DESTINATION "lib/swift/migrator"
|
||||
COMPONENT compiler)
|
||||
|
||||
set_swift_llvm_is_available()
|
||||
|
||||
add_swift_host_library(swiftMigrator STATIC
|
||||
APIDiffMigratorPass.cpp
|
||||
EditorAdapter.cpp
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set_swift_llvm_is_available()
|
||||
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
|
||||
set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"")
|
||||
else()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftPrintAsObjC STATIC
|
||||
DeclAndTypePrinter.cpp
|
||||
ModuleContentsWriter.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftSIL STATIC
|
||||
SIL.cpp)
|
||||
target_link_libraries(swiftSIL PUBLIC
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftSILGen STATIC
|
||||
ArgumentSource.cpp
|
||||
Cleanup.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftSILOptimizer STATIC
|
||||
SILOptimizer.cpp)
|
||||
target_link_libraries(swiftSILOptimizer PRIVATE
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftSema STATIC
|
||||
BuilderTransform.cpp
|
||||
CSApply.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftSerialization STATIC
|
||||
Deserialization.cpp
|
||||
DeserializeSIL.cpp
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftSyntaxParse STATIC
|
||||
RawSyntaxTokenCache.cpp
|
||||
SyntaxTreeCreator.cpp)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set_swift_llvm_is_available()
|
||||
add_swift_host_library(swiftTBDGen STATIC
|
||||
TBDGen.cpp
|
||||
TBDGenRequests.cpp
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "swift/Reflection/TypeLowering.h"
|
||||
#include "swift/Reflection/TypeRef.h"
|
||||
#include "swift/Reflection/TypeRefBuilder.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
|
||||
#ifdef DEBUG_TYPE_LOWERING
|
||||
#define DEBUG_LOG(expr) expr;
|
||||
@@ -212,7 +212,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Bad TypeInfo kind");
|
||||
swift_unreachable("Bad TypeInfo kind");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2007,7 +2007,7 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled FieldDescriptorKind in switch.");
|
||||
swift_unreachable("Unhandled FieldDescriptorKind in switch.");
|
||||
}
|
||||
|
||||
const TypeInfo *visitNominalTypeRef(const NominalTypeRef *N) {
|
||||
@@ -2039,7 +2039,7 @@ public:
|
||||
return TC.getTypeInfo(TC.getThinFunctionTypeRef(), ExternalTypeInfo);
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled FunctionMetadataConvention in switch.");
|
||||
swift_unreachable("Unhandled FunctionMetadataConvention in switch.");
|
||||
}
|
||||
|
||||
const TypeInfo *
|
||||
@@ -2060,7 +2060,7 @@ public:
|
||||
return TC.getTypeInfo(TC.getAnyMetatypeTypeRef(), ExternalTypeInfo);
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled MetatypeRepresentation in switch.");
|
||||
swift_unreachable("Unhandled MetatypeRepresentation in switch.");
|
||||
}
|
||||
|
||||
const TypeInfo *
|
||||
@@ -2256,7 +2256,7 @@ const TypeInfo *TypeConverter::getClassInstanceTypeInfo(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled FieldDescriptorKind in switch.");
|
||||
swift_unreachable("Unhandled FieldDescriptorKind in switch.");
|
||||
}
|
||||
|
||||
} // namespace reflection
|
||||
|
||||
@@ -23,7 +23,7 @@ unsigned long long swift_reflection_classIsSwiftMask = 2;
|
||||
#include "swift/Reflection/ReflectionContext.h"
|
||||
#include "swift/Reflection/TypeLowering.h"
|
||||
#include "swift/Remote/CMemoryReader.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
#include <TargetConditionals.h>
|
||||
@@ -406,7 +406,7 @@ swift_layout_kind_t getTypeInfoKind(const TypeInfo &TI) {
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled TypeInfoKind in switch");
|
||||
swift_unreachable("Unhandled TypeInfoKind in switch");
|
||||
}
|
||||
|
||||
static swift_typeinfo_t convertTypeInfo(const TypeInfo *TI) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
# define SWIFT_CASTING_SUPPORTS_MUTEX 1
|
||||
# include "swift/Runtime/Mutex.h"
|
||||
#endif
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/PointerIntPair.h"
|
||||
#if SWIFT_OBJC_INTEROP
|
||||
@@ -1016,7 +1016,7 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
|
||||
swift_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -1214,7 +1214,7 @@ swift_dynamicCastMetatypeImpl(const Metadata *sourceType,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
|
||||
swift_unreachable("Unhandled MetadataKind in switch.");
|
||||
}
|
||||
|
||||
static const Metadata *
|
||||
@@ -1424,7 +1424,7 @@ static bool _dynamicCastToUnknownClassFromExistential(OpaqueValue *dest,
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"Unhandled ExistentialTypeRepresentation in switch.");
|
||||
}
|
||||
|
||||
|
||||
@@ -1806,7 +1806,7 @@ static tryCastFunctionType *selectCasterForDest(const Metadata *destType) {
|
||||
case ExistentialTypeRepresentation::Error: // => Error existential
|
||||
return tryCastToErrorExistential;
|
||||
}
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"Unknown existential type representation in dynamic cast dispatch");
|
||||
}
|
||||
case MetadataKind::Metatype:
|
||||
@@ -1821,14 +1821,14 @@ static tryCastFunctionType *selectCasterForDest(const Metadata *destType) {
|
||||
// These are internal details of runtime-only structures,
|
||||
// so will never appear in compiler-generated types.
|
||||
// As such, they don't need support here.
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"Unexpected MetadataKind in dynamic cast dispatch");
|
||||
return nullptr;
|
||||
default:
|
||||
// If you see this message, then there is a new MetadataKind that I didn't
|
||||
// know about when I wrote this code. Please figure out what it is, how to
|
||||
// handle it, and add a case for it.
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"Unknown MetadataKind in dynamic cast dispatch");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("access not found in set");
|
||||
swift_unreachable("access not found in set");
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
@@ -194,7 +194,7 @@ computeMetadataBoundsForSuperclass(const void *ref,
|
||||
#endif
|
||||
}
|
||||
}
|
||||
swift_runtime_unreachable("unsupported superclass reference kind");
|
||||
swift_unreachable("unsupported superclass reference kind");
|
||||
}
|
||||
|
||||
static ClassMetadataBounds computeMetadataBoundsFromSuperclass(
|
||||
@@ -3716,7 +3716,7 @@ getExistentialValueWitnesses(ProtocolClassConstraint classConstraint,
|
||||
return getOpaqueExistentialValueWitnesses(numWitnessTables);
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled ProtocolClassConstraint in switch.");
|
||||
swift_unreachable("Unhandled ProtocolClassConstraint in switch.");
|
||||
}
|
||||
|
||||
template<> ExistentialTypeRepresentation
|
||||
@@ -3761,7 +3761,7 @@ ExistentialTypeMetadata::mayTakeValue(const OpaqueValue *container) const {
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"Unhandled ExistentialTypeRepresentation in switch.");
|
||||
}
|
||||
|
||||
@@ -3810,7 +3810,7 @@ ExistentialTypeMetadata::projectValue(const OpaqueValue *container) const {
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"Unhandled ExistentialTypeRepresentation in switch.");
|
||||
}
|
||||
|
||||
@@ -3835,7 +3835,7 @@ ExistentialTypeMetadata::getDynamicType(const OpaqueValue *container) const {
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"Unhandled ExistentialTypeRepresentation in switch.");
|
||||
}
|
||||
|
||||
@@ -4030,7 +4030,7 @@ class ForeignMetadataCacheEntry
|
||||
return Value;
|
||||
}
|
||||
void setValue(ValueType value) {
|
||||
swift_runtime_unreachable("should never be called");
|
||||
swift_unreachable("should never be called");
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -4094,7 +4094,7 @@ public:
|
||||
}
|
||||
|
||||
AllocationResult allocate(Metadata *candidate) {
|
||||
swift_runtime_unreachable(
|
||||
swift_unreachable(
|
||||
"always flags allocation complete during construction");
|
||||
}
|
||||
|
||||
@@ -4555,7 +4555,7 @@ static void initProtocolWitness(void **slot, void *witness,
|
||||
reqt);
|
||||
return;
|
||||
}
|
||||
swift_runtime_unreachable("bad witness kind");
|
||||
swift_unreachable("bad witness kind");
|
||||
#else
|
||||
*slot = witness;
|
||||
#endif
|
||||
@@ -4588,7 +4588,7 @@ static void copyProtocolWitness(void **dest, void * const *src,
|
||||
swift_ptrauth_copy(dest, src, reqt.Flags.getExtraDiscriminator());
|
||||
return;
|
||||
}
|
||||
swift_runtime_unreachable("bad witness kind");
|
||||
swift_unreachable("bad witness kind");
|
||||
#else
|
||||
*dest = *src;
|
||||
#endif
|
||||
@@ -5141,7 +5141,7 @@ static const WitnessTable *swift_getAssociatedConformanceWitnessSlowImpl(
|
||||
return assocWitnessTable;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Invalid mangled associate conformance");
|
||||
swift_unreachable("Invalid mangled associate conformance");
|
||||
}
|
||||
|
||||
const WitnessTable *swift::swift_getAssociatedConformanceWitness(
|
||||
@@ -5234,7 +5234,7 @@ static Result performOnMetadataCache(const Metadata *metadata,
|
||||
case TypeContextDescriptorFlags::SingletonMetadataInitialization:
|
||||
return std::move(callbacks).forSingletonMetadata(description);
|
||||
}
|
||||
swift_runtime_unreachable("bad metadata initialization kind");
|
||||
swift_unreachable("bad metadata initialization kind");
|
||||
}
|
||||
|
||||
auto &generics = description->getFullGenericContextHeader();
|
||||
@@ -5280,7 +5280,7 @@ bool swift::addToMetadataQueue(MetadataCompletionQueueEntry *queueEntry,
|
||||
}
|
||||
|
||||
bool forOtherMetadata(const Metadata *metadata) && {
|
||||
swift_runtime_unreachable("metadata should always be complete");
|
||||
swift_unreachable("metadata should always be complete");
|
||||
}
|
||||
} callbacks = { queueEntry, dependency };
|
||||
|
||||
@@ -5312,7 +5312,7 @@ void swift::resumeMetadataCompletion(MetadataCompletionQueueEntry *queueEntry) {
|
||||
}
|
||||
|
||||
void forOtherMetadata(const Metadata *metadata) && {
|
||||
swift_runtime_unreachable("metadata should always be complete");
|
||||
swift_unreachable("metadata should always be complete");
|
||||
}
|
||||
} callbacks = { queueEntry };
|
||||
|
||||
|
||||
@@ -366,7 +366,7 @@ public:
|
||||
template <class... ArgTys>
|
||||
Status beginInitialization(ConcurrencyControl &concurrency,
|
||||
ArgTys &&...args) {
|
||||
swift_runtime_unreachable("beginAllocation always short-circuits");
|
||||
swift_unreachable("beginAllocation always short-circuits");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -592,7 +592,7 @@ inline bool satisfies(PrivateMetadataState state, MetadataState requirement) {
|
||||
case MetadataState::Complete:
|
||||
return state >= PrivateMetadataState::Complete;
|
||||
}
|
||||
swift_runtime_unreachable("unsupported requirement kind");
|
||||
swift_unreachable("unsupported requirement kind");
|
||||
}
|
||||
|
||||
class PrivateMetadataTrackingInfo {
|
||||
@@ -642,7 +642,7 @@ public:
|
||||
MetadataState getAccomplishedRequestState() const {
|
||||
switch (getState()) {
|
||||
case PrivateMetadataState::Allocating:
|
||||
swift_runtime_unreachable("cannot call on allocating state");
|
||||
swift_unreachable("cannot call on allocating state");
|
||||
case PrivateMetadataState::Abstract:
|
||||
return MetadataState::Abstract;
|
||||
case PrivateMetadataState::LayoutComplete:
|
||||
@@ -652,7 +652,7 @@ public:
|
||||
case PrivateMetadataState::Complete:
|
||||
return MetadataState::Complete;
|
||||
}
|
||||
swift_runtime_unreachable("bad state");
|
||||
swift_unreachable("bad state");
|
||||
}
|
||||
|
||||
bool satisfies(MetadataState requirement) {
|
||||
@@ -678,7 +678,7 @@ public:
|
||||
// Otherwise, if it's a non-blocking request, we do not need to block.
|
||||
return (request.isBlocking() && !satisfies(request.getState()));
|
||||
}
|
||||
swift_runtime_unreachable("bad state");
|
||||
swift_unreachable("bad state");
|
||||
}
|
||||
|
||||
constexpr RawType getRawValue() const { return Data; }
|
||||
@@ -1124,9 +1124,9 @@ private:
|
||||
return;
|
||||
|
||||
case LSK::Complete:
|
||||
swift_runtime_unreachable("preparing to enqueue when already complete?");
|
||||
swift_unreachable("preparing to enqueue when already complete?");
|
||||
}
|
||||
swift_runtime_unreachable("bad kind");
|
||||
swift_unreachable("bad kind");
|
||||
}
|
||||
|
||||
/// Claim all the satisfied completion queue entries, given that
|
||||
@@ -1288,7 +1288,7 @@ public:
|
||||
|
||||
switch (LockedStorageKind) {
|
||||
case LSK::Complete:
|
||||
swift_runtime_unreachable("enqueuing on complete cache entry?");
|
||||
swift_unreachable("enqueuing on complete cache entry?");
|
||||
|
||||
case LSK::AllocatingThread:
|
||||
LockedStorageKind = LSK::CompletionQueue;
|
||||
@@ -1340,7 +1340,7 @@ public:
|
||||
// Check for an existing dependency.
|
||||
switch (LockedStorageKind) {
|
||||
case LSK::Complete:
|
||||
swift_runtime_unreachable("dependency on complete cache entry?");
|
||||
swift_unreachable("dependency on complete cache entry?");
|
||||
|
||||
case LSK::AllocatingThread:
|
||||
case LSK::CompletionQueue:
|
||||
|
||||
@@ -88,10 +88,10 @@ static uintptr_t resolveSymbolicReferenceOffset(SymbolicReferenceKind kind,
|
||||
return (uintptr_t)contextPtr;
|
||||
}
|
||||
case SymbolicReferenceKind::AccessorFunctionReference: {
|
||||
swift_runtime_unreachable("should not be indirectly referenced");
|
||||
swift_unreachable("should not be indirectly referenced");
|
||||
}
|
||||
}
|
||||
swift_runtime_unreachable("unknown symbolic reference kind");
|
||||
swift_unreachable("unknown symbolic reference kind");
|
||||
} else {
|
||||
return ptr;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ _buildDemanglingForSymbolicReference(SymbolicReferenceKind kind,
|
||||
(uintptr_t)resolvedReference);
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("invalid symbolic reference kind");
|
||||
swift_unreachable("invalid symbolic reference kind");
|
||||
}
|
||||
|
||||
NodePointer
|
||||
@@ -1168,7 +1168,7 @@ findAssociatedTypeByName(const ProtocolDescriptor *protocol, StringRef name) {
|
||||
++currentAssocTypeIdx;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("associated type names don't line up");
|
||||
swift_unreachable("associated type names don't line up");
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "swift/Runtime/Concurrent.h"
|
||||
#include "swift/Runtime/HeapObject.h"
|
||||
#include "swift/Runtime/Metadata.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "CompatibilityOverride.h"
|
||||
#include "ImageInspection.h"
|
||||
#include "Private.h"
|
||||
@@ -116,7 +116,7 @@ const ClassMetadata *TypeReference::getObjCClass(TypeReferenceKind kind) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled TypeReferenceKind in switch.");
|
||||
swift_unreachable("Unhandled TypeReferenceKind in switch.");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -155,7 +155,7 @@ ProtocolConformanceDescriptor::getCanonicalTypeMetadata() const {
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled TypeReferenceKind in switch.");
|
||||
swift_unreachable("Unhandled TypeReferenceKind in switch.");
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "swift/Runtime/HeapObject.h"
|
||||
#include "swift/Runtime/Metadata.h"
|
||||
#include "swift/Runtime/Enum.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Demangling/Demangle.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include "swift/Runtime/Portability.h"
|
||||
|
||||
@@ -231,7 +231,7 @@ override_getCanonicalTypeMetadata(const ProtocolConformanceDescriptor *conf) {
|
||||
}
|
||||
}
|
||||
|
||||
swift_runtime_unreachable("Unhandled TypeReferenceKind in switch.");
|
||||
swift_unreachable("Unhandled TypeReferenceKind in switch.");
|
||||
}
|
||||
|
||||
class ConformanceCandidate {
|
||||
|
||||
Reference in New Issue
Block a user