[clang] [clang] Deduplicate the logic that only warns once when stack is almost full (PR #112552)

Boaz Brickner via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 01:07:58 PDT 2024


================
@@ -0,0 +1,45 @@
+//===--- SingleWarningStackAwareExecutor.h - A utility for warning once when
+// close to out of stack space -------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Defines a utilitiy for warning once when close to out of stack space.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_BASIC_SINGLE_WARNING_STACK_AWARE_EXECUTOR_H
+#define LLVM_CLANG_BASIC_SINGLE_WARNING_STACK_AWARE_EXECUTOR_H
+
+#include "clang/Basic/Diagnostic.h"
+
+namespace clang {
+class SingleWarningStackAwareExecutor {
----------------
bricknerb wrote:

Done.

https://github.com/llvm/llvm-project/pull/112552


More information about the cfe-commits mailing list