[flang-commits] [flang] [flang] GETUID runtime and lowering intrinsics (PR #71689)

via flang-commits flang-commits at lists.llvm.org
Wed Nov 8 07:25:02 PST 2023


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 b663d6a310ffc916f418fa378b47abd5213140ae dacd70d2107a2b071bf4360e14306dc67ecc9789 -- flang/include/flang/Optimizer/Builder/IntrinsicCall.h flang/include/flang/Optimizer/Builder/Runtime/Command.h flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h flang/include/flang/Runtime/command.h flang/lib/Evaluate/intrinsics.cpp flang/lib/Optimizer/Builder/IntrinsicCall.cpp flang/lib/Optimizer/Builder/Runtime/Command.cpp flang/runtime/command.cpp flang/unittests/Optimizer/Builder/Runtime/CommandTest.cpp flang/unittests/Runtime/CommandTest.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/include/flang/Runtime/command.h b/flang/include/flang/Runtime/command.h
index 20f139123190..9af176e955c3 100644
--- a/flang/include/flang/Runtime/command.h
+++ b/flang/include/flang/Runtime/command.h
@@ -19,43 +19,43 @@ typedef int uid_t
 #include "sys/types.h"
 #endif
 
-namespace Fortran::runtime {
-class Descriptor;
-
-extern "C" {
-// 16.9.51 COMMAND_ARGUMENT_COUNT
-//
-// Lowering may need to cast the result to match the precision of the default
-// integer kind.
-std::int32_t RTNAME(ArgumentCount)();
-
-// Calls getuid()
-uid_t RTNAME(GetUID)();
-
-// 16.9.82 GET_COMMAND
-// Try to get the value of the whole command. All of the parameters are
-// optional.
-// Return a STATUS as described in the standard.
-std::int32_t RTNAME(GetCommand)(const Descriptor *command = nullptr,
-    const Descriptor *length = nullptr, const Descriptor *errmsg = nullptr,
-    const char *sourceFile = nullptr, int line = 0);
-
-// 16.9.83 GET_COMMAND_ARGUMENT
-// Try to get the value of the n'th argument.
-// Returns a STATUS as described in the standard.
-std::int32_t RTNAME(GetCommandArgument)(std::int32_t n,
-    const Descriptor *argument = nullptr, const Descriptor *length = nullptr,
-    const Descriptor *errmsg = nullptr, const char *sourceFile = nullptr,
-    int line = 0);
-
-// 16.9.84 GET_ENVIRONMENT_VARIABLE
-// Try to get the value of the environment variable specified by NAME.
-// Returns a STATUS as described in the standard.
-std::int32_t RTNAME(GetEnvVariable)(const Descriptor &name,
-    const Descriptor *value = nullptr, const Descriptor *length = nullptr,
-    bool trim_name = true, const Descriptor *errmsg = nullptr,
-    const char *sourceFile = nullptr, int line = 0);
-}
+    namespace Fortran::runtime {
+  class Descriptor;
+
+  extern "C" {
+  // 16.9.51 COMMAND_ARGUMENT_COUNT
+  //
+  // Lowering may need to cast the result to match the precision of the default
+  // integer kind.
+  std::int32_t RTNAME(ArgumentCount)();
+
+  // Calls getuid()
+  uid_t RTNAME(GetUID)();
+
+  // 16.9.82 GET_COMMAND
+  // Try to get the value of the whole command. All of the parameters are
+  // optional.
+  // Return a STATUS as described in the standard.
+  std::int32_t RTNAME(GetCommand)(const Descriptor *command = nullptr,
+      const Descriptor *length = nullptr, const Descriptor *errmsg = nullptr,
+      const char *sourceFile = nullptr, int line = 0);
+
+  // 16.9.83 GET_COMMAND_ARGUMENT
+  // Try to get the value of the n'th argument.
+  // Returns a STATUS as described in the standard.
+  std::int32_t RTNAME(GetCommandArgument)(std::int32_t n,
+      const Descriptor *argument = nullptr, const Descriptor *length = nullptr,
+      const Descriptor *errmsg = nullptr, const char *sourceFile = nullptr,
+      int line = 0);
+
+  // 16.9.84 GET_ENVIRONMENT_VARIABLE
+  // Try to get the value of the environment variable specified by NAME.
+  // Returns a STATUS as described in the standard.
+  std::int32_t RTNAME(GetEnvVariable)(const Descriptor &name,
+      const Descriptor *value = nullptr, const Descriptor *length = nullptr,
+      bool trim_name = true, const Descriptor *errmsg = nullptr,
+      const char *sourceFile = nullptr, int line = 0);
+  }
 
 } // namespace Fortran::runtime
 

``````````

</details>


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


More information about the flang-commits mailing list