Skip to content

Commit 818099e

Browse files
committed
Rename swift_unreachable to swift_runtime_unreachable
1 parent 5a59971 commit 818099e

File tree

13 files changed

+36
-31
lines changed

13 files changed

+36
-31
lines changed

include/swift/ABI/MetadataValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ class ProtocolDescriptorFlags {
381381
return true;
382382
}
383383

384-
swift_unreachable("Unhandled ProtocolDispatchStrategy in switch.");
384+
swift_runtime_unreachable("Unhandled ProtocolDispatchStrategy in switch.");
385385
}
386386

387387
/// Return the identifier if this is a special runtime-known protocol.

include/swift/Reflection/ReflectionContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ class ReflectionContext
454454
return true;
455455
}
456456

457-
swift_unreachable("Unhandled MetadataSourceKind in switch.");
457+
swift_runtime_unreachable("Unhandled MetadataSourceKind in switch.");
458458
}
459459

460460
/// Read metadata for a captured generic type from a closure context.

include/swift/Reflection/TypeRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ class TypeRefVisitor {
783783
#include "swift/Reflection/TypeRefs.def"
784784
}
785785

786-
swift_unreachable("Unhandled TypeRefKind in switch.");
786+
swift_runtime_unreachable("Unhandled TypeRefKind in switch.");
787787
}
788788
};
789789

include/swift/Remote/MetadataReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ class MetadataReader {
763763
}
764764
}
765765

766-
swift_unreachable("Unhandled MetadataKind in switch");
766+
swift_runtime_unreachable("Unhandled MetadataKind in switch");
767767
}
768768

769769
BuiltType readTypeFromMangledName(const char *MangledTypeName,

include/swift/Runtime/Debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static inline void crash(const char *message) {
7272
CRSetCrashLogMessage(message);
7373

7474
LLVM_BUILTIN_TRAP;
75-
swift_unreachable("Expected compiler to crash.");
75+
swift_runtime_unreachable("Expected compiler to crash.");
7676
}
7777

7878
/// Report a corrupted type object.

include/swift/Runtime/Metadata.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ struct TargetMetadata {
11601160
return false;
11611161
}
11621162

1163-
swift_unreachable("Unhandled MetadataKind in switch.");
1163+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
11641164
}
11651165

11661166
/// Is this metadata for an existential type?
@@ -1186,7 +1186,7 @@ struct TargetMetadata {
11861186
return false;
11871187
}
11881188

1189-
swift_unreachable("Unhandled MetadataKind in switch.");
1189+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
11901190
}
11911191

11921192
/// Is this either type metadata or a class object for any kind of class?
@@ -1267,7 +1267,7 @@ struct TargetMetadata {
12671267
return RelativeDirectPointerNullPtrRef;
12681268
}
12691269

1270-
swift_unreachable("Unhandled MetadataKind in switch.");
1270+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
12711271
}
12721272

12731273
/// Get the generic metadata pattern from which this generic type instance was

include/swift/Runtime/Unreachable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- Unreachable.h - Implements swift_unreachable -----------*- C++ -*-===//
1+
//===--- Unreachable.h - Implements swift_runtime_unreachable ---*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//
13-
// This file defines swift_unreachable, an LLVM-independent implementation of
14-
// llvm_unreachable.
13+
// This file defines swift_runtime_unreachable, an LLVM-independent
14+
// implementation of llvm_unreachable.
1515
//
1616
//===----------------------------------------------------------------------===//
1717

@@ -23,7 +23,7 @@
2323
#include <stdlib.h>
2424

2525
LLVM_ATTRIBUTE_NORETURN
26-
inline static void swift_unreachable(const char* msg) {
26+
inline static void swift_runtime_unreachable(const char *msg) {
2727
assert(false && msg);
2828
(void)msg;
2929
abort();

stdlib/public/Reflection/TypeLowering.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class PrintTypeInfo {
186186
}
187187
}
188188

189-
swift_unreachable("Bad TypeInfo kind");
189+
swift_runtime_unreachable("Bad TypeInfo kind");
190190
}
191191
};
192192

@@ -1043,7 +1043,7 @@ class LowerType
10431043
return nullptr;
10441044
}
10451045

1046-
swift_unreachable("Unhandled FieldDescriptorKind in switch.");
1046+
swift_runtime_unreachable("Unhandled FieldDescriptorKind in switch.");
10471047
}
10481048

10491049
const TypeInfo *visitNominalTypeRef(const NominalTypeRef *N) {
@@ -1074,7 +1074,7 @@ class LowerType
10741074
return TC.getTypeInfo(TC.getThinFunctionTypeRef());
10751075
}
10761076

1077-
swift_unreachable("Unhandled FunctionMetadataConvention in switch.");
1077+
swift_runtime_unreachable("Unhandled FunctionMetadataConvention in switch.");
10781078
}
10791079

10801080
const TypeInfo *visitProtocolTypeRef(const ProtocolTypeRef *P) {
@@ -1102,7 +1102,7 @@ class LowerType
11021102
return TC.getTypeInfo(TC.getAnyMetatypeTypeRef());
11031103
}
11041104

1105-
swift_unreachable("Unhandled MetatypeRepresentation in switch.");
1105+
swift_runtime_unreachable("Unhandled MetatypeRepresentation in switch.");
11061106
}
11071107

