================
@@ -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)
----------------
jmorse wrote:

I feel there's impedence mismatch between calling something "context" but then 
generating deep-copies whenever they're evaluated: from the name I would expect 
this to be shared state held across the whole trace. I feel the downside is 
there can be multiple active contexts at one time in the tree of scripty 
things; is there really a need for this, or can we consolidate it?

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