Skip to content

Commit 924d15b

Browse files
committed
[NFC] Swap LLVM_NODISCARD for LLVM_ATTRIBUTE_NORETURN
These were originally meant to be no-return functions since they're going to abort. They were accidentally changed to no-discard functions despite not having a return value.
1 parent f97d0cc commit 924d15b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/Demangling/Demangler.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ static bool isRequirement(Node::Kind kind) {
9191
// Public utility functions //
9292
//////////////////////////////////
9393

94-
LLVM_NODISCARD void swift::Demangle::failAssert(const char *file, unsigned line,
95-
NodePointer node,
96-
const char *expr) {
94+
LLVM_ATTRIBUTE_NORETURN void swift::Demangle::failAssert(const char *file,
95+
unsigned line,
96+
NodePointer node,
97+
const char *expr) {
9798
fprintf(stderr, "%s:%u: assertion failed for Node %p: %s", file, line, node,
9899
expr);
99100
abort();

lib/Demangling/DemanglerAssert.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ namespace swift {
5151
namespace Demangle {
5252
SWIFT_BEGIN_INLINE_NAMESPACE
5353

54-
LLVM_NODISCARD void failAssert(const char *file, unsigned line,
55-
NodePointer node, const char *expr);
54+
LLVM_ATTRIBUTE_NORETURN void failAssert(const char *file, unsigned line,
55+
NodePointer node, const char *expr);
5656

5757
SWIFT_END_INLINE_NAMESPACE
5858
} // end namespace Demangle

0 commit comments

Comments
 (0)