[flang] Rename the runtime routine that reports a fatal user error
authorPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 1 Feb 2022 15:38:10 +0000 (07:38 -0800)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 1 Feb 2022 17:01:50 +0000 (09:01 -0800)
As per Steve Scalpone's suggestion, I've renamed the runtime routine to
better evoke its purpose.

I implemented a routine called "Crash" and added a test.

Differential Revision: https://reviews.llvm.org/D118703

flang/include/flang/Runtime/stop.h
flang/runtime/stop.cpp
flang/unittests/Runtime/Stop.cpp

index b129734..cf5ee7b 100644 (file)
@@ -32,7 +32,8 @@ NORETURN void RTNAME(Abort)(NO_ARGUMENTS);
 
 // Crash with an error message when the program dynamically violates a Fortran
 // constraint.
-NORETURN void RTNAME(Crash)(const char *message, const char *source, int line);
+NORETURN void RTNAME(ReportFatalUserError)(
+    const char *message, const char *source, int line);
 
 FORTRAN_EXTERN_C_END
 
index 8d43ad8..7bbbf90 100644 (file)
@@ -144,7 +144,7 @@ void RTNAME(PauseStatementText)(const char *code, std::size_t length) {
 
 [[noreturn]] void RTNAME(Abort)() { std::abort(); }
 
-[[noreturn]] void RTNAME(Crash)(
+[[noreturn]] void RTNAME(ReportFatalUserError)(
     const char *message, const char *source, int line) {
   Fortran::runtime::Terminator{source, line}.Crash(message);
 }
index ace69bf..9d962bf 100644 (file)
@@ -91,6 +91,7 @@ TEST(TestProgramEnd, CrashTest) {
   static const std::string tailMessage{":343\\): "};
   static const std::string fullMessage{
       headMessage + fileName + tailMessage + crashMessage};
-  EXPECT_DEATH(RTNAME(Crash)(crashMessage.c_str(), fileName.c_str(), 343),
+  EXPECT_DEATH(
+      RTNAME(ReportFatalUserError)(crashMessage.c_str(), fileName.c_str(), 343),
       fullMessage.c_str());
 }