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); } 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 &Msg) const { + [[noreturn]] void PrintFatalError(llvm::Twine const &Msg) const { assert(EvaluatingRecord && "not evaluating a record?"); llvm::PrintFatalError(EvaluatingRecord->getLoc(), Msg); } Index: flang/include/flang/Optimizer/Support/FatalError.h =================================================================== --- flang/include/flang/Optimizer/Support/FatalError.h +++ flang/include/flang/Optimizer/Support/FatalError.h @@ -20,7 +20,7 @@ /// 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, +[[noreturn]] inline void emitFatalError(mlir::Location loc, const llvm::Twine &message) { mlir::emitError(loc, message); llvm::report_fatal_error("aborting"); Index: lld/tools/lld/lld.cpp =================================================================== --- lld/tools/lld/lld.cpp +++ lld/tools/lld/lld.cpp @@ -54,7 +54,7 @@ Wasm, // -flavor wasm }; -[[noreturn]] static void die(const Twine &s) { +[[noreturn]]d die(const Twine &s) { llvm::errs() << s << "\n"; exit(1); } Index: lldb/source/Host/posix/ProcessLauncherPosixFork.cpp =================================================================== --- lldb/source/Host/posix/ProcessLauncherPosixFork.cpp +++ lldb/source/Host/posix/ProcessLauncherPosixFork.cpp @@ -46,7 +46,7 @@ #endif } -static void LLVM_ATTRIBUTE_NORETURN ExitWithError(int error_fd, +static void [[noreturn]] ExitWithError(int error_fd, const char *operation) { int err = errno; llvm::raw_fd_ostream os(error_fd, true); @@ -88,7 +88,7 @@ return; } -static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd, +static void [[noreturn]] ChildFunc(int error_fd, const ProcessLaunchInfo &info) { if (info.GetFlags().Test(eLaunchFlagLaunchInSeparateProcessGroup)) { if (setpgid(0, 0) != 0) 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() { +void [[noreturn]] Child() { if (ptrace(PTRACE_TRACEME, 0, nullptr, nullptr) == -1) _exit(1); Index: llvm/include/llvm/MC/MCContext.h =================================================================== --- llvm/include/llvm/MC/MCContext.h +++ llvm/include/llvm/MC/MCContext.h @@ -817,7 +817,7 @@ // Unrecoverable error has occurred. Display the best diagnostic we can // and bail via exit(1). For now, most MC backend errors are unrecoverable. // FIXME: We should really do something about that. - LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L, const Twine &Msg); + [[noreturn]] void reportFatalError(SMLoc L, const Twine &Msg); const MCAsmMacro *lookupMacro(StringRef Name) { StringMap::iterator I = MacroMap.find(Name); 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/CrashRecoveryContext.h =================================================================== --- llvm/include/llvm/Support/CrashRecoveryContext.h +++ llvm/include/llvm/Support/CrashRecoveryContext.h @@ -99,7 +99,7 @@ /// Explicitly trigger a crash recovery in the current process, and /// return failure from RunSafely(). This function does not return. - LLVM_ATTRIBUTE_NORETURN + [[noreturn]] void HandleExit(int RetCode); /// Throw again a signal or an exception, after it was catched once by a Index: llvm/include/llvm/Support/Error.h =================================================================== --- llvm/include/llvm/Support/Error.h +++ llvm/include/llvm/Support/Error.h @@ -257,7 +257,7 @@ // of debug prints can cause the function to be too large for inlining. So // it's important that we define this function out of line so that it can't be // inlined. - LLVM_ATTRIBUTE_NORETURN + [[noreturn]] void fatalUncheckedError() const; #endif @@ -688,7 +688,7 @@ } #if LLVM_ENABLE_ABI_BREAKING_CHECKS - LLVM_ATTRIBUTE_NORETURN + [[noreturn]] LLVM_ATTRIBUTE_NOINLINE void fatalUncheckedExpected() const { dbgs() << "Expected must be checked before access or destruction.\n"; @@ -722,7 +722,7 @@ /// Report a serious error, calling any installed error handler. See /// ErrorHandling.h. -LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, +[[noreturn]] void report_fatal_error(Error Err, bool gen_crash_diag = true); /// Report a fatal error if Err is a failure value. Index: llvm/include/llvm/Support/ErrorHandling.h =================================================================== --- llvm/include/llvm/Support/ErrorHandling.h +++ llvm/include/llvm/Support/ErrorHandling.h @@ -68,13 +68,13 @@ /// standard error, followed by a newline. /// After the error handler is called this function will call abort(), it /// does not return. -LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, +[[noreturn]] void report_fatal_error(const char *reason, bool gen_crash_diag = true); -LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const std::string &reason, +[[noreturn]] void report_fatal_error(const std::string &reason, bool gen_crash_diag = true); -LLVM_ATTRIBUTE_NORETURN void report_fatal_error(StringRef reason, +[[noreturn]] void report_fatal_error(StringRef reason, bool gen_crash_diag = true); -LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const Twine &reason, +[[noreturn]] void report_fatal_error(const Twine &reason, bool gen_crash_diag = true); /// Installs a new bad alloc error handler that should be used whenever a @@ -113,13 +113,13 @@ /// If no error handler is installed (default), throws a bad_alloc exception /// if LLVM is compiled with exception support. Otherwise prints the error /// to standard error and calls abort(). -LLVM_ATTRIBUTE_NORETURN void report_bad_alloc_error(const char *Reason, +[[noreturn]] void report_bad_alloc_error(const char *Reason, bool GenCrashDiag = true); /// This function calls abort(), and prints the optional message to stderr. /// Use the llvm_unreachable macro (that adds location info), instead of /// calling this function directly. -LLVM_ATTRIBUTE_NORETURN void +[[noreturn]] void llvm_unreachable_internal(const char *msg = nullptr, const char *file = nullptr, unsigned line = 0); } Index: llvm/include/llvm/Support/Process.h =================================================================== --- llvm/include/llvm/Support/Process.h +++ llvm/include/llvm/Support/Process.h @@ -214,11 +214,11 @@ /// In that case, the control flow will resume after RunSafely(), like for a /// crash, rather than exiting the current process. /// Use \arg NoCleanup for calling _exit() instead of exit(). - LLVM_ATTRIBUTE_NORETURN + [[noreturn]] static void Exit(int RetCode, bool NoCleanup = false); private: - LLVM_ATTRIBUTE_NORETURN + [[noreturn]] static void ExitNoCleanup(int RetCode); }; Index: llvm/include/llvm/Support/Windows/WindowsSupport.h =================================================================== --- llvm/include/llvm/Support/Windows/WindowsSupport.h +++ llvm/include/llvm/Support/Windows/WindowsSupport.h @@ -68,7 +68,7 @@ bool MakeErrMsg(std::string *ErrMsg, const std::string &prefix); // Include GetLastError() in a fatal error message. -LLVM_ATTRIBUTE_NORETURN inline void ReportLastErrorFatal(const char *Msg) { +[[noreturn]] inline void ReportLastErrorFatal(const char *Msg) { std::string ErrMsg; MakeErrMsg(&ErrMsg, Msg); llvm::report_fatal_error(ErrMsg); Index: llvm/include/llvm/TableGen/Error.h =================================================================== --- llvm/include/llvm/TableGen/Error.h +++ llvm/include/llvm/TableGen/Error.h @@ -22,12 +22,12 @@ void PrintNote(const Twine &Msg); void PrintNote(ArrayRef NoteLoc, const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(ArrayRef ErrorLoc, +[[noreturn]] void PrintFatalNote(const Twine &Msg); +[[noreturn]] void PrintFatalNote(ArrayRef ErrorLoc, const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const Record *Rec, +[[noreturn]] void PrintFatalNote(const Record *Rec, const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const RecordVal *RecVal, +[[noreturn]] void PrintFatalNote(const RecordVal *RecVal, const Twine &Msg); void PrintWarning(const Twine &Msg); @@ -40,12 +40,12 @@ void PrintError(const Record *Rec, const Twine &Msg); void PrintError(const RecordVal *RecVal, const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef ErrorLoc, +[[noreturn]] void PrintFatalError(const Twine &Msg); +[[noreturn]] void PrintFatalError(ArrayRef ErrorLoc, const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Record *Rec, +[[noreturn]] void PrintFatalError(const Record *Rec, const Twine &Msg); -LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const RecordVal *RecVal, +[[noreturn]] void PrintFatalError(const RecordVal *RecVal, const Twine &Msg); void CheckAssert(SMLoc Loc, Init *Condition, Init *Message); Index: llvm/lib/LTO/LTOBackend.cpp =================================================================== --- llvm/lib/LTO/LTOBackend.cpp +++ llvm/lib/LTO/LTOBackend.cpp @@ -74,7 +74,7 @@ cl::desc("Assume the input has already undergone ThinLTO function " "importing and the other pre-optimization pipeline changes.")); -LLVM_ATTRIBUTE_NORETURN static void reportOpenError(StringRef Path, Twine Msg) { +[[noreturn]] static void reportOpenError(StringRef Path, Twine Msg) { errs() << "failed to open " << Path << ": " << Msg << '\n'; errs().flush(); exit(1); Index: llvm/lib/Support/CrashRecoveryContext.cpp =================================================================== --- llvm/lib/Support/CrashRecoveryContext.cpp +++ llvm/lib/Support/CrashRecoveryContext.cpp @@ -428,7 +428,7 @@ #endif // !_MSC_VER -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] void CrashRecoveryContext::HandleExit(int RetCode) { #if defined(_WIN32) // SEH and VEH Index: llvm/lib/Support/Process.cpp =================================================================== --- llvm/lib/Support/Process.cpp +++ llvm/lib/Support/Process.cpp @@ -92,7 +92,7 @@ bool Process::AreCoreFilesPrevented() { return coreFilesPrevented; } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] void Process::Exit(int RetCode, bool NoCleanup) { if (CrashRecoveryContext *CRC = CrashRecoveryContext::GetCurrent()) CRC->HandleExit(RetCode); Index: llvm/lib/Support/SmallVector.cpp =================================================================== --- llvm/lib/Support/SmallVector.cpp +++ llvm/lib/Support/SmallVector.cpp @@ -47,7 +47,7 @@ /// Report that MinSize doesn't fit into this vector's size type. Throws /// std::length_error or calls report_fatal_error. -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void report_size_overflow(size_t MinSize, size_t MaxSize); static void report_size_overflow(size_t MinSize, size_t MaxSize) { std::string Reason = "SmallVector unable to grow. Requested capacity (" + @@ -63,7 +63,7 @@ /// Report that this vector is already at maximum capacity. Throws /// std::length_error or calls report_fatal_error. -LLVM_ATTRIBUTE_NORETURN static void report_at_maximum_capacity(size_t MaxSize); +[[noreturn]] static void report_at_maximum_capacity(size_t MaxSize); static void report_at_maximum_capacity(size_t MaxSize) { std::string Reason = "SmallVector capacity unable to grow. Already at maximum size " + Index: llvm/lib/Support/Unix/Process.inc =================================================================== --- llvm/lib/Support/Unix/Process.inc +++ llvm/lib/Support/Unix/Process.inc @@ -461,5 +461,5 @@ #endif } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] void Process::ExitNoCleanup(int RetCode) { _Exit(RetCode); } Index: llvm/lib/Support/Unix/Unix.h =================================================================== --- llvm/lib/Support/Unix/Unix.h +++ llvm/lib/Support/Unix/Unix.h @@ -67,7 +67,7 @@ } // Include StrError(errnum) in a fatal error message. -LLVM_ATTRIBUTE_NORETURN static inline void ReportErrnumFatal(const char *Msg, +[[noreturn]] static inline void ReportErrnumFatal(const char *Msg, int errnum) { std::string ErrMsg; MakeErrMsg(&ErrMsg, Msg, errnum); Index: llvm/lib/Support/Windows/Process.inc =================================================================== --- llvm/lib/Support/Windows/Process.inc +++ llvm/lib/Support/Windows/Process.inc @@ -504,7 +504,7 @@ return GetWindowsOSVersion() >= llvm::VersionTuple(6, 2, 0, 0); } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] void Process::ExitNoCleanup(int RetCode) { TerminateProcess(GetCurrentProcess(), RetCode); llvm_unreachable("TerminateProcess doesn't return"); Index: llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp =================================================================== --- llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp +++ llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp @@ -448,7 +448,7 @@ ++MCNumEmitted; } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void raise_relocation_error(unsigned Width, unsigned Kind) { std::string Text; raw_string_ostream Stream(Text); Index: llvm/lib/Transforms/Coroutines/Coroutines.cpp =================================================================== --- llvm/lib/Transforms/Coroutines/Coroutines.cpp +++ llvm/lib/Transforms/Coroutines/Coroutines.cpp @@ -571,7 +571,7 @@ llvm_unreachable("Unknown coro::ABI enum"); } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void fail(const Instruction *I, const char *Reason, Value *V) { #ifndef NDEBUG I->dump(); Index: llvm/tools/llc/llc.cpp =================================================================== --- llvm/tools/llc/llc.cpp +++ llvm/tools/llc/llc.cpp @@ -201,7 +201,7 @@ static int compileModule(char **, LLVMContext &); -LLVM_ATTRIBUTE_NORETURN static void reportError(Twine Msg, +[[noreturn]] static void reportError(Twine Msg, StringRef Filename = "") { SmallString<256> Prefix; if (!Filename.empty()) { @@ -213,7 +213,7 @@ exit(1); } -LLVM_ATTRIBUTE_NORETURN static void reportError(Error Err, StringRef Filename) { +[[noreturn]] static void reportError(Error Err, StringRef Filename) { assert(Err); handleAllErrors(createFileError(Filename, std::move(Err)), [&](const ErrorInfoBase &EI) { reportError(EI.message()); }); Index: llvm/tools/lli/lli.cpp =================================================================== --- llvm/tools/lli/lli.cpp +++ llvm/tools/lli/lli.cpp @@ -410,7 +410,7 @@ llvm_unreachable("Unrecognized opt level."); } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void reportError(SMDiagnostic Err, const char *ProgName) { Err.print(ProgName, errs()); exit(1); Index: llvm/tools/llvm-ar/llvm-ar.cpp =================================================================== --- llvm/tools/llvm-ar/llvm-ar.cpp +++ llvm/tools/llvm-ar/llvm-ar.cpp @@ -136,14 +136,14 @@ static bool ParsingMRIScript; // Show the error plus the usage message, and exit. -LLVM_ATTRIBUTE_NORETURN static void badUsage(Twine Error) { +[[noreturn]] static void badUsage(Twine Error) { WithColor::error(errs(), ToolName) << Error << "\n"; printHelpMessage(); exit(1); } // Show the error message and exit. -LLVM_ATTRIBUTE_NORETURN static void fail(Twine Error) { +[[noreturn]] static void fail(Twine Error) { if (ParsingMRIScript) { WithColor::error(errs(), ToolName) << "script line " << MRILineNumber << ": " << Error << "\n"; Index: llvm/tools/llvm-cvtres/llvm-cvtres.cpp =================================================================== --- llvm/tools/llvm-cvtres/llvm-cvtres.cpp +++ llvm/tools/llvm-cvtres/llvm-cvtres.cpp @@ -67,7 +67,7 @@ }; } -static LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg) { +[[noreturn]] static void reportError(Twine Msg) { errs() << Msg; exit(1); } Index: llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp =================================================================== --- llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp +++ llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp @@ -49,7 +49,7 @@ exit(1); } -LLVM_ATTRIBUTE_NORETURN static void error(Error Err) { +[[noreturn]] static void error(Error Err) { logAllUnhandledErrors(std::move(Err), WithColor::error(outs()), "reading file: "); outs().flush(); Index: llvm/tools/llvm-ifs/ErrorCollector.h =================================================================== --- llvm/tools/llvm-ifs/ErrorCollector.h +++ llvm/tools/llvm-ifs/ErrorCollector.h @@ -61,7 +61,7 @@ bool allErrorsHandled() const; /// Dump output and crash. - LLVM_ATTRIBUTE_NORETURN void fatalUnhandledError(); + [[noreturn]] void fatalUnhandledError(); bool ErrorsAreFatal; std::vector Errors; Index: llvm/tools/llvm-ifs/ErrorCollector.cpp =================================================================== --- llvm/tools/llvm-ifs/ErrorCollector.cpp +++ llvm/tools/llvm-ifs/ErrorCollector.cpp @@ -57,7 +57,7 @@ } } -LLVM_ATTRIBUTE_NORETURN void ErrorCollector::fatalUnhandledError() { +[[noreturn]] void ErrorCollector::fatalUnhandledError() { errs() << "Program aborted due to unhandled Error(s):\n"; log(errs()); errs() << "\n"; Index: llvm/tools/llvm-lipo/llvm-lipo.cpp =================================================================== --- llvm/tools/llvm-lipo/llvm-lipo.cpp +++ llvm/tools/llvm-lipo/llvm-lipo.cpp @@ -36,13 +36,13 @@ static const StringRef ToolName = "llvm-lipo"; static LLVMContext LLVMCtx; -LLVM_ATTRIBUTE_NORETURN static void reportError(Twine Message) { +[[noreturn]] static void reportError(Twine Message) { WithColor::error(errs(), ToolName) << Message << "\n"; errs().flush(); exit(EXIT_FAILURE); } -LLVM_ATTRIBUTE_NORETURN static void reportError(Error E) { +[[noreturn]] static void reportError(Error E) { assert(E); std::string Buf; raw_string_ostream OS(Buf); @@ -51,7 +51,7 @@ reportError(Buf); } -LLVM_ATTRIBUTE_NORETURN static void reportError(StringRef File, Error E) { +[[noreturn]] static void reportError(StringRef File, Error E) { assert(E); std::string Buf; raw_string_ostream OS(Buf); @@ -350,7 +350,7 @@ return InputBinaries; } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void verifyArch(ArrayRef> InputBinaries, ArrayRef VerifyArchList) { assert(!VerifyArchList.empty() && @@ -433,14 +433,14 @@ OS << SliceOrErr->getArchString() << " \n"; } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void printArchs(ArrayRef> InputBinaries) { assert(InputBinaries.size() == 1 && "Incorrect number of input binaries"); printBinaryArchs(InputBinaries.front().getBinary(), outs()); exit(EXIT_SUCCESS); } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void printInfo(ArrayRef> InputBinaries) { // Group universal and thin files together for compatibility with cctools lipo for (auto &IB : InputBinaries) { @@ -463,7 +463,7 @@ exit(EXIT_SUCCESS); } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void thinSlice(ArrayRef> InputBinaries, StringRef ArchType, StringRef OutputFileName) { assert(!ArchType.empty() && "The architecture type should be non-empty"); @@ -599,7 +599,7 @@ return Slices; } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void createUniversalBinary(ArrayRef> InputBinaries, const StringMap &Alignments, StringRef OutputFileName) { @@ -619,7 +619,7 @@ exit(EXIT_SUCCESS); } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void extractSlice(ArrayRef> InputBinaries, const StringMap &Alignments, StringRef ArchType, StringRef OutputFileName) { @@ -678,7 +678,7 @@ return Slices; } -LLVM_ATTRIBUTE_NORETURN +[[noreturn]] static void replaceSlices(ArrayRef> InputBinaries, const StringMap &Alignments, StringRef OutputFileName, Index: llvm/tools/llvm-mt/llvm-mt.cpp =================================================================== --- llvm/tools/llvm-mt/llvm-mt.cpp +++ llvm/tools/llvm-mt/llvm-mt.cpp @@ -64,7 +64,7 @@ }; } // namespace -LLVM_ATTRIBUTE_NORETURN static void reportError(Twine Msg) { +[[noreturn]] static void reportError(Twine Msg) { WithColor::error(errs(), "llvm-mt") << Msg << '\n'; exit(1); } Index: llvm/tools/llvm-objdump/llvm-objdump.h =================================================================== --- llvm/tools/llvm-objdump/llvm-objdump.h +++ llvm/tools/llvm-objdump/llvm-objdump.h @@ -139,8 +139,8 @@ void printSymbol(const object::ObjectFile *O, const object::SymbolRef &Symbol, StringRef FileName, StringRef ArchiveName, StringRef ArchitectureName, bool DumpDynamic); -LLVM_ATTRIBUTE_NORETURN void reportError(StringRef File, const Twine &Message); -LLVM_ATTRIBUTE_NORETURN void reportError(Error E, StringRef FileName, +[[noreturn]] void reportError(StringRef File, const Twine &Message); +[[noreturn]] void reportError(Error E, StringRef FileName, StringRef ArchiveName = "", StringRef ArchitectureName = ""); void reportWarning(const Twine &Message, StringRef File); Index: llvm/tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- llvm/tools/llvm-objdump/llvm-objdump.cpp +++ llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -297,14 +297,14 @@ << "'" << File << "': " << Message << "\n"; } -LLVM_ATTRIBUTE_NORETURN void objdump::reportError(StringRef File, +[[noreturn]] void objdump::reportError(StringRef File, const Twine &Message) { outs().flush(); WithColor::error(errs(), ToolName) << "'" << File << "': " << Message << "\n"; exit(1); } -LLVM_ATTRIBUTE_NORETURN void objdump::reportError(Error E, StringRef FileName, +[[noreturn]] void objdump::reportError(Error E, StringRef FileName, StringRef ArchiveName, StringRef ArchitectureName) { assert(E); @@ -325,7 +325,7 @@ WithColor::warning(errs(), ToolName) << Message << "\n"; } -LLVM_ATTRIBUTE_NORETURN static void reportCmdLineError(const Twine &Message) { +[[noreturn]] static void reportCmdLineError(const Twine &Message) { WithColor::error(errs(), ToolName) << Message << "\n"; exit(1); } Index: llvm/tools/llvm-profgen/ErrorHandling.h =================================================================== --- llvm/tools/llvm-profgen/ErrorHandling.h +++ llvm/tools/llvm-profgen/ErrorHandling.h @@ -18,7 +18,7 @@ using namespace llvm; -LLVM_ATTRIBUTE_NORETURN inline void +[[noreturn]] inline void exitWithError(const Twine &Message, StringRef Whence = StringRef(), StringRef Hint = StringRef()) { WithColor::error(errs(), "llvm-profgen"); @@ -30,12 +30,12 @@ ::exit(EXIT_FAILURE); } -LLVM_ATTRIBUTE_NORETURN inline void +[[noreturn]] inline void exitWithError(std::error_code EC, StringRef Whence = StringRef()) { exitWithError(EC.message(), Whence); } -LLVM_ATTRIBUTE_NORETURN inline void exitWithError(Error E, StringRef Whence) { +[[noreturn]] inline void exitWithError(Error E, StringRef Whence) { exitWithError(errorToErrorCode(std::move(E)), Whence); } Index: llvm/tools/llvm-rc/llvm-rc.cpp =================================================================== --- llvm/tools/llvm-rc/llvm-rc.cpp +++ llvm/tools/llvm-rc/llvm-rc.cpp @@ -111,7 +111,7 @@ static FileRemover TempPreprocFile; static FileRemover TempResFile; -LLVM_ATTRIBUTE_NORETURN static void fatalError(const Twine &Message) { +[[noreturn]] static void fatalError(const Twine &Message) { errs() << Message << "\n"; exit(1); } Index: llvm/tools/llvm-readobj/llvm-readobj.h =================================================================== --- llvm/tools/llvm-readobj/llvm-readobj.h +++ llvm/tools/llvm-readobj/llvm-readobj.h @@ -21,7 +21,7 @@ } // Various helper functions. - LLVM_ATTRIBUTE_NORETURN void reportError(Error Err, StringRef Input); + [[noreturn]] void reportError(Error Err, StringRef Input); void reportWarning(Error Err, StringRef Input); template T unwrapOrError(StringRef Input, Expected EO) { Index: llvm/tools/llvm-readobj/llvm-readobj.cpp =================================================================== --- llvm/tools/llvm-readobj/llvm-readobj.cpp +++ llvm/tools/llvm-readobj/llvm-readobj.cpp @@ -157,7 +157,7 @@ namespace llvm { -LLVM_ATTRIBUTE_NORETURN static void error(Twine Msg) { +[[noreturn]] static void error(Twine Msg) { // Flush the standard output to print the error at a // proper place. fouts().flush(); @@ -165,7 +165,7 @@ exit(1); } -LLVM_ATTRIBUTE_NORETURN void reportError(Error Err, StringRef Input) { +[[noreturn]] void reportError(Error Err, StringRef Input) { assert(Err); if (Input == "-") Input = ""; Index: llvm/tools/llvm-strings/llvm-strings.cpp =================================================================== --- llvm/tools/llvm-strings/llvm-strings.cpp +++ llvm/tools/llvm-strings/llvm-strings.cpp @@ -73,7 +73,7 @@ enum radix { none, octal, hexadecimal, decimal }; static radix Radix; -LLVM_ATTRIBUTE_NORETURN static void reportCmdLineError(const Twine &Message) { +[[noreturn]] static void reportCmdLineError(const Twine &Message) { WithColor::error(errs(), ToolName) << Message << "\n"; exit(1); } Index: llvm/tools/split-file/split-file.cpp =================================================================== --- llvm/tools/split-file/split-file.cpp +++ llvm/tools/split-file/split-file.cpp @@ -42,7 +42,7 @@ static StringRef toolName; static int errorCount; -LLVM_ATTRIBUTE_NORETURN static void fatal(StringRef filename, +[[noreturn]] static void fatal(StringRef filename, const Twine &message) { if (filename.empty()) WithColor::error(errs(), toolName) << message << '\n';