15#include "llvm/Support/CrashRecoveryContext.h"
16#include "llvm/Support/ProgramStack.h"
28 constexpr size_t SufficientStack = 256 << 10;
48 llvm::function_ref<
void()> Fn) {
49 llvm::CrashRecoveryContext CRC;
52 CRC.RunSafelyOnNewStack([&] {
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 uintptr_t BottomOfStack
Defines utilities for dealing with stack allocation and stack space.
void runWithSufficientStackSpaceSlow(llvm::function_ref< void()> Diag, llvm::function_ref< void()> Fn)
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.
void noteBottomOfStack(bool ForceSet=false)
Call this once on each thread, as soon after starting the thread as feasible, to note the approximate...
__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,...
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...