mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #7055 from hughbe/unreachable
Cleanup swift_unreachable
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#define SWIFT_ABI_METADATAVALUES_H
|
||||
|
||||
#include "swift/AST/Ownership.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
swift_unreachable("Unhandled ProtocolDispatchStrategy in switch.");
|
||||
swift_runtime_unreachable("Unhandled ProtocolDispatchStrategy in switch.");
|
||||
}
|
||||
|
||||
/// Return the identifier if this is a special runtime-known protocol.
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
#ifndef SWIFT_REFLECTION_REFLECTIONCONTEXT_H
|
||||
#define SWIFT_REFLECTION_REFLECTIONCONTEXT_H
|
||||
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Remote/MemoryReader.h"
|
||||
#include "swift/Remote/MetadataReader.h"
|
||||
#include "swift/Reflection/Records.h"
|
||||
#include "swift/Reflection/TypeLowering.h"
|
||||
#include "swift/Reflection/TypeRef.h"
|
||||
#include "swift/Reflection/TypeRefBuilder.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
@@ -454,7 +454,7 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
swift_unreachable("Unhandled MetadataSourceKind in switch.");
|
||||
swift_runtime_unreachable("Unhandled MetadataSourceKind in switch.");
|
||||
}
|
||||
|
||||
/// Read metadata for a captured generic type from a closure context.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "swift/ABI/MetadataValues.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -783,7 +783,7 @@ public:
|
||||
#include "swift/Reflection/TypeRefs.def"
|
||||
}
|
||||
|
||||
swift_unreachable("Unhandled TypeRefKind in switch.");
|
||||
swift_runtime_unreachable("Unhandled TypeRefKind in switch.");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "swift/Remote/MemoryReader.h"
|
||||
#include "swift/Basic/Demangle.h"
|
||||
#include "swift/Basic/LLVM.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
@@ -763,7 +763,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
swift_unreachable("Unhandled MetadataKind in switch");
|
||||
swift_runtime_unreachable("Unhandled MetadataKind in switch");
|
||||
}
|
||||
|
||||
BuiltType readTypeFromMangledName(const char *MangledTypeName,
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
#include <llvm/Support/Compiler.h>
|
||||
#include <stdint.h>
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Runtime/Config.h"
|
||||
#include "swift/Runtime/Metadata.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
|
||||
#ifdef SWIFT_HAVE_CRASHREPORTERCLIENT
|
||||
|
||||
@@ -72,7 +72,7 @@ static inline void crash(const char *message) {
|
||||
CRSetCrashLogMessage(message);
|
||||
|
||||
LLVM_BUILTIN_TRAP;
|
||||
swift_unreachable("Expected compiler to crash.");
|
||||
swift_runtime_unreachable("Expected compiler to crash.");
|
||||
}
|
||||
|
||||
/// Report a corrupted type object.
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "swift/Basic/FlaggedPointer.h"
|
||||
#include "swift/Basic/RelativePointer.h"
|
||||
#include "swift/Basic/ManglingMacros.h"
|
||||
#include "swift/Basic/Unreachable.h"
|
||||
#include "swift/Runtime/Unreachable.h"
|
||||
#include "../../../stdlib/public/SwiftShims/HeapObject.h"
|
||||
|
||||
namespace swift {
|
||||
@@ -1160,7 +1160,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
swift_unreachable("Unhandled MetadataKind in switch.");
|
||||
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
|
||||
}
|
||||
|
||||
/// Is this metadata for an existential type?
|
||||
@@ -1186,7 +1186,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
swift_unreachable("Unhandled MetadataKind in switch.");
|
||||
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
|
||||
}
|
||||
|
||||
/// Is this either type metadata or a class object for any kind of class?
|
||||
@@ -1267,7 +1267,7 @@ public:
|
||||
return RelativeDirectPointerNullPtrRef;
|
||||
}
|
||||
|
||||
swift_unreachable("Unhandled MetadataKind in switch.");
|
||||
swift_runtime_unreachable("Unhandled MetadataKind in switch.");
|
||||
}
|
||||
|
||||
/// Get the generic metadata pattern from which this generic type instance was
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//===--- Unreachable.h - Implements swift_unreachable -----------*- C++ -*-===//
|
||||
//===--- Unreachable.h - Implements swift_runtime_unreachable ---*- C++ -*-===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
@@ -10,23 +10,23 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines swift_unreachable, an LLVM-independent implementation of
|
||||
// llvm_unreachable.
|
||||
// This file defines swift_runtime_unreachable, an LLVM-independent
|
||||
// implementation of llvm_unreachable.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef SWIFT_BASIC_UNREACHABLE_H
|
||||
#define SWIFT_BASIC_UNREACHABLE_H
|
||||
#ifndef SWIFT_RUNTIME_UNREACHABLE_H
|
||||
#define SWIFT_RUNTIME_UNREACHABLE_H
|
||||
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
LLVM_ATTRIBUTE_NORETURN
|
||||
inline static void swift_unreachable(const char* msg) {
|
||||
inline static void swift_runtime_unreachable(const char *msg) {
|
||||
assert(false && msg);
|
||||
(void)msg;
|
||||
abort();
|
||||
}
|
||||
|
||||
#endif // SWIFT_BASIC_UNREACHABLE_H
|
||||
#endif // SWIFT_RUNTIME_UNREACHABLE_H
|
||||
Reference in New Issue
Block a user