Skip to content

Commit a19d973

Browse files
authored
Merge pull request #17795 from davezarzycki/nfc_avoid_warnings_with_non_assert_builds
2 parents d0f1bf6 + 3ecb6ae commit a19d973

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/AST/Ownership.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121

2222
#include "swift/Basic/InlineBitfield.h"
2323
#include "llvm/ADT/StringRef.h"
24+
#include "llvm/Support/Compiler.h"
2425
#include "llvm/Support/ErrorHandling.h"
2526
#include "llvm/Support/raw_ostream.h"
2627
#include <stdint.h>
28+
#include <assert.h>
2729

2830
namespace swift {
2931

@@ -52,6 +54,7 @@ static inline llvm::StringRef keywordOf(ReferenceOwnership ownership) {
5254
}
5355
// We cannot use llvm_unreachable() because this is used by the stdlib.
5456
assert(false && "impossible");
57+
LLVM_BUILTIN_UNREACHABLE;
5558
}
5659

5760
static inline llvm::StringRef manglingOf(ReferenceOwnership ownership) {
@@ -64,6 +67,7 @@ static inline llvm::StringRef manglingOf(ReferenceOwnership ownership) {
6467
}
6568
// We cannot use llvm_unreachable() because this is used by the stdlib.
6669
assert(false && "impossible");
70+
LLVM_BUILTIN_UNREACHABLE;
6771
}
6872

6973
static inline bool isLessStrongThan(ReferenceOwnership left,

0 commit comments

Comments
 (0)