Eliminate the ABORT() macro

Terminating the process should be done with extreme caution. Usually
DABORT() is intended to be used instead. The ABORT() macro was making
it too easy to write code that causes the application to terminate in
relatively benign circumstances.

If scenarios are encountered which demand process termination (as
prescribed by the graphics API spec or as a platform requirement), we
can still use ::abort(), or bring back this macro with a scarier name.

Bug: b/154650520
Change-Id: I53780f72b22faadd62825d000661b605b77b597c
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44208
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Reactor/Debug.hpp b/src/Reactor/Debug.hpp
index d459511..4131bd0 100644
--- a/src/Reactor/Debug.hpp
+++ b/src/Reactor/Debug.hpp
@@ -69,23 +69,15 @@
 // A macro to print a warning message to the debugging log and stderr.
 #define WARN(message, ...) rr::warn("%s:%d WARNING: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 
-// A macro that prints the message to the debugging log and stderr and
-// immediately aborts execution of the application.
-//
-// Note: This will terminate the application regardless of build flags!
-//       Use with extreme caution!
-#undef ABORT
-#define ABORT(message, ...) rr::abort("%s:%d ABORT: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
-
 // A macro that delegates to:
-//   ABORT() in debug builds (!NDEBUG || DCHECK_ALWAYS_ON)
+//   abort() in debug builds (!NDEBUG || DCHECK_ALWAYS_ON)
 // or
-//   WARN() in release builds (NDEBUG && !DCHECK_ALWAYS_ON)
+//   warn() in release builds (NDEBUG && !DCHECK_ALWAYS_ON)
 #undef DABORT
 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
-#	define DABORT(message, ...) ABORT(message, ##__VA_ARGS__)
+#	define DABORT(message, ...) rr::abort("%s:%d ABORT: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 #else
-#	define DABORT(message, ...) WARN(message, ##__VA_ARGS__)
+#	define DABORT(message, ...) rr::warn("%s:%d WARNING: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__);
 #endif
 
 // A macro asserting a condition.
diff --git a/src/System/Debug.hpp b/src/System/Debug.hpp
index 16a612e..56f6db3 100644
--- a/src/System/Debug.hpp
+++ b/src/System/Debug.hpp
@@ -69,23 +69,15 @@
 // A macro to print a warning message to the debugging log and stderr.
 #define WARN(message, ...) sw::warn("%s:%d WARNING: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 
-// A macro that prints the message to the debugging log and stderr and
-// immediately aborts execution of the application.
-//
-// Note: This will terminate the application regardless of build flags!
-//       Use with extreme caution!
-#undef ABORT
-#define ABORT(message, ...) sw::abort("%s:%d ABORT: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
-
 // A macro that delegates to:
-//   ABORT() in debug builds (!NDEBUG || DCHECK_ALWAYS_ON)
+//   abort() in debug builds (!NDEBUG || DCHECK_ALWAYS_ON)
 // or
-//   WARN() in release builds (NDEBUG && !DCHECK_ALWAYS_ON)
+//   warn() in release builds (NDEBUG && !DCHECK_ALWAYS_ON)
 #undef DABORT
 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
-#	define DABORT(message, ...) ABORT(message, ##__VA_ARGS__)
+#	define DABORT(message, ...) sw::abort("%s:%d ABORT: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 #else
-#	define DABORT(message, ...) WARN(message, ##__VA_ARGS__)
+#	define DABORT(message, ...) sw::warn("%s:%d WARNING: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__);
 #endif
 
 // A macro asserting a condition.