[PATCH] D118703: [flang] Rename the runtime routine that reports a fatal user error

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 07:40:03 PST 2022


PeteSteinfeld created this revision.
Herald added a project: Flang.
PeteSteinfeld requested review of this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118703

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


Index: flang/unittests/Runtime/Stop.cpp
===================================================================
--- flang/unittests/Runtime/Stop.cpp
+++ flang/unittests/Runtime/Stop.cpp
@@ -91,6 +91,7 @@
   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());
 }
Index: flang/runtime/stop.cpp
===================================================================
--- flang/runtime/stop.cpp
+++ flang/runtime/stop.cpp
@@ -144,7 +144,7 @@
 
 [[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: flang/include/flang/Runtime/stop.h
===================================================================
--- flang/include/flang/Runtime/stop.h
+++ flang/include/flang/Runtime/stop.h
@@ -32,7 +32,8 @@
 
 // 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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118703.404936.patch
Type: text/x-patch
Size: 1511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220201/ecd33d06/attachment.bin>


More information about the llvm-commits mailing list