[llvm-branch-commits] [llvm] [Dexter] Enable after_hit_count for state nodes (PR #203846)

Orlando Cazalet-Hyams via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jun 30 04:15:45 PDT 2026


================
@@ -64,33 +71,44 @@ def is_subpath(subpath: str, superpath: str) -> bool:
     return normalized_superpath.endswith(normalized_subpath)
 
 
+class WhereFrameMatchResult(IntEnum):
+    FALSE = 0
+    TRUE = 1
+    EARLY = 2
+
+
 def _match_where_to_frame(
     where: Where,
     frame: FrameIR,
     labels: FileLabels,
     context: StateMatchContext,
-) -> bool:
+) -> WhereFrameMatchResult:
     """A very simple matcher, returns True iff `where` matches `frame`."""
     if where.file is not None and not is_subpath(where.file, frame.loc.path):
-        return False
+        return WhereFrameMatchResult.FALSE
     if where.function is not None:
         fn = frame.function
         if "(" in fn:
             fn = fn.split("(")[0]
         if where.function != fn:
-            return False
+            return WhereFrameMatchResult.FALSE
     if where.lines is not None:
         if frame.loc.lineno not in where.get_lines(labels):
-            return False
+            return WhereFrameMatchResult.FALSE
     if where.for_hit_count is not None:
+        pre_hit_count = where.after_hit_count or 0
----------------
OCHyams wrote:

pre_hit_count  -> after_hit_count for consistency? or perhaps better to omit the variable and replace the single use with `(where.after_hit_count or 0)`?

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


More information about the llvm-branch-commits mailing list