Skip to content

Commit 93ee588

Browse files
committed
[flang] Rename the runtime routine that reports a fatal user error
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
1 parent 245b8e5 commit 93ee588

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

flang/include/flang/Runtime/stop.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ NORETURN void RTNAME(Abort)(NO_ARGUMENTS);
3232

3333
// Crash with an error message when the program dynamically violates a Fortran
3434
// constraint.
35-
NORETURN void RTNAME(Crash)(const char *message, const char *source, int line);
35+
NORETURN void RTNAME(ReportFatalUserError)(
36+
const char *message, const char *source, int line);
3637

3738
FORTRAN_EXTERN_C_END
3839

flang/runtime/stop.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void RTNAME(PauseStatementText)(const char *code, std::size_t length) {
144144

145145
[[noreturn]] void RTNAME(Abort)() { std::abort(); }
146146

147-
[[noreturn]] void RTNAME(Crash)(
147+
[[noreturn]] void RTNAME(ReportFatalUserError)(
148148
const char *message, const char *source, int line) {
149149
Fortran::runtime::Terminator{source, line}.Crash(message);
150150
}

flang/unittests/Runtime/Stop.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ TEST(TestProgramEnd, CrashTest) {
9191
static const std::string tailMessage{":343\\): "};
9292
static const std::string fullMessage{
9393
headMessage + fileName + tailMessage + crashMessage};
94-
EXPECT_DEATH(RTNAME(Crash)(crashMessage.c_str(), fileName.c_str(), 343),
94+
EXPECT_DEATH(
95+
RTNAME(ReportFatalUserError)(crashMessage.c_str(), fileName.c_str(), 343),
9596
fullMessage.c_str());
9697
}

0 commit comments

Comments
 (0)