Go to the documentation of this file.
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([&] {
bool isStackNearlyExhausted()
Determine whether the stack is nearly exhausted.
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.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
void noteBottomOfStack()
Call this once on each thread, as soon after starting the thread as feasible, to note the approximate...
static void * getStackPointer()
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type,...
void runWithSufficientStackSpaceSlow(llvm::function_ref< void()> Diag, llvm::function_ref< void()> Fn)
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)
static LLVM_THREAD_LOCAL void * BottomOfStack