Author: Dave Lee Date: 2025-01-25T09:58:52-08:00 New Revision: aba0476f23fc2a851792e9d85c25ee34a5ea7ed0
URL: https://github.com/llvm/llvm-project/commit/aba0476f23fc2a851792e9d85c25ee34a5ea7ed0 DIFF: https://github.com/llvm/llvm-project/commit/aba0476f23fc2a851792e9d85c25ee34a5ea7ed0.diff LOG: [lldb] Delete lldbutil.PrintableRegex (NFC) Use of this class wasn't making use of the original regex string. Note that `re.Pattern` has a `pattern` property to access the original regex. Added: Modified: lldb/packages/Python/lldbsuite/test/lldbutil.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py Removed: ################################################################################ diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py index ef068cf7f9ed10..27e00400343709 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py @@ -1578,21 +1578,6 @@ def set_actions_for_signal( ) -class PrintableRegex(object): - def __init__(self, text): - self.regex = re.compile(text) - self.text = text - - def match(self, str): - return self.regex.match(str) - - def __str__(self): - return "%s" % (self.text) - - def __repr__(self): - return "re.compile(%s) -> %s" % (self.text, self.regex) - - def skip_if_callable(test, mycallable, reason): if callable(mycallable): if mycallable(test): diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py index 241226d50df80d..c6592ede03147c 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py @@ -2,6 +2,7 @@ Test lldb data formatter subsystem. """ +import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * @@ -30,9 +31,7 @@ def test(self): self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+") - ) + lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+")) # The stop reason of the thread should be breakpoint. self.expect( diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py index 93d5392830b508..b8a1dd3569d778 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py @@ -3,6 +3,7 @@ """ +import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * @@ -24,9 +25,7 @@ def test(self): self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+") - ) + lldbutil.skip_if_library_missing(self, self.target(), re.compile(r"libc\+\+")) # The stop reason of the thread should be breakpoint. self.expect( _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits