Skip to content

Commit 7d9d3ba

Browse files
committed
[gardening] Convert assert(0) => llvm_unreachable to silence warning when asserts are disabled.
1 parent e013282 commit 7d9d3ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/AST/Attr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "swift/Basic/Defer.h"
2424
#include "llvm/ADT/SmallString.h"
2525
#include "llvm/Support/raw_ostream.h"
26+
#include "llvm/Support/ErrorHandling.h"
2627
#include "llvm/ADT/StringSwitch.h"
2728
using namespace swift;
2829

@@ -46,7 +47,7 @@ TypeAttrKind TypeAttributes::getAttrKindFromString(StringRef Str) {
4647
/// Return the name (like "autoclosure") for an attribute ID.
4748
const char *TypeAttributes::getAttrName(TypeAttrKind kind) {
4849
switch (kind) {
49-
default: assert(0 && "Invalid attribute ID");
50+
default: llvm_unreachable("Invalid attribute ID");
5051
#define TYPE_ATTR(X) case TAK_##X: return #X;
5152
#include "swift/AST/Attr.def"
5253
}

0 commit comments

Comments
 (0)