diff options
author | Boaz Brickner <brickner@google.com> | 2024-10-18 10:11:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-18 10:11:14 +0200 |
commit | 09cc75e2ccc3616e1cb3b17f2fb99cb3bb323b12 (patch) | |
tree | 3fb09cfb81653281ca4a9647f3a2d71106d31ce4 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 508fd966fb00428ccd1dd7ddeb636fb7393029ec (diff) | |
download | llvm-09cc75e2ccc3616e1cb3b17f2fb99cb3bb323b12.zip llvm-09cc75e2ccc3616e1cb3b17f2fb99cb3bb323b12.tar.gz llvm-09cc75e2ccc3616e1cb3b17f2fb99cb3bb323b12.tar.bz2 |
[clang] Deduplicate the logic that only warns once when stack is almost full (#112552)
Zero diff in behavior.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index fa82a81..1b77490 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -26,6 +26,7 @@ #include "clang/Basic/LangOptions.h" #include "clang/Basic/NoSanitizeList.h" #include "clang/Basic/ProfileList.h" +#include "clang/Basic/StackExhaustionHandler.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/XRayLists.h" #include "clang/Lex/PreprocessorOptions.h" @@ -336,7 +337,7 @@ private: std::unique_ptr<llvm::IndexedInstrProfReader> PGOReader; InstrProfStats PGOStats; std::unique_ptr<llvm::SanitizerStatReport> SanStats; - bool WarnedStackExhausted = false; + StackExhaustionHandler StackHandler; // A set of references that have only been seen via a weakref so far. This is // used to remove the weak of the reference if we ever see a direct reference @@ -1298,9 +1299,6 @@ public: /// Print out an error that codegen doesn't support the specified decl yet. void ErrorUnsupported(const Decl *D, const char *Type); - /// Warn that the stack is nearly exhausted. - void warnStackExhausted(SourceLocation Loc); - /// 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 |