11081108
const TypeInfo *
@@ -1285,7 +1285,7 @@ const TypeInfo *TypeConverter::getClassInstanceTypeInfo(const TypeRef *TR,
12851285
return nullptr;
12861286
}
12871287

1288-
swift_unreachable("Unhandled FieldDescriptorKind in switch.");
1288+
swift_runtime_unreachable("Unhandled FieldDescriptorKind in switch.");
12891289
}
12901290

12911291
} // namespace reflection

stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ swift_layout_kind_t getTypeInfoKind(const TypeInfo &TI) {
177177
}
178178
}
179179

180-
swift_unreachable("Unhandled TypeInfoKind in switch");
180+
swift_runtime_unreachable("Unhandled TypeInfoKind in switch");
181181
}
182182

183183
static swift_typeinfo_t convertTypeInfo(const TypeInfo *TI) {

stdlib/public/runtime/Casting.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
10131013
}
10141014
}
10151015

1016-
swift_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
1016+
swift_runtime_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
10171017
}
10181018

10191019
/******************************************************************************/
@@ -1276,7 +1276,7 @@ swift::swift_dynamicCastMetatype(const Metadata *sourceType,
12761276
return origSourceType;
12771277
}
12781278

1279-
swift_unreachable("Unhandled MetadataKind in switch.");
1279+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
12801280
}
12811281

12821282
const Metadata *
@@ -1388,7 +1388,7 @@ swift::swift_dynamicCastMetatypeUnconditional(const Metadata *sourceType,
13881388
return origSourceType;
13891389
}
13901390

1391-
swift_unreachable("Unhandled MetadataKind in switch.");
1391+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
13921392
}
13931393

13941394
/******************************************************************************/
@@ -1523,7 +1523,8 @@ static bool _dynamicCastToUnknownClassFromExistential(OpaqueValue *dest,
15231523
}
15241524
}
15251525

1526-
swift_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
1526+
swift_runtime_unreachable(
1527+
"Unhandled ExistentialTypeRepresentation in switch.");
15271528
}
15281529

15291530
static void unwrapExistential(OpaqueValue *src,
@@ -1994,7 +1995,7 @@ static bool _dynamicCastToFunction(OpaqueValue *dest,
19941995
return _fail(src, srcType, targetType, flags);
19951996
}
19961997

1997-
swift_unreachable("Unhandled MetadataKind in switch.");
1998+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
19981999
}
19992000

20002001
/******************************************************************************/

stdlib/public/runtime/Metadata.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,7 @@ getExistentialValueWitnesses(ProtocolClassConstraint classConstraint,
22002200
return getOpaqueExistentialValueWitnesses(numWitnessTables);
22012201
}
22022202

2203-
swift_unreachable("Unhandled ProtocolClassConstraint in switch.");
2203+
swift_runtime_unreachable("Unhandled ProtocolClassConstraint in switch.");
22042204
}
22052205

22062206
template<> ExistentialTypeRepresentation
@@ -2243,7 +2243,8 @@ ExistentialTypeMetadata::mayTakeValue(const OpaqueValue *container) const {
22432243
}
22442244
}
22452245

2246-
swift_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
2246+
swift_runtime_unreachable(
2247+
"Unhandled ExistentialTypeRepresentation in switch.");
22472248
}
22482249

22492250
template<> void
@@ -2294,7 +2295,8 @@ ExistentialTypeMetadata::projectValue(const OpaqueValue *container) const {
22942295
}
22952296
}
22962297

2297-
swift_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
2298+
swift_runtime_unreachable(
2299+
"Unhandled ExistentialTypeRepresentation in switch.");
22982300
}
22992301

23002302
template<> const Metadata *
@@ -2318,7 +2320,8 @@ ExistentialTypeMetadata::getDynamicType(const OpaqueValue *container) const {
23182320
}
23192321
}
23202322

2321-
swift_unreachable("Unhandled ExistentialTypeRepresentation in switch.");
2323+
swift_runtime_unreachable(
2324+
"Unhandled ExistentialTypeRepresentation in switch.");
23222325
}
23232326

23242327
template<> const WitnessTable *
@@ -2609,7 +2612,7 @@ Metadata::getClassObject() const {
26092612
return nullptr;
26102613
}
26112614

2612-
swift_unreachable("Unhandled MetadataKind in switch.");
2615+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
26132616
}
26142617

26152618
#ifndef NDEBUG

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const {
118118
return nullptr;
119119
}
120120

121-
swift_unreachable("Unhandled TypeMetadataRecordKind in switch.");
121+
swift_runtime_unreachable("Unhandled TypeMetadataRecordKind in switch.");
122122
}
123123

124124
template<>
@@ -133,7 +133,8 @@ const {
133133
return getWitnessTableAccessor()(type);
134134
}
135135

136-
swift_unreachable("Unhandled ProtocolConformanceReferenceKind in switch.");
136+
swift_runtime_unreachable(
137+
"Unhandled ProtocolConformanceReferenceKind in switch.");
137138
}
138139

139140
namespace {

stdlib/public/runtime/Reflection.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ static Mirror ObjC_getMirrorForSuperclass(Class sup,
11001100
swift::crash("Swift mirror lookup failure");
11011101
}
11021102

1103-
swift_unreachable("Unhandled MetadataKind in switch.");
1103+
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
11041104
}
11051105

11061106
/// MagicMirror ownership-taking whole-value constructor.

0 commit comments

Comments
 (0)