[clang] [clang] Deduplicate the logic that only warns once when stack is almost full (PR #112371)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 16 01:51:55 PDT 2024
================
@@ -1183,7 +1181,7 @@ class Sema final : public SemaBase {
std::optional<std::unique_ptr<DarwinSDKInfo>> CachedDarwinSDKInfo;
bool WarnedDarwinSDKInfoMissing = false;
- bool WarnedStackExhausted = false;
+ SingleWarningStackAwareExecutor StackAwareExecutor;
----------------
ilya-biryukov wrote:
Should we share the state between Sema and CodeGen?
It's not unusual for deeply nested ASTs to cause the limits to be hit in both and it would make sense to only diagnose once globally.
I am not sure which class would be a good fit to hold that state as CodeGen does not have a reference to Sema and vice versa, so maybe it needs too much plumbing and isn't worth it. But I wanted to throw this idea out and hear what people think.
https://github.com/llvm/llvm-project/pull/112371
More information about the cfe-commits
mailing list