[flang-commits] [flang] flang: allow EXIT to accept integer arguments of any kind (PR #174610)

via flang-commits flang-commits at lists.llvm.org
Tue Jan 6 10:44:58 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- flang/lib/Evaluate/intrinsics.cpp flang/lib/Optimizer/Builder/IntrinsicCall.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index 8552a1dd7..5668d3fb8 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -2157,15 +2157,14 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
           semantics::IsTeamType(&type->GetDerivedTypeSpec());
       break;
     case KindCode::defaultIntegerKind:
-  if (name == "exit" && d.keyword == "status" &&
-      type->category() == TypeCategory::Integer) {
-    // GNU / CCE compatibility: allow any integer kind
-    argOk = true;
-  } else {
-    argOk = type->kind() ==
-        defaults.GetDefaultKind(TypeCategory::Integer);
-  }
-  break;
+      if (name == "exit" && d.keyword == "status" &&
+          type->category() == TypeCategory::Integer) {
+        // GNU / CCE compatibility: allow any integer kind
+        argOk = true;
+      } else {
+        argOk = type->kind() == defaults.GetDefaultKind(TypeCategory::Integer);
+      }
+      break;
 
     case KindCode::defaultRealKind:
       argOk = type->kind() == defaults.GetDefaultKind(TypeCategory::Real);
@@ -2294,7 +2293,6 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
           d.keyword, type->AsFortran());
       return std::nullopt;
     }
-    
   }
 
   // Check the ranks of the arguments against the intrinsic's interface.
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index ccf500f85..3b5163f58 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -3862,7 +3862,6 @@ void IntrinsicLibrary::genExit(llvm::ArrayRef<fir::ExtendedValue> args) {
   fir::runtime::genExit(builder, loc, status);
 }
 
-
 // EXPONENT
 mlir::Value IntrinsicLibrary::genExponent(mlir::Type resultType,
                                           llvm::ArrayRef<mlir::Value> args) {

``````````

</details>


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


More information about the flang-commits mailing list