================
@@ -67,12 +104,21 @@ class DebuggerExpectMatch:
     `actual_result` is None if either `actual` or 
`expect.get_variable_result(actual)` is None,
     Otherwise, if `expected` is a dict, then `actual_result` is a dict[str, 
DebuggerExpectMatch],
     Otherwise, `actual_result` is a str.
+    Uses the provided match_context, and updates a local copy of it; if this 
match is selected, then its local updated
+    match_context should be committed.
     """
 
-    def __init__(self, expect: Expect, expected, actual: Optional[ValueIR]):
+    def __init__(
+        self,
+        expect: Expect,
+        expected,
+        actual: Optional[ValueIR],
+        match_context: ExpectMatchContext,
+    ):
         self.expect = expect
         self.expected = expected
         self.actual = actual
+        self.match_context = copy.deepcopy(match_context)
----------------
SLTozer wrote:

I think it does represent a "context" in that sense, it is shared state across 
the whole trace, but only one is actually active at any one time. The local 
copy represents a revision based on this evaluation, when the current 
evaluation may not become the "canonical" evaluation - so in any given 
evaluation we can treat the copy as if it's _the_ context, and if we select 
that evaluation then we commit any changes made. I'll change the names and add 
a comment to make this more explicit, and see if that makes the naming 
convention suitable.

https://github.com/llvm/llvm-project/pull/202801
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to