//===--- Stack.cpp - Utilities for dealing with stack space ---------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// Defines utilities for dealing with stack allocation and stack space. /// //===----------------------------------------------------------------------===// #include "clang/Basic/Stack.h" #include "llvm/Support/CrashRecoveryContext.h" #ifdef _MSC_VER #include <intrin.h> // for _AddressOfReturnAddress #endif static LLVM_THREAD_LOCAL void *BottomOfStack = …; static void *getStackPointer() { … } void clang::noteBottomOfStack() { … } bool clang::isStackNearlyExhausted() { … } void clang::runWithSufficientStackSpaceSlow(llvm::function_ref<void()> Diag, llvm::function_ref<void()> Fn) { … }