15 #include "llvm/ADT/Optional.h" 16 #include "llvm/Support/CrashRecoveryContext.h" 25 #if __GNUC__ || __has_builtin(__builtin_frame_address) 26 return __builtin_frame_address(0);
27 #elif defined(_MSC_VER) 28 return _AddressOfReturnAddress();
36 char *
volatile Ptr = &CharOnStack;
49 constexpr
size_t SufficientStack = 256 << 10;
68 llvm::function_ref<
void()> Fn) {
69 llvm::CrashRecoveryContext CRC;
70 CRC.RunSafelyOnThread([&] {
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
static LLVM_THREAD_LOCAL void * BottomOfStack
__DEVICE__ long long abs(long long __n)
bool isStackNearlyExhausted()
Determine whether the stack is nearly exhausted.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
static void * getStackPointer()
void noteBottomOfStack()
Call this once on each thread, as soon after starting the thread as feasible, to note the approximate...
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type...
constexpr size_t DesiredStackSize
The amount of stack space that Clang would like to be provided with.
void runWithSufficientStackSpaceSlow(llvm::function_ref< void()> Diag, llvm::function_ref< void()> Fn)
Defines utilities for dealing with stack allocation and stack space.