[flang-commits] [flang] [llvm] [flang][MIF] Adding Stop and ErrorStop operations (PR #166787)
Dan Bonachea via flang-commits
flang-commits at lists.llvm.org
Thu Jan 22 11:53:53 PST 2026
================
@@ -112,9 +113,23 @@ class Terminator {
else \
Terminator{__FILE__, __LINE__}.CheckFailed(#pred)
-RT_API_ATTRS void NotifyOtherImagesOfNormalEnd();
+struct ExitHandler {
+ ExitHandler() {};
+
+ void Configure(bool multiImageFeatureEnabled);
+ [[noreturn]] void NormalExit(int exitCode);
+ [[noreturn]] void ErrorExit(int exitCode);
+
+ bool multiImageFeatureEnabled{false};
----------------
bonachea wrote:
I initially had a similar thought. However then it occurred to me that it might _eventually_ be useful for other code in flang-rt to have the ability to query whether this is a multi-image run (without actually invoking termination). Assuming @JDPailleux makes the requested change of privatizing the Callback state variables, this boolean would remain the only public indication of multi-image execution.
However that is all speculative and irrelevant to the current PR. I agree that for the purposes of only this PR it would simpler to omit this boolean for now, and we can always engineer a query mechanism in a later PR when we need it.
https://github.com/llvm/llvm-project/pull/166787
More information about the flang-commits
mailing list