[clang] [llvm] Revert "[llvm][clang] Allocate a new stack instead of spawning a new … (PR #135865)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 14:49:20 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 -- clang/include/clang/Basic/Stack.h clang/lib/Basic/Stack.cpp clang/lib/Frontend/CompilerInstance.cpp llvm/include/llvm/Support/CrashRecoveryContext.h llvm/include/llvm/Support/thread.h llvm/lib/Support/CrashRecoveryContext.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Basic/Stack.cpp b/clang/lib/Basic/Stack.cpp
index aa15d8e66..98dc2f0d2 100644
--- a/clang/lib/Basic/Stack.cpp
+++ b/clang/lib/Basic/Stack.cpp
@@ -15,7 +15,7 @@
#include "llvm/Support/CrashRecoveryContext.h"
#ifdef _MSC_VER
-#include <intrin.h> // for _AddressOfReturnAddress
+#include <intrin.h> // for _AddressOfReturnAddress
#endif
static LLVM_THREAD_LOCAL void *BottomOfStack = nullptr;
@@ -66,9 +66,11 @@ bool clang::isStackNearlyExhausted() {
void clang::runWithSufficientStackSpaceSlow(llvm::function_ref<void()> Diag,
llvm::function_ref<void()> Fn) {
llvm::CrashRecoveryContext CRC;
- CRC.RunSafelyOnThread([&] {
- noteBottomOfStack();
- Diag();
- Fn();
- }, DesiredStackSize);
+ CRC.RunSafelyOnThread(
+ [&] {
+ noteBottomOfStack();
+ Diag();
+ Fn();
+ },
+ DesiredStackSize);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/135865
More information about the cfe-commits
mailing list