[clang] [clang][ExprConst] Move shared `EvalInfo` state into `interp::State` (PR #177738)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 31 06:25:15 PST 2026


================
@@ -170,14 +188,50 @@ class State {
   bool CheckingForUndefinedBehavior = false;
 
   EvaluationMode EvalMode;
+  ASTContext &Ctx;
+  Expr::EvalStatus &EvalStatus;
 
 private:
+  /// HasActiveDiagnostic - Was the previous diagnostic stored? If so, further
+  /// notes attached to it will also be stored, otherwise they will not be.
+  bool HasActiveDiagnostic = false;
+
+  /// Have we emitted a diagnostic explaining why we couldn't constant
+  /// fold (not just why it's not strictly a constant expression)?
+  bool HasFoldFailureDiagnostic = false;
+
   void addCallStack(unsigned Limit);
 
   PartialDiagnostic &addDiag(SourceLocation Loc, diag::kind DiagId);
 
   OptionalDiagnostic diag(SourceLocation Loc, diag::kind DiagId,
                           unsigned ExtraNotes, bool IsCCEDiag);
+
+  /// Should we continue evaluation after encountering undefined behavior?
+  bool keepEvaluatingAfterUndefinedBehavior() const {
----------------
Sirraide wrote:

I feel like this one should also go in the cpp file

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


More information about the cfe-commits mailing list