diff options
-rw-r--r-- | dex2oat/dex2oat.cc | 5 | ||||
-rw-r--r-- | patchoat/patchoat.cc | 3 | ||||
-rw-r--r-- | runtime/base/macros.h | 1 | ||||
-rw-r--r-- | runtime/native/java_lang_Runtime.cc | 3 | ||||
-rw-r--r-- | runtime/runtime.h | 5 |
5 files changed, 5 insertions, 12 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index d782aeb108..7be4349067 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -90,8 +90,7 @@ static void UsageError(const char* fmt, ...) { va_end(ap); } -static void Usage(const char* fmt, ...) NO_RETURN; -static void Usage(const char* fmt, ...) { +[[noreturn]] static void Usage(const char* fmt, ...) { va_list ap; va_start(ap, fmt); UsageErrorV(fmt, ap); @@ -663,7 +662,7 @@ class WatchDog { Message('W', message); } - static void Fatal(const std::string& message) NO_RETURN { + [[noreturn]] static void Fatal(const std::string& message) { Message('F', message); exit(1); } diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc index 2d165b05da..4ed428c200 100644 --- a/patchoat/patchoat.cc +++ b/patchoat/patchoat.cc @@ -644,8 +644,7 @@ static void UsageError(const char* fmt, ...) { va_end(ap); } -static void Usage(const char *fmt, ...) NO_RETURN; -static void Usage(const char *fmt, ...) { +[[noreturn]] static void Usage(const char *fmt, ...) { va_list ap; va_start(ap, fmt); UsageErrorV(fmt, ap); diff --git a/runtime/base/macros.h b/runtime/base/macros.h index bbe0f5a25a..f5a38bbf35 100644 --- a/runtime/base/macros.h +++ b/runtime/base/macros.h @@ -177,7 +177,6 @@ char (&ArraySizeHelper(T (&array)[N]))[N]; #define PURE __attribute__ ((__pure__)) #define WARN_UNUSED __attribute__((warn_unused_result)) -#define NO_RETURN __attribute__((noreturn)) template<typename T> void UNUSED(const T&) {} #define UNREACHABLE __builtin_unreachable diff --git a/runtime/native/java_lang_Runtime.cc b/runtime/native/java_lang_Runtime.cc index 62ca14de17..f9a1cee2d8 100644 --- a/runtime/native/java_lang_Runtime.cc +++ b/runtime/native/java_lang_Runtime.cc @@ -37,8 +37,7 @@ static void Runtime_gc(JNIEnv*, jclass) { Runtime::Current()->GetHeap()->CollectGarbage(false); } -static void Runtime_nativeExit(JNIEnv*, jclass, jint status) NO_RETURN; -static void Runtime_nativeExit(JNIEnv*, jclass, jint status) { +[[noreturn]] static void Runtime_nativeExit(JNIEnv*, jclass, jint status) { LOG(INFO) << "System.exit called, status: " << status; Runtime::Current()->CallExitHook(status); exit(status); diff --git a/runtime/runtime.h b/runtime/runtime.h index 30dabe7af4..7bffc335ef 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -177,10 +177,7 @@ class Runtime { // Aborts semi-cleanly. Used in the implementation of LOG(FATAL), which most // callers should prefer. - // This isn't marked ((noreturn)) because then gcc will merge multiple calls - // in a single function together. This reduces code size slightly, but means - // that the native stack trace we get may point at the wrong call site. - static void Abort() NO_RETURN LOCKS_EXCLUDED(Locks::abort_lock_); + [[noreturn]] static void Abort() LOCKS_EXCLUDED(Locks::abort_lock_); // Returns the "main" ThreadGroup, used when attaching user threads. jobject GetMainThreadGroup() const; |