[flang-commits] [flang] [llvm] [flang][MIF] Adding Stop and ErrorStop operations (PR #166787)

Dan Bonachea via flang-commits flang-commits at lists.llvm.org
Tue Jan 13 21:33:06 PST 2026


================
@@ -93,10 +100,34 @@ RT_API_ATTRS void Terminator::CrashHeader() const {
       sourceFileName_, sourceLine_);
 }
 
-// TODO: These will be defined in the coarray runtime library
-RT_API_ATTRS void NotifyOtherImagesOfNormalEnd() {}
-RT_API_ATTRS void NotifyOtherImagesOfFailImageStatement() {}
-RT_API_ATTRS void NotifyOtherImagesOfErrorTermination() {}
+void ExitHandler::Configure(bool mifEnabled) {
+  multiImageFeatureEnabled = mifEnabled;
+}
+
+void ExitHandler::Exit(int exitCode) {
+  if (multiImageFeatureEnabled)
+    if (exitCode == EXIT_SUCCESS)
+      SynchronizeImagesOfNormalEnd(exitCode);
+    else
+      NotifyOtherImagesOfErrorTermination(exitCode);
----------------
bonachea wrote:

Thanks, I think this thread can be resolved now and remaining issues discussed in new threads.

https://github.com/llvm/llvm-project/pull/166787


More information about the flang-commits mailing list