[flang] [llvm] [flang-rt] Runtime implementation of extended intrinsic function SECNDS() (PR #152021)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 13:19:53 PDT 2025


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 HEAD~1 HEAD --extensions cpp,h -- flang-rt/lib/runtime/extensions.cpp flang/include/flang/Runtime/command.h flang/include/flang/Runtime/extensions.h
``````````

</details>

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

``````````diff
diff --git a/flang-rt/lib/runtime/extensions.cpp b/flang-rt/lib/runtime/extensions.cpp
index ca8d5ac9c..b118046dc 100644
--- a/flang-rt/lib/runtime/extensions.cpp
+++ b/flang-rt/lib/runtime/extensions.cpp
@@ -334,8 +334,8 @@ float FORTRAN_PROCEDURE_NAME(secnds)(float *refTime) {
   // will perform initialization and the other threads wait their turn.
   for (;;) {
     // "Acquire" will show writes from other threads.
-    std::time_t currentStartingPoint{startingPoint.load(
-        std::memory_order_acquire)};
+    std::time_t currentStartingPoint{
+        startingPoint.load(std::memory_order_acquire)};
     if (currentStartingPoint > TIME_INITIALIZING) {
       // Initialization was already done, use the starting point value
       localStartingPoint = currentStartingPoint;
@@ -348,8 +348,8 @@ float FORTRAN_PROCEDURE_NAME(secnds)(float *refTime) {
       // Try to start initialization
       std::time_t expected{TIME_UNINITIALIZED};
       if (startingPoint.compare_exchange_strong(expected, TIME_INITIALIZING,
-          std::memory_order_acq_rel,    // "Acquire and release" on success
-          std::memory_order_acquire)) { // "Acquire" on failure
+              std::memory_order_acq_rel, // "Acquire and release" on success
+              std::memory_order_acquire)) { // "Acquire" on failure
         // This thread is doing initialization of startingPoint
         struct tm timeInfo;
 #ifdef _WIN32

``````````

</details>


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


More information about the llvm-commits mailing list