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

via flang-commits flang-commits at lists.llvm.org
Thu Jan 22 10:00:48 PST 2026


================
@@ -28,8 +28,9 @@ static void ConfigureFloatingPoint() {
 
 extern "C" {
 void RTNAME(ProgramStart)(int argc, const char *argv[], const char *envp[],
-    const EnvironmentDefaultList *envDefaults) {
-  std::atexit(Fortran::runtime::NotifyOtherImagesOfNormalEnd);
+    const EnvironmentDefaultList *envDefaults,
+    const bool multiImageInitialized) {
+  Fortran::runtime::exitHandler.Configure(multiImageInitialized);
----------------
jeanPerier wrote:

Why is this here an not under mif.init lowering?
I think it would be simpler from an engineering point of view if everything is in one place as much as possible.

If the issue is that it is not easy to generate `Fortran::runtime::exitHandler.Configure` call from the compiler, you could have a wrapper API `EnableMultimage` that calls this.

Maybe this is not needed though if you rely on the callback being set-up as the condition.

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


More information about the flang-commits mailing list