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,c -- 
libcxxabi/src/cxa_personality.cpp libunwind/src/Unwind-wasm.c 
llvm/lib/CodeGen/WasmEHPrepare.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/libcxxabi/src/cxa_personality.cpp 
b/libcxxabi/src/cxa_personality.cpp
index 258e4d1f4..8f2cc04d4 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -1022,98 +1022,91 @@ static inline void 
get_landing_pad(__cxa_catch_temp_type &dest,
 
 #ifdef __WASM_EXCEPTIONS__
 _Unwind_Reason_Code __gxx_wasm_personality_v0
-#elif defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
+#  elif defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
 static _Unwind_Reason_Code __gxx_personality_imp
-#else
+#  else
 _LIBCXXABI_FUNC_VIS _Unwind_Reason_Code
-#ifdef __USING_SJLJ_EXCEPTIONS__
+#    ifdef __USING_SJLJ_EXCEPTIONS__
 __gxx_personality_sj0
-#elif defined(__MVS__)
+#    elif defined(__MVS__)
 __zos_cxx_personality_v2
-#else
+#    else
 __gxx_personality_v0
-#endif
-#endif
-                    (int version, _Unwind_Action actions, uint64_t 
exceptionClass,
-                     _Unwind_Exception* unwind_exception, _Unwind_Context* 
context)
-{
-    if (version != 1 || unwind_exception == 0 || context == 0)
-        return _URC_FATAL_PHASE1_ERROR;
+#    endif
+#  endif
+    (int version, _Unwind_Action actions, uint64_t exceptionClass, 
_Unwind_Exception* unwind_exception,
+     _Unwind_Context* context) {
+  if (version != 1 || unwind_exception == 0 || context == 0)
+    return _URC_FATAL_PHASE1_ERROR;
 
-    bool native_exception = (exceptionClass     & get_vendor_and_language) ==
-                            (kOurExceptionClass & get_vendor_and_language);
-    scan_results results;
-    // Process a catch handler for a native exception first.
-    if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME) &&
-        native_exception) {
-        // Reload the results from the phase 1 cache.
-        __cxa_exception* exception_header =
-            (__cxa_exception*)(unwind_exception + 1) - 1;
-        results.ttypeIndex = exception_header->handlerSwitchValue;
-        results.actionRecord = exception_header->actionRecord;
-        results.languageSpecificData = exception_header->languageSpecificData;
-        set_landing_pad(results, exception_header->catchTemp);
-        results.adjustedPtr = exception_header->adjustedPtr;
-
-        // Jump to the handler.
-        set_registers(unwind_exception, context, results);
-        // Cache base for calculating the address of ttype in
-        // __cxa_call_unexpected.
-        if (results.ttypeIndex < 0) {
-#if defined(_AIX)
-          exception_header->catchTemp = (void 
*)_Unwind_GetDataRelBase(context);
-#else
+  bool native_exception = (exceptionClass & get_vendor_and_language) == 
(kOurExceptionClass & get_vendor_and_language);
+  scan_results results;
+  // Process a catch handler for a native exception first.
+  if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME) && native_exception) {
+    // Reload the results from the phase 1 cache.
+    __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception + 
1) - 1;
+    results.ttypeIndex = exception_header->handlerSwitchValue;
+    results.actionRecord = exception_header->actionRecord;
+    results.languageSpecificData = exception_header->languageSpecificData;
+    set_landing_pad(results, exception_header->catchTemp);
+    results.adjustedPtr = exception_header->adjustedPtr;
+
+    // Jump to the handler.
+    set_registers(unwind_exception, context, results);
+    // Cache base for calculating the address of ttype in
+    // __cxa_call_unexpected.
+    if (results.ttypeIndex < 0) {
+#  if defined(_AIX)
+      exception_header->catchTemp = (void*)_Unwind_GetDataRelBase(context);
+#  else
           exception_header->catchTemp = 0;
-#endif
-        }
-        return _URC_INSTALL_CONTEXT;
+#  endif
     }
+    return _URC_INSTALL_CONTEXT;
+  }
 
