clang 20.0.0git
Public Member Functions | List of all members
clang::StackExhaustionHandler Class Reference

#include "clang/Basic/StackExhaustionHandler.h"

Public Member Functions

 StackExhaustionHandler (DiagnosticsEngine &diags)
 
void runWithSufficientStackSpace (SourceLocation Loc, llvm::function_ref< void()> Fn)
 Run some code with "sufficient" stack space.
 
void warnOnStackNearlyExhausted (SourceLocation Loc)
 Check to see if we're low on stack space and produce a warning if we're low on stack space (Currently, at least 256Kis guaranteed).
 

Detailed Description

Definition at line 21 of file StackExhaustionHandler.h.

Constructor & Destructor Documentation

◆ StackExhaustionHandler()

clang::StackExhaustionHandler::StackExhaustionHandler ( DiagnosticsEngine diags)
inline

Definition at line 23 of file StackExhaustionHandler.h.

Member Function Documentation

◆ runWithSufficientStackSpace()

void clang::StackExhaustionHandler::runWithSufficientStackSpace ( SourceLocation  Loc,
llvm::function_ref< void()>  Fn 
)

Run some code with "sufficient" stack space.

(Currently, at least 256K is guaranteed). Produces a warning if we're low on stack space and allocates more in that case. Use this in code that may recurse deeply to avoid stack overflow.

Definition at line 18 of file StackExhaustionHandler.cpp.

References Loc, and clang::runWithSufficientStackSpace().

Referenced by clang::Sema::runWithSufficientStackSpace(), clang::ASTReader::runWithSufficientStackSpace(), and clang::CodeGen::CodeGenModule::runWithSufficientStackSpace().

◆ warnOnStackNearlyExhausted()

void clang::StackExhaustionHandler::warnOnStackNearlyExhausted ( SourceLocation  Loc)

Check to see if we're low on stack space and produce a warning if we're low on stack space (Currently, at least 256Kis guaranteed).

Definition at line 23 of file StackExhaustionHandler.cpp.

References clang::isStackNearlyExhausted(), and Loc.

Referenced by clang::Sema::pushCodeSynthesisContext().


The documentation for this class was generated from the following files: