Author: Timm Baeder
Date: 2026-09-19T06:09:09+02:00
New Revision: d0358264a15b7279e4a1500a0dadbf43fab881ed

URL: 
https://github.com/llvm/llvm-project/commit/d0358264a15b7279e4a1500a0dadbf43fab881ed
DIFF: 
https://github.com/llvm/llvm-project/commit/d0358264a15b7279e4a1500a0dadbf43fab881ed.diff

LOG: [clang][bytecode] Flip a boolean flag meaning (#224649)

We only use this flag once, when passing it to
`setFoldFailureDiagnostic()` (where we invert it), so it doesn't make
sense to call it IsCCEDiag.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/State.cpp
    clang/lib/AST/ByteCode/State.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/State.cpp 
b/clang/lib/AST/ByteCode/State.cpp
index 3390164bbc680..1fc6ea8e6d6a1 100644
--- a/clang/lib/AST/ByteCode/State.cpp
+++ b/clang/lib/AST/ByteCode/State.cpp
@@ -36,14 +36,14 @@ bool State::emitRelaxedDiag(SourceLocation Loc, diag::kind 
DiagId) {
 
 OptionalDiagnostic State::FFDiag(SourceLocation Loc, diag::kind DiagId,
                                  unsigned ExtraNotes) {
-  return diag(Loc, DiagId, ExtraNotes, false);
+  return diag(Loc, DiagId, ExtraNotes, /*IsFFDiag=*/true);
 }
 
 OptionalDiagnostic State::FFDiag(const Expr *E, diag::kind DiagId,
                                  unsigned ExtraNotes) {
   EvalStatus.DiagEmitted = true;
   if (EvalStatus.Diag)
-    return diag(E->getExprLoc(), DiagId, ExtraNotes, false);
+    return diag(E->getExprLoc(), DiagId, ExtraNotes, /*IsFFDiag=*/true);
   setActiveDiagnostic(false);
   return OptionalDiagnostic();
 }
@@ -52,7 +52,7 @@ OptionalDiagnostic State::FFDiag(SourceInfo SI, diag::kind 
DiagId,
                                  unsigned ExtraNotes) {
   EvalStatus.DiagEmitted = true;
   if (EvalStatus.Diag)
-    return diag(SI.getLoc(), DiagId, ExtraNotes, false);
+    return diag(SI.getLoc(), DiagId, ExtraNotes, /*IsFFDiag=*/true);
   setActiveDiagnostic(false);
   return OptionalDiagnostic();
 }
@@ -70,7 +70,7 @@ OptionalDiagnostic State::CCEDiag(SourceLocation Loc, 
diag::kind DiagId,
     setActiveDiagnostic(false);
     return OptionalDiagnostic();
   }
-  return diag(Loc, DiagId, ExtraNotes, true);
+  return diag(Loc, DiagId, ExtraNotes, /*IsFFDiag=*/false);
 }
 
 OptionalDiagnostic State::CCEDiag(const Expr *E, diag::kind DiagId,
@@ -114,7 +114,7 @@ void State::addExtendedDiag(SourceLocation Loc, diag::kind 
DiagId) {
 }
 
 OptionalDiagnostic State::diag(SourceLocation Loc, diag::kind DiagId,
-                               unsigned ExtraNotes, bool IsCCEDiag) {
+                               unsigned ExtraNotes, bool IsFFDiag) {
   if (EvalStatus.Diag) {
     if (hasPriorDiagnostic()) {
       return OptionalDiagnostic();
@@ -128,7 +128,7 @@ OptionalDiagnostic State::diag(SourceLocation Loc, 
diag::kind DiagId,
       CallStackNotes = 0;
 
     setActiveDiagnostic(true);
-    setFoldFailureDiagnostic(!IsCCEDiag);
+    setFoldFailureDiagnostic(IsFFDiag);
     EvalStatus.Diag->clear();
     EvalStatus.Diag->reserve(1 + ExtraNotes + CallStackNotes);
     addDiag(Loc, DiagId);

diff  --git a/clang/lib/AST/ByteCode/State.h b/clang/lib/AST/ByteCode/State.h
index 07365f574fb73..4846e9032bb4b 100644
--- a/clang/lib/AST/ByteCode/State.h
+++ b/clang/lib/AST/ByteCode/State.h
@@ -207,7 +207,7 @@ class State {
   void addExtendedDiag(SourceLocation Loc, diag::kind DiagId);
 
   OptionalDiagnostic diag(SourceLocation Loc, diag::kind DiagId,
-                          unsigned ExtraNotes, bool IsCCEDiag);
+                          unsigned ExtraNotes, bool IsFFDiag);
 
   /// Should we continue evaluation after encountering undefined behavior?
   bool keepEvaluatingAfterUndefinedBehavior() const;


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to