[PATCH] D106899: [LLVM][NFC] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG09529892b518: [Support] Remove LLVM_ATTRIBUTE_NORETURN (authored by gAlfonso-bit, committed by MaskRay). Changed prior to commit: https://reviews.llvm.org/D106899?vs=362780=362815#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106899/new/ https://reviews.llvm.org/D106899 Files: llvm/include/llvm/Support/Compiler.h Index: llvm/include/llvm/Support/Compiler.h === --- llvm/include/llvm/Support/Compiler.h +++ llvm/include/llvm/Support/Compiler.h @@ -242,14 +242,6 @@ #define LLVM_ATTRIBUTE_ALWAYS_INLINE inline #endif -#ifdef __GNUC__ -#define LLVM_ATTRIBUTE_NORETURN __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define LLVM_ATTRIBUTE_NORETURN __declspec(noreturn) -#else -#define LLVM_ATTRIBUTE_NORETURN -#endif - #if __has_attribute(returns_nonnull) || LLVM_GNUC_PREREQ(4, 9, 0) #define LLVM_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) #elif defined(_MSC_VER) Index: llvm/include/llvm/Support/Compiler.h === --- llvm/include/llvm/Support/Compiler.h +++ llvm/include/llvm/Support/Compiler.h @@ -242,14 +242,6 @@ #define LLVM_ATTRIBUTE_ALWAYS_INLINE inline #endif -#ifdef __GNUC__ -#define LLVM_ATTRIBUTE_NORETURN __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define LLVM_ATTRIBUTE_NORETURN __declspec(noreturn) -#else -#define LLVM_ATTRIBUTE_NORETURN -#endif - #if __has_attribute(returns_nonnull) || LLVM_GNUC_PREREQ(4, 9, 0) #define LLVM_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) #elif defined(_MSC_VER) ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D106899: [LLVM][NFC] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
gAlfonso-bit added a comment. Still not passing (what is going on?) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106899/new/ https://reviews.llvm.org/D106899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D106899: [LLVM][NFC] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
gAlfonso-bit updated this revision to Diff 362780. gAlfonso-bit added a comment. Had to fix a clang-tidy issue for this to even compile CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106899/new/ https://reviews.llvm.org/D106899 Files: clang-tools-extra/pp-trace/PPTrace.cpp clang/utils/TableGen/ClangDiagnosticsEmitter.cpp flang/include/flang/Optimizer/Support/FatalError.h lldb/source/Host/posix/ProcessLauncherPosixFork.cpp lldb/source/Plugins/Process/Linux/NativeProcessLinux.h lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp Index: lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp === --- lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp +++ lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp @@ -29,7 +29,7 @@ #if defined(__arm64__) || defined(__aarch64__) namespace { -void LLVM_ATTRIBUTE_NORETURN Child() { +[[noreturn]] void Child() { if (ptrace(PTRACE_TRACEME, 0, nullptr, nullptr) == -1) _exit(1); Index: lldb/source/Plugins/Process/Linux/NativeProcessLinux.h === --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.h +++ lldb/source/Plugins/Process/Linux/NativeProcessLinux.h @@ -144,7 +144,7 @@ private: MainLoop::SignalHandleUP m_sigchld_handle; ArchSpec m_arch; - MainLoop& m_main_loop; + MainLoop _main_loop; LazyBool m_supports_mem_region = eLazyBoolCalculate; std::vector> m_mem_region_cache; Index: lldb/source/Host/posix/ProcessLauncherPosixFork.cpp === --- lldb/source/Host/posix/ProcessLauncherPosixFork.cpp +++ lldb/source/Host/posix/ProcessLauncherPosixFork.cpp @@ -20,8 +20,8 @@ #include #include -#include #include +#include #ifdef __ANDROID__ #include @@ -46,8 +46,7 @@ #endif } -static void LLVM_ATTRIBUTE_NORETURN ExitWithError(int error_fd, - const char *operation) { +[[noreturn]] static void ExitWithError(int error_fd, const char *operation) { int err = errno; llvm::raw_fd_ostream os(error_fd, true); os << operation << " failed: " << llvm::sys::StrError(err); @@ -55,7 +54,8 @@ _exit(1); } -static void DisableASLRIfRequested(int error_fd, const ProcessLaunchInfo ) { +static void DisableASLRIfRequested(int error_fd, + const ProcessLaunchInfo ) { #if defined(__linux__) if (info.GetFlags().Test(lldb::eLaunchFlagDisableASLR)) { const unsigned long personality_get_current = 0x; @@ -72,8 +72,8 @@ static void DupDescriptor(int error_fd, const FileSpec _spec, int fd, int flags) { - int target_fd = llvm::sys::RetryAfterSignal(-1, ::open, - file_spec.GetCString(), flags, 0666); + int target_fd = llvm::sys::RetryAfterSignal( + -1, ::open, file_spec.GetCString(), flags, 0666); if (target_fd == -1) ExitWithError(error_fd, "DupDescriptor-open"); @@ -88,8 +88,8 @@ return; } -static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, - const ProcessLaunchInfo ) { +[[noreturn]] static void ChildFunc(int error_fd, + const ProcessLaunchInfo ) { if (info.GetFlags().Test(eLaunchFlagLaunchInSeparateProcessGroup)) { if (setpgid(0, 0) != 0) ExitWithError(error_fd, "setpgid"); Index: flang/include/flang/Optimizer/Support/FatalError.h === --- flang/include/flang/Optimizer/Support/FatalError.h +++ flang/include/flang/Optimizer/Support/FatalError.h @@ -20,8 +20,8 @@ /// Fatal error reporting helper. Report a fatal error with a source location /// and immediately abort flang. -LLVM_ATTRIBUTE_NORETURN inline void emitFatalError(mlir::Location loc, - const llvm::Twine ) { +[[noreturn]] inline void emitFatalError(mlir::Location loc, +const llvm::Twine ) { mlir::emitError(loc, message); llvm::report_fatal_error("aborting"); } Index: clang/utils/TableGen/ClangDiagnosticsEmitter.cpp === --- clang/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ clang/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -614,7 +614,7 @@ return It->second.Root; } - LLVM_ATTRIBUTE_NORETURN void PrintFatalError(llvm::Twine const ) const { + [[noreturn]] void PrintFatalError(llvm::Twine const ) const { assert(EvaluatingRecord && "not evaluating a record?"); llvm::PrintFatalError(EvaluatingRecord->getLoc(), Msg); } Index: clang-tools-extra/pp-trace/PPTrace.cpp === --- clang-tools-extra/pp-trace/PPTrace.cpp +++ clang-tools-extra/pp-trace/PPTrace.cpp @@ -69,7 +69,7 @@ cl::desc("Output trace to the given
[PATCH] D106899: [LLVM][NFC] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
gAlfonso-bit added a comment. I don't know why this is failing CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106899/new/ https://reviews.llvm.org/D106899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D106899: [LLVM][NFC] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
gAlfonso-bit updated this revision to Diff 362533. gAlfonso-bit retitled this revision from "[LLVM][NFC] Remove LLVM_ATTRIBUTE_NORETURN and use [[noreturn]] directly" to "[LLVM][NFC] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]". gAlfonso-bit added a comment. Removed Compiler.h changes CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106899/new/ https://reviews.llvm.org/D106899 Files: clang-tools-extra/pp-trace/PPTrace.cpp clang/utils/TableGen/ClangDiagnosticsEmitter.cpp flang/include/flang/Optimizer/Support/FatalError.h lldb/source/Host/posix/ProcessLauncherPosixFork.cpp lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp Index: lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp === --- lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp +++ lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp @@ -29,7 +29,7 @@ #if defined(__arm64__) || defined(__aarch64__) namespace { -void LLVM_ATTRIBUTE_NORETURN Child() { +[[noreturn]] void Child() { if (ptrace(PTRACE_TRACEME, 0, nullptr, nullptr) == -1) _exit(1); Index: lldb/source/Host/posix/ProcessLauncherPosixFork.cpp === --- lldb/source/Host/posix/ProcessLauncherPosixFork.cpp +++ lldb/source/Host/posix/ProcessLauncherPosixFork.cpp @@ -20,8 +20,8 @@ #include #include -#include #include +#include #ifdef __ANDROID__ #include @@ -46,8 +46,7 @@ #endif } -static void LLVM_ATTRIBUTE_NORETURN ExitWithError(int error_fd, - const char *operation) { +[[noreturn]] static void ExitWithError(int error_fd, const char *operation) { int err = errno; llvm::raw_fd_ostream os(error_fd, true); os << operation << " failed: " << llvm::sys::StrError(err); @@ -55,7 +54,8 @@ _exit(1); } -static void DisableASLRIfRequested(int error_fd, const ProcessLaunchInfo ) { +static void DisableASLRIfRequested(int error_fd, + const ProcessLaunchInfo ) { #if defined(__linux__) if (info.GetFlags().Test(lldb::eLaunchFlagDisableASLR)) { const unsigned long personality_get_current = 0x; @@ -72,8 +72,8 @@ static void DupDescriptor(int error_fd, const FileSpec _spec, int fd, int flags) { - int target_fd = llvm::sys::RetryAfterSignal(-1, ::open, - file_spec.GetCString(), flags, 0666); + int target_fd = llvm::sys::RetryAfterSignal( + -1, ::open, file_spec.GetCString(), flags, 0666); if (target_fd == -1) ExitWithError(error_fd, "DupDescriptor-open"); @@ -88,8 +88,8 @@ return; } -static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, - const ProcessLaunchInfo ) { +[[noreturn]] static void ChildFunc(int error_fd, + const ProcessLaunchInfo ) { if (info.GetFlags().Test(eLaunchFlagLaunchInSeparateProcessGroup)) { if (setpgid(0, 0) != 0) ExitWithError(error_fd, "setpgid"); Index: flang/include/flang/Optimizer/Support/FatalError.h === --- flang/include/flang/Optimizer/Support/FatalError.h +++ flang/include/flang/Optimizer/Support/FatalError.h @@ -20,8 +20,8 @@ /// Fatal error reporting helper. Report a fatal error with a source location /// and immediately abort flang. -LLVM_ATTRIBUTE_NORETURN inline void emitFatalError(mlir::Location loc, - const llvm::Twine ) { +[[noreturn]] inline void emitFatalError(mlir::Location loc, +const llvm::Twine ) { mlir::emitError(loc, message); llvm::report_fatal_error("aborting"); } Index: clang/utils/TableGen/ClangDiagnosticsEmitter.cpp === --- clang/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ clang/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -614,7 +614,7 @@ return It->second.Root; } - LLVM_ATTRIBUTE_NORETURN void PrintFatalError(llvm::Twine const ) const { + [[noreturn]] void PrintFatalError(llvm::Twine const ) const { assert(EvaluatingRecord && "not evaluating a record?"); llvm::PrintFatalError(EvaluatingRecord->getLoc(), Msg); } Index: clang-tools-extra/pp-trace/PPTrace.cpp === --- clang-tools-extra/pp-trace/PPTrace.cpp +++ clang-tools-extra/pp-trace/PPTrace.cpp @@ -69,7 +69,7 @@ cl::desc("Output trace to the given file name or '-' for stdout."), cl::cat(Cat)); -LLVM_ATTRIBUTE_NORETURN static void error(Twine Message) { +[[noreturn]] static void error(Twine Message) { WithColor::error() << Message << '\n'; exit(1); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits