Skip to content

Commit 323b9bf

Browse files
committed
[lld] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
[[noreturn]] can be used since 2016 when the minimum compiler requirement was bumped to GCC 4.8/MSVC 2015.
1 parent d2f85d0 commit 323b9bf

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lld/include/lld/Common/ErrorHandler.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class ErrorHandler {
107107

108108
void error(const Twine &msg);
109109
void error(const Twine &msg, ErrorTag tag, ArrayRef<StringRef> args);
110-
LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &msg);
110+
[[noreturn]] void fatal(const Twine &msg);
111111
void log(const Twine &msg);
112112
void message(const Twine &msg);
113113
void warn(const Twine &msg);
@@ -133,15 +133,13 @@ inline void error(const Twine &msg) { errorHandler().error(msg); }
133133
inline void error(const Twine &msg, ErrorTag tag, ArrayRef<StringRef> args) {
134134
errorHandler().error(msg, tag, args);
135135
}
136-
inline LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &msg) {
137-
errorHandler().fatal(msg);
138-
}
136+
[[noreturn]] inline void fatal(const Twine &msg) { errorHandler().fatal(msg); }
139137
inline void log(const Twine &msg) { errorHandler().log(msg); }
140138
inline void message(const Twine &msg) { errorHandler().message(msg); }
141139
inline void warn(const Twine &msg) { errorHandler().warn(msg); }
142140
inline uint64_t errorCount() { return errorHandler().errorCount; }
143141

144-
LLVM_ATTRIBUTE_NORETURN void exitLld(int val);
142+
[[noreturn]] void exitLld(int val);
145143

146144
void diagnosticHandler(const llvm::DiagnosticInfo &di);
147145
void checkError(Error e);

lld/tools/lld/lld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ enum Flavor {
5454
Wasm, // -flavor wasm
5555
};
5656

57-
LLVM_ATTRIBUTE_NORETURN static void die(const Twine &s) {
57+
[[noreturn]] static void die(const Twine &s) {
5858
llvm::errs() << s << "\n";
5959
exit(1);
6060
}

0 commit comments

Comments
 (0)