Skip to content

Commit d1846ca

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Add [[noreturn]] to 1 file inc gloo/transport/tcp/pair.cc
Summary: LLVM-15 has a warning `-Wno-return` which can be used to identify functions that do not return. Qualifying these functions with `[[noreturn]]` is a perf optimization. Reviewed By: meyering Differential Revision: D53815466 fbshipit-source-id: 02f0b2e4d33ff118c55d285a4e623574c13e378f
1 parent 882d809 commit d1846ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gloo/transport/tcp/pair.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,11 +1080,11 @@ void Pair::signalException(std::exception_ptr ex) {
10801080
changeState(CLOSED);
10811081
}
10821082

1083-
void Pair::signalAndThrowException(const std::string& msg) {
1083+
[[noreturn]] void Pair::signalAndThrowException(const std::string& msg) {
10841084
signalAndThrowException(std::make_exception_ptr(::gloo::IoException(msg)));
10851085
}
10861086

1087-
void Pair::signalAndThrowException(std::exception_ptr ex) {
1087+
[[noreturn]] void Pair::signalAndThrowException(std::exception_ptr ex) {
10881088
signalException(ex);
10891089
std::rethrow_exception(ex);
10901090
}

gloo/transport/tcp/pair.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ class Pair : public ::gloo::transport::Pair, public Handler {
325325
void signalException(std::exception_ptr);
326326

327327
// Like signalException, but throws exception as well.
328-
void signalAndThrowException(const std::string& msg);
329-
void signalAndThrowException(std::exception_ptr ex);
328+
[[noreturn]] void signalAndThrowException(const std::string& msg);
329+
[[noreturn]] void signalAndThrowException(std::exception_ptr ex);
330330

331331
// Cache exception such that it can be rethrown if any function on
332332
// this instance is called again when it is in an error state.

0 commit comments

Comments
 (0)