-    // In other cases we need to scan LSDA.
-    scan_eh_tab(results, actions, native_exception, unwind_exception, context);
-    if (results.reason == _URC_CONTINUE_UNWIND ||
-        results.reason == _URC_FATAL_PHASE1_ERROR)
-        return results.reason;
+  // In other cases we need to scan LSDA.
+  scan_eh_tab(results, actions, native_exception, unwind_exception, context);
+  if (results.reason == _URC_CONTINUE_UNWIND || results.reason == 
_URC_FATAL_PHASE1_ERROR)
+    return results.reason;
 
-    if (actions & _UA_SEARCH_PHASE)
-    {
-        // Phase 1 search:  All we're looking for in phase 1 is a handler that
-        //   halts unwinding
-        assert(results.reason == _URC_HANDLER_FOUND);
-        if (native_exception) {
-            // For a native exception, cache the LSDA result.
-            __cxa_exception* exc = (__cxa_exception*)(unwind_exception + 1) - 
1;
-            exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
-            exc->actionRecord = results.actionRecord;
-            exc->languageSpecificData = results.languageSpecificData;
-            get_landing_pad(exc->catchTemp, results);
-            exc->adjustedPtr = results.adjustedPtr;
-#ifdef __WASM_EXCEPTIONS__
-            // Wasm only uses a single phase (_UA_SEARCH_PHASE), so save the
-            // results here.
-            set_registers(unwind_exception, context, results);
-#endif
-        }
-        return _URC_HANDLER_FOUND;
+  if (actions & _UA_SEARCH_PHASE) {
+    // Phase 1 search:  All we're looking for in phase 1 is a handler that
+    //   halts unwinding
+    assert(results.reason == _URC_HANDLER_FOUND);
+    if (native_exception) {
+      // For a native exception, cache the LSDA result.
+      __cxa_exception* exc = (__cxa_exception*)(unwind_exception + 1) - 1;
+      exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
+      exc->actionRecord = results.actionRecord;
+      exc->languageSpecificData = results.languageSpecificData;
+      get_landing_pad(exc->catchTemp, results);
+      exc->adjustedPtr = results.adjustedPtr;
+#  ifdef __WASM_EXCEPTIONS__
+      // Wasm only uses a single phase (_UA_SEARCH_PHASE), so save the
+      // results here.
+      set_registers(unwind_exception, context, results);
+#  endif
     }
+    return _URC_HANDLER_FOUND;
+  }
 
-    assert(actions & _UA_CLEANUP_PHASE);
-    assert(results.reason == _URC_HANDLER_FOUND);
-    set_registers(unwind_exception, context, results);
-    // Cache base for calculating the address of ttype in 
__cxa_call_unexpected.
-    if (results.ttypeIndex < 0) {
-      __cxa_exception* exception_header =
-            (__cxa_exception*)(unwind_exception + 1) - 1;
-#if defined(_AIX)
-      exception_header->catchTemp = (void *)_Unwind_GetDataRelBase(context);
-#else
+  assert(actions & _UA_CLEANUP_PHASE);
+  assert(results.reason == _URC_HANDLER_FOUND);
+  set_registers(unwind_exception, context, results);
+  // Cache base for calculating the address of ttype in __cxa_call_unexpected.
+  if (results.ttypeIndex < 0) {
+    __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception + 
1) - 1;
+#  if defined(_AIX)
+    exception_header->catchTemp = (void*)_Unwind_GetDataRelBase(context);
+#  else
       exception_header->catchTemp = 0;
-#endif
-    }
-    return _URC_INSTALL_CONTEXT;
+#  endif
+  }
+  return _URC_INSTALL_CONTEXT;
 }
 
-#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
+#  if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
 extern "C" _LIBCXXABI_FUNC_VIS EXCEPTION_DISPOSITION
 __gxx_personality_seh0(PEXCEPTION_RECORD ms_exc, void *this_frame,
                        PCONTEXT ms_orig_context, PDISPATCHER_CONTEXT ms_disp)

``````````

</details>


https://github.com/llvm/llvm-project/pull/175202
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to