15#include "llvm/Support/CrashRecoveryContext.h"
24#if __GNUC__ || __has_builtin(__builtin_frame_address)
25 return __builtin_frame_address(0);
26#elif defined(_MSC_VER)
27 return _AddressOfReturnAddress();
35 char *
volatile Ptr = &CharOnStack;
48 constexpr size_t SufficientStack = 256 << 10;
67 llvm::function_ref<
void()> Fn) {
68 llvm::CrashRecoveryContext CRC;
69 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
static void * getStackPointer()
Defines utilities for dealing with stack allocation and stack space.
void runWithSufficientStackSpaceSlow(llvm::function_ref< void()> Diag, llvm::function_ref< void()> Fn)
void noteBottomOfStack()
Call this once on each thread, as soon after starting the thread as feasible, to note the approximate...
bool isStackNearlyExhausted()
Determine whether the stack is nearly exhausted.
constexpr size_t DesiredStackSize
The amount of stack space that Clang would like to be provided with.
__DEVICE__ _Tp abs(const std::complex< _Tp > &__c)
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type,...