[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to True/False (PR #94039)

2024-06-09 Thread Eisuke Kawashima via lldb-commits


@@ -39,7 +39,7 @@ def check_simulator_ostype(self, sdk, platform_name, 
arch=platform.machine()):
 for device in devices:
 if "availability" in device and device["availability"] != 
"(available)":
 continue
-if "isAvailable" in device and device["isAvailable"] != True:
+if "isAvailable" in device and device["isAvailable"] is not 
True:

e-kwsm wrote:

fixed

https://github.com/llvm/llvm-project/pull/94039
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to True/False (PR #94039)

2024-06-09 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm updated 
https://github.com/llvm/llvm-project/pull/94039

>From c586cd2b0d38195dc7fc88f6290482bba72b8d4f Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sun, 12 May 2024 00:06:53 +0900
Subject: [PATCH] fix(lldb/**.py): fix comparison to True/False

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
---
 lldb/examples/python/crashlog.py| 2 +-
 lldb/examples/python/disasm-stress-test.py  | 4 ++--
 lldb/examples/summaries/cocoa/CFString.py   | 6 +++---
 lldb/examples/summaries/pysummary.py| 2 +-
 lldb/examples/synthetic/bitfield/example.py | 2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 +-
 lldb/test/API/commands/command/script/welcome.py| 2 +-
 .../commands/expression/call-throws/TestCallThatThrows.py   | 6 +++---
 .../disassemble/aarch64-adrp-add/TestAArch64AdrpAdd.py  | 2 +-
 .../gdb_remote_client/TestNoWatchpointSupportInfo.py| 2 +-
 lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py | 2 +-
 lldb/test/API/tools/lldb-server/TestLldbGdbServer.py| 2 +-
 12 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 1c0d717ce455c..368437ed63e46 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -166,7 +166,7 @@ def dump_symbolicated(self, crash_log, options):
 this_thread_crashed = self.app_specific_backtrace
 if not this_thread_crashed:
 this_thread_crashed = self.did_crash()
-if options.crashed_only and this_thread_crashed == False:
+if options.crashed_only and not this_thread_crashed:
 return
 
 print("%s" % self)
diff --git a/lldb/examples/python/disasm-stress-test.py 
b/lldb/examples/python/disasm-stress-test.py
index 2d3314ee8e8ff..62b2b90a2860a 100755
--- a/lldb/examples/python/disasm-stress-test.py
+++ b/lldb/examples/python/disasm-stress-test.py
@@ -95,13 +95,13 @@ def GetLLDBFrameworkPath():
 
 debugger = lldb.SBDebugger.Create()
 
-if debugger.IsValid() == False:
+if not debugger.IsValid():
 print("Couldn't create an SBDebugger")
 sys.exit(-1)
 
 target = debugger.CreateTargetWithFileAndArch(None, arg_ns.arch)
 
-if target.IsValid() == False:
+if not target.IsValid():
 print("Couldn't create an SBTarget for architecture " + arg_ns.arch)
 sys.exit(-1)
 
diff --git a/lldb/examples/summaries/cocoa/CFString.py 
b/lldb/examples/summaries/cocoa/CFString.py
index 13c294ca34122..74bd927e9db21 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -253,9 +253,9 @@ def get_child_at_index(self, index):
 elif (
 self.inline
 and self.explicit
-and self.unicode == False
-and self.special == False
-and self.mutable == False
+and not self.unicode
+and not self.special
+and not self.mutable
 ):
 return self.handle_inline_explicit()
 elif self.unicode:
diff --git a/lldb/examples/summaries/pysummary.py 
b/lldb/examples/summaries/pysummary.py
index e63a0bff56a13..2a05c1cbf8f28 100644
--- a/lldb/examples/summaries/pysummary.py
+++ b/lldb/examples/summaries/pysummary.py
@@ -2,7 +2,7 @@
 
 
 def pyobj_summary(value, unused):
-if value is None or value.IsValid() == False or 
value.GetValueAsUnsigned(0) == 0:
+if value is None or not value.IsValid() or value.GetValueAsUnsigned(0) == 
0:
 return ""
 refcnt = value.GetChildMemberWithName("ob_refcnt")
 expr = "(char*)PyString_AsString( (PyObject*)PyObject_Str( 
(PyObject*)0x%x) )" % (
diff --git a/lldb/examples/synthetic/bitfield/example.py 
b/lldb/examples/synthetic/bitfield/example.py
index 2f58123268aa1..45416477bfef2 100644
--- a/lldb/examples/synthetic/bitfield/example.py
+++ b/lldb/examples/synthetic/bitfield/example.py
@@ -51,7 +51,7 @@ def get_child_at_index(self, index):
 return None
 if index > self.num_children():
 return None
-if self.valobj.IsValid() == False:
+if not self.valobj.IsValid():
 return None
 if index == 0:
 return self.valobj.GetChildMemberWithName("value")
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 1ad8ab6e6e462..1854f6c2c2e7b 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2446,7 +2446,7 @@ def found_str(matched):
 log_lines.append(pattern_line)
 
 # Convert to bool because match 

[Lldb-commits] [clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

e-kwsm wrote:

Broken into

- #94038
- #94039
- #94040
- #94041
- #94042



https://github.com/llvm/llvm-project/pull/91858
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm closed https://github.com/llvm/llvm-project/pull/91858
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] fix(lldb/**.py): fix comparison to True/False (PR #94039)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm created 
https://github.com/llvm/llvm-project/pull/94039

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or is not, 
> never the equality operators.

>From 7b8df11972495daf31e5ab73ae90e2dc7bd51263 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sun, 12 May 2024 00:06:53 +0900
Subject: [PATCH] fix(lldb/**.py): fix comparison to True/False

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
---
 lldb/examples/python/crashlog.py| 2 +-
 lldb/examples/python/disasm-stress-test.py  | 4 ++--
 lldb/examples/summaries/cocoa/CFString.py   | 6 +++---
 lldb/examples/summaries/pysummary.py| 2 +-
 lldb/examples/synthetic/bitfield/example.py | 2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 +-
 lldb/test/API/commands/command/script/welcome.py| 2 +-
 .../commands/expression/call-throws/TestCallThatThrows.py   | 6 +++---
 .../disassemble/aarch64-adrp-add/TestAArch64AdrpAdd.py  | 2 +-
 .../gdb_remote_client/TestNoWatchpointSupportInfo.py| 2 +-
 lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py | 2 +-
 lldb/test/API/tools/lldb-server/TestLldbGdbServer.py| 2 +-
 12 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 641b2e64d53b1..ead9955cd13b7 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -166,7 +166,7 @@ def dump_symbolicated(self, crash_log, options):
 this_thread_crashed = self.app_specific_backtrace
 if not this_thread_crashed:
 this_thread_crashed = self.did_crash()
-if options.crashed_only and this_thread_crashed == False:
+if options.crashed_only and not this_thread_crashed:
 return
 
 print("%s" % self)
diff --git a/lldb/examples/python/disasm-stress-test.py 
b/lldb/examples/python/disasm-stress-test.py
index 2d3314ee8e8ff..62b2b90a2860a 100755
--- a/lldb/examples/python/disasm-stress-test.py
+++ b/lldb/examples/python/disasm-stress-test.py
@@ -95,13 +95,13 @@ def GetLLDBFrameworkPath():
 
 debugger = lldb.SBDebugger.Create()
 
-if debugger.IsValid() == False:
+if not debugger.IsValid():
 print("Couldn't create an SBDebugger")
 sys.exit(-1)
 
 target = debugger.CreateTargetWithFileAndArch(None, arg_ns.arch)
 
-if target.IsValid() == False:
+if not target.IsValid():
 print("Couldn't create an SBTarget for architecture " + arg_ns.arch)
 sys.exit(-1)
 
diff --git a/lldb/examples/summaries/cocoa/CFString.py 
b/lldb/examples/summaries/cocoa/CFString.py
index 13c294ca34122..74bd927e9db21 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -253,9 +253,9 @@ def get_child_at_index(self, index):
 elif (
 self.inline
 and self.explicit
-and self.unicode == False
-and self.special == False
-and self.mutable == False
+and not self.unicode
+and not self.special
+and not self.mutable
 ):
 return self.handle_inline_explicit()
 elif self.unicode:
diff --git a/lldb/examples/summaries/pysummary.py 
b/lldb/examples/summaries/pysummary.py
index e63a0bff56a13..2a05c1cbf8f28 100644
--- a/lldb/examples/summaries/pysummary.py
+++ b/lldb/examples/summaries/pysummary.py
@@ -2,7 +2,7 @@
 
 
 def pyobj_summary(value, unused):
-if value is None or value.IsValid() == False or 
value.GetValueAsUnsigned(0) == 0:
+if value is None or not value.IsValid() or value.GetValueAsUnsigned(0) == 
0:
 return ""
 refcnt = value.GetChildMemberWithName("ob_refcnt")
 expr = "(char*)PyString_AsString( (PyObject*)PyObject_Str( 
(PyObject*)0x%x) )" % (
diff --git a/lldb/examples/synthetic/bitfield/example.py 
b/lldb/examples/synthetic/bitfield/example.py
index 2f58123268aa1..45416477bfef2 100644
--- a/lldb/examples/synthetic/bitfield/example.py
+++ b/lldb/examples/synthetic/bitfield/example.py
@@ -51,7 +51,7 @@ def get_child_at_index(self, index):
 return None
 if index > self.num_children():
 return None
-if self.valobj.IsValid() == False:
+if not self.valobj.IsValid():
 return None
 if index == 0:
 return self.valobj.GetChildMemberWithName("value")
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 1ad8ab6e6e462..1854f6c2c2e7b 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ 

[Lldb-commits] [clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm updated 
https://github.com/llvm/llvm-project/pull/91858

>From cdc6e7c4ee2238e82fb9bf1754962d0aff10422b Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sun, 12 May 2024 00:06:53 +0900
Subject: [PATCH 1/2] fix(python): fix comparison to True/False

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
---
 clang/tools/scan-build/bin/set-xcode-analyzer   | 2 +-
 clang/utils/check_cfc/check_cfc.py  | 4 ++--
 lldb/examples/python/crashlog.py| 2 +-
 lldb/examples/python/disasm-stress-test.py  | 4 ++--
 lldb/examples/summaries/cocoa/CFString.py   | 6 +++---
 lldb/examples/summaries/pysummary.py| 2 +-
 lldb/examples/synthetic/bitfield/example.py | 2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 +-
 lldb/test/API/commands/command/script/welcome.py| 2 +-
 .../commands/expression/call-throws/TestCallThatThrows.py   | 6 +++---
 .../disassemble/aarch64-adrp-add/TestAArch64AdrpAdd.py  | 2 +-
 .../gdb_remote_client/TestNoWatchpointSupportInfo.py| 2 +-
 lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py | 2 +-
 lldb/test/API/tools/lldb-server/TestLldbGdbServer.py| 2 +-
 llvm/utils/indirect_calls.py| 2 +-
 openmp/libompd/gdb-plugin/ompd/ompd.py  | 2 +-
 openmp/tools/archer/tests/lit.cfg   | 2 +-
 .../External/isl/imath/tests/gmp-compat-test/genpytest.py   | 2 +-
 18 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/clang/tools/scan-build/bin/set-xcode-analyzer 
b/clang/tools/scan-build/bin/set-xcode-analyzer
index f8c3f775ef7de..8d797bee4ae3b 100755
--- a/clang/tools/scan-build/bin/set-xcode-analyzer
+++ b/clang/tools/scan-build/bin/set-xcode-analyzer
@@ -107,7 +107,7 @@ def main():
 foundSpec = True
 ModifySpec(x, isBuiltinAnalyzer, path)
 
-  if foundSpec == False:
+  if foundSpec is False:
   print "(-) No compiler configuration file was found.  Xcode's analyzer 
has not been updated."
 
 if __name__ == '__main__':
diff --git a/clang/utils/check_cfc/check_cfc.py 
b/clang/utils/check_cfc/check_cfc.py
index 27d732d91030c..d4ddcb5bbb6a3 100755
--- a/clang/utils/check_cfc/check_cfc.py
+++ b/clang/utils/check_cfc/check_cfc.py
@@ -156,7 +156,7 @@ def get_output_file(args):
 elif arg.startswith("-o"):
 # Specified conjoined with -o
 return arg[2:]
-assert grabnext == False
+assert grabnext is False
 
 return None
 
@@ -182,7 +182,7 @@ def replace_output_file(args, new_name):
 if replaceidx is None:
 raise Exception
 replacement = new_name
-if attached == True:
+if attached is True:
 replacement = "-o" + new_name
 args[replaceidx] = replacement
 return args
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 641b2e64d53b1..62bd73643a46e 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -166,7 +166,7 @@ def dump_symbolicated(self, crash_log, options):
 this_thread_crashed = self.app_specific_backtrace
 if not this_thread_crashed:
 this_thread_crashed = self.did_crash()
-if options.crashed_only and this_thread_crashed == False:
+if options.crashed_only and this_thread_crashed is False:
 return
 
 print("%s" % self)
diff --git a/lldb/examples/python/disasm-stress-test.py 
b/lldb/examples/python/disasm-stress-test.py
index 2d3314ee8e8ff..8487b24fdcba7 100755
--- a/lldb/examples/python/disasm-stress-test.py
+++ b/lldb/examples/python/disasm-stress-test.py
@@ -95,13 +95,13 @@ def GetLLDBFrameworkPath():
 
 debugger = lldb.SBDebugger.Create()
 
-if debugger.IsValid() == False:
+if debugger.IsValid() is False:
 print("Couldn't create an SBDebugger")
 sys.exit(-1)
 
 target = debugger.CreateTargetWithFileAndArch(None, arg_ns.arch)
 
-if target.IsValid() == False:
+if target.IsValid() is False:
 print("Couldn't create an SBTarget for architecture " + arg_ns.arch)
 sys.exit(-1)
 
diff --git a/lldb/examples/summaries/cocoa/CFString.py 
b/lldb/examples/summaries/cocoa/CFString.py
index 13c294ca34122..fdea2c48870cb 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -253,9 +253,9 @@ def get_child_at_index(self, index):
 elif (
 self.inline
 and self.explicit
-and self.unicode == False
-and self.special == False
-and self.mutable == False
+and self.unicode is False
+and self.special is False
+and self.mutable is False
  

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] fix(python): fix invalid escape sequences (PR #91856)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

e-kwsm wrote:

broken into

- #94028
- #94029
- #94030
- #94031
- #94032
- #94033
- #94034
- #94035
- #94036
- #94037


https://github.com/llvm/llvm-project/pull/91856
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] fix(python): fix invalid escape sequences (PR #91856)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm closed https://github.com/llvm/llvm-project/pull/91856
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] fix(lldb/**.py): fix invalid escape sequences (PR #94034)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm created 
https://github.com/llvm/llvm-project/pull/94034

None

>From 5c7ba6c7d95cced5d8acc609a40a6b8307bc7fed Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sat, 11 May 2024 02:39:21 +0900
Subject: [PATCH] fix(lldb/**.py): fix invalid escape sequences

---
 lldb/examples/python/crashlog.py  |   8 +-
 lldb/examples/python/delta.py |   2 +-
 lldb/examples/python/gdbremote.py |   4 +-
 lldb/examples/python/jump.py  |   6 +-
 lldb/examples/python/performance.py   |   2 +-
 lldb/examples/python/symbolication.py |   6 +-
 .../Python/lldbsuite/test/lldbpexpect.py  |   2 +-
 .../test/test_runner/process_control.py   |   2 +-
 .../command/backticks/TestBackticksInAlias.py |   4 +-
 .../TestMemoryAllocSettings.py|   2 +-
 .../API/commands/expression/test/TestExprs.py |   2 +-
 .../TestGuiExpandThreadsTree.py   |   2 +-
 lldb/test/API/commands/help/TestHelp.py   |   6 +-
 .../TestLaunchWithShellExpand.py  |   2 +-
 .../register/TestRegistersUnavailable.py  |   4 +-
 .../API/commands/settings/TestSettings.py |  12 +-
 .../target/basic/TestTargetCommand.py |   2 +-
 .../dwo/TestDumpDwo.py|  16 +-
 .../oso/TestDumpOso.py|  16 +-
 .../API/commands/trace/TestTraceDumpInfo.py   |   2 +-
 .../API/commands/trace/TestTraceEvents.py |   4 +-
 .../API/commands/trace/TestTraceStartStop.py  |  12 +-
 lldb/test/API/commands/trace/TestTraceTSC.py  |  10 +-
 .../driver/quit_speed/TestQuitWithProcess.py  |   2 +-
 .../TestBreakpointByLineAndColumn.py  |   2 +-
 .../TestBreakpointLocations.py|   2 +-
 .../TestDataFormatterAdv.py   |   6 +-
 .../TestDataFormatterCpp.py   |   6 +-
 .../TestDataFormatterObjCNSContainer.py   |  16 +-
 .../TestDataFormatterSkipSummary.py   |   2 +-
 .../TestDataFormatterGenericUnordered.py  |  22 +--
 .../libcxx/atomic/TestLibCxxAtomic.py |   2 +-
 .../initializerlist/TestInitializerList.py|   2 +-
 .../TestTypeSummaryListArg.py |   4 +-
 .../memory-region/TestMemoryRegion.py |   2 +-
 .../target_var/TestTargetVar.py   |   2 +-
 .../completion/TestIOHandlerCompletion.py |   2 +-
 .../c/function_types/TestFunctionTypes.py |   2 +-
 .../TestRegisterVariables.py  |   2 +-
 .../API/lang/c/set_values/TestSetValues.py|   4 +-
 lldb/test/API/lang/c/strings/TestCStrings.py  |   2 +-
 .../API/lang/c/tls_globals/TestTlsGlobals.py  |   8 +-
 .../API/lang/cpp/char1632_t/TestChar1632T.py  |   8 +-
 .../cpp/class_static/TestStaticVariables.py   |   4 +-
 .../lang/cpp/class_types/TestClassTypes.py|   2 +-
 .../cpp/dynamic-value/TestDynamicValue.py |   2 +-
 .../API/lang/cpp/namespace/TestNamespace.py   |   4 +-
 .../lang/cpp/signed_types/TestSignedTypes.py  |   4 +-
 .../cpp/unsigned_types/TestUnsignedTypes.py   |   2 +-
 .../test/API/lang/mixed/TestMixedLanguages.py |   4 +-
 .../lang/objc/foundation/TestObjCMethods.py   |   2 +-
 .../objc/foundation/TestObjCMethodsNSArray.py |  10 +-
 .../objc/foundation/TestObjCMethodsNSError.py |   2 +-
 .../objc/foundation/TestObjCMethodsString.py  |  10 +-
 .../TestObjCDynamicValue.py   |   2 +-
 .../TestObjCBuiltinTypes.py   |   4 +-
 .../TestAArch64LinuxMTEMemoryTagCoreFile.py   |  44 ++---
 .../TestAArch64LinuxMTEMemoryTagAccess.py | 160 +-
 .../TestAArch64LinuxMTEMemoryTagFaults.py |   6 +-
 .../TestAArch64LinuxTaggedMemoryRegion.py |   4 +-
 .../macosx/add-dsym/TestAddDsymDownload.py|   2 +-
 .../TestFirmwareCorefiles.py  |   2 +-
 .../kern-ver-str/TestKernVerStrLCNOTE.py  |   2 +-
 .../TestMultipleBinaryCorefile.py |   2 +-
 .../macosx/simulator/TestSimulatorPlatform.py |   2 +-
 .../skinny-corefile/TestSkinnyCorefile.py |   2 +-
 .../TestTargetArchFromModule.py   |   2 +-
 .../API/source-manager/TestSourceManager.py   |   2 +-
 .../lldb-server/TestGdbRemoteModuleInfo.py|   6 +-
 .../API/tools/lldb-server/TestPtyServer.py|   2 +-
 .../TestGdbRemoteTargetXmlPacket.py   |   2 +-
 lldb/test/API/types/AbstractBase.py   |   6 +-
 lldb/utils/lui/sourcewin.py   |   2 +-
 73 files changed, 263 insertions(+), 263 deletions(-)

diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 641b2e64d53b1..13e5d77ec6fe2 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -294,7 +294,7 @@ class DarwinImage(symbolication.Image):
 except:
 dsymForUUIDBinary = ""
 
-dwarfdump_uuid_regex = re.compile("UUID: ([-0-9a-fA-F]+) \(([^\(]+)\) 
.*")
+dwarfdump_uuid_regex = re.compile(r"UUID: ([-0-9a-fA-F]+) \(([^\(]+)\) 
.*")
 
 def __init__(
 self, 

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm closed https://github.com/llvm/llvm-project/pull/91857
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

e-kwsm wrote:

broken into

- #94012
- #94013
- #94014
- #94015
- #94016
- #94017
- #94018
- #94019
- #94020
- #94021
- #94022


https://github.com/llvm/llvm-project/pull/91857
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm created 
https://github.com/llvm/llvm-project/pull/94017

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or is not, 
> never the equality operators.

>From 3142b6184498b133866dee82d25d0eb596507740 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sat, 11 May 2024 23:57:11 +0900
Subject: [PATCH] fix(lldb/**.py): fix comparison to None

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
---
 lldb/bindings/interface/SBBreakpointDocstrings.i  | 2 +-
 lldb/bindings/interface/SBDataExtensions.i| 8 
 lldb/docs/use/python.rst  | 4 ++--
 lldb/examples/python/armv7_cortex_m_target_defintion.py   | 2 +-
 lldb/packages/Python/lldbsuite/test/dotest.py | 2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py   | 6 +++---
 lldb/packages/Python/lldbsuite/test/lldbutil.py   | 6 +++---
 .../lldbsuite/test/tools/intelpt/intelpt_testcase.py  | 2 +-
 .../address_breakpoints/TestBadAddressBreakpoints.py  | 2 +-
 .../API/functionalities/step_scripted/TestStepScripted.py | 2 +-
 .../TestStopOnSharedlibraryEvents.py  | 2 +-
 lldb/test/API/lua_api/TestLuaAPI.py   | 2 +-
 .../macosx/thread_suspend/TestInternalThreadSuspension.py | 2 +-
 lldb/test/API/python_api/event/TestEvents.py  | 2 +-
 .../process/read-mem-cstring/TestReadMemCString.py| 2 +-
 lldb/test/API/python_api/type/TestTypeList.py | 2 +-
 lldb/test/API/python_api/was_interrupted/interruptible.py | 2 +-
 lldb/test/Shell/lit.cfg.py| 2 +-
 18 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/lldb/bindings/interface/SBBreakpointDocstrings.i 
b/lldb/bindings/interface/SBBreakpointDocstrings.i
index 74c139d5d9fb6..dca2819a9927b 100644
--- a/lldb/bindings/interface/SBBreakpointDocstrings.i
+++ b/lldb/bindings/interface/SBBreakpointDocstrings.i
@@ -39,7 +39,7 @@ TestBreakpointIgnoreCount.py),::
 #lldbutil.print_stacktraces(process)
 from lldbutil import get_stopped_thread
 thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
-self.assertTrue(thread != None, 'There should be a thread stopped due 
to breakpoint')
+self.assertTrue(thread is not None, 'There should be a thread stopped 
due to breakpoint')
 frame0 = thread.GetFrameAtIndex(0)
 frame1 = thread.GetFrameAtIndex(1)
 frame2 = thread.GetFrameAtIndex(2)
diff --git a/lldb/bindings/interface/SBDataExtensions.i 
b/lldb/bindings/interface/SBDataExtensions.i
index d980e79221c6d..ddea77a088dfa 100644
--- a/lldb/bindings/interface/SBDataExtensions.i
+++ b/lldb/bindings/interface/SBDataExtensions.i
@@ -40,19 +40,19 @@ STRING_EXTENSION_OUTSIDE(SBData)
 lldbtarget = lldbdict['target']
 else:
 lldbtarget = None
-if target == None and lldbtarget != None and lldbtarget.IsValid():
+if target is None and lldbtarget is not None and 
lldbtarget.IsValid():
 target = lldbtarget
-if ptr_size == None:
+if ptr_size is None:
 if target and target.IsValid():
 ptr_size = target.addr_size
 else:
 ptr_size = 8
-if endian == None:
+if endian is None:
 if target and target.IsValid():
 endian = target.byte_order
 else:
 endian = lldbdict['eByteOrderLittle']
-if size == None:
+if size is None:
 if value > 2147483647:
 size = 8
 elif value < -2147483648:
diff --git a/lldb/docs/use/python.rst b/lldb/docs/use/python.rst
index 6183d6935d80e..d9c29d95708c1 100644
--- a/lldb/docs/use/python.rst
+++ b/lldb/docs/use/python.rst
@@ -75,13 +75,13 @@ later explanations:
12: if root_word == word:
13: return cur_path
14: elif word < root_word:
-   15: if left_child_ptr.GetValue() == None:
+   15: if left_child_ptr.GetValue() is None:
16: return ""
17: else:
18: cur_path = cur_path + "L"
19: return DFS (left_child_ptr, word, cur_path)
20: else:
-   21: if right_child_ptr.GetValue() == None:
+   21: if right_child_ptr.GetValue() is None:
22: return ""
23: else:
24: cur_path = cur_path + "R"
diff --git a/lldb/examples/python/armv7_cortex_m_target_defintion.py 
b/lldb/examples/python/armv7_cortex_m_target_defintion.py
index 42eaa39993dae..8225670f33e6b 100755
--- 

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-31 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm updated 
https://github.com/llvm/llvm-project/pull/91857

>From 8379b042ef389e7c032e1bc3b32957bd386e2411 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sat, 11 May 2024 23:57:11 +0900
Subject: [PATCH 1/2] fix(python): fix comparison to None

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
---
 .../clang-tidy/checks/gen-static-analyzer-docs.py|  2 +-
 clang/docs/DebuggingCoroutines.rst   |  8 
 clang/tools/include-mapping/gen_std.py   |  2 +-
 clang/utils/check_cfc/obj_diff.py|  2 +-
 clang/utils/module-deps-to-rsp.py|  2 +-
 compiler-rt/test/asan/lit.cfg.py |  2 +-
 compiler-rt/test/builtins/Unit/lit.cfg.py|  2 +-
 compiler-rt/test/ctx_profile/lit.cfg.py  |  2 +-
 compiler-rt/test/lsan/lit.common.cfg.py  |  2 +-
 compiler-rt/test/memprof/lit.cfg.py  |  2 +-
 compiler-rt/test/profile/lit.cfg.py  |  2 +-
 .../android_commands/android_compile.py  |  2 +-
 .../sanitizer_common/ios_commands/iossim_compile.py  |  2 +-
 compiler-rt/test/ubsan/lit.common.cfg.py |  2 +-
 compiler-rt/test/ubsan_minimal/lit.common.cfg.py |  2 +-
 .../dexter/dex/command/ParseCommand.py   |  2 +-
 .../DebuggerControllers/ConditionalController.py |  4 ++--
 .../DebuggerControllers/ControllerHelpers.py |  2 +-
 .../debuginfo-tests/dexter/dex/debugger/Debuggers.py |  2 +-
 .../dexter/dex/debugger/visualstudio/VisualStudio.py |  2 +-
 .../debuginfo-tests/dexter/dex/tools/test/Tool.py|  2 +-
 cross-project-tests/lit.cfg.py   |  2 +-
 lldb/docs/use/python.rst |  4 ++--
 .../python/armv7_cortex_m_target_defintion.py|  2 +-
 lldb/packages/Python/lldbsuite/test/dotest.py|  2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py  |  6 +++---
 lldb/packages/Python/lldbsuite/test/lldbutil.py  |  6 +++---
 .../lldbsuite/test/tools/intelpt/intelpt_testcase.py |  2 +-
 .../address_breakpoints/TestBadAddressBreakpoints.py |  2 +-
 .../step_scripted/TestStepScripted.py|  2 +-
 .../TestStopOnSharedlibraryEvents.py |  2 +-
 lldb/test/API/lua_api/TestLuaAPI.py  |  2 +-
 .../thread_suspend/TestInternalThreadSuspension.py   |  2 +-
 lldb/test/API/python_api/event/TestEvents.py |  2 +-
 .../process/read-mem-cstring/TestReadMemCString.py   |  2 +-
 lldb/test/API/python_api/type/TestTypeList.py|  2 +-
 .../API/python_api/was_interrupted/interruptible.py  |  2 +-
 lldb/test/Shell/lit.cfg.py   |  2 +-
 llvm/utils/indirect_calls.py |  2 +-
 llvm/utils/lit/lit/TestRunner.py |  2 +-
 llvm/utils/lit/lit/util.py   |  2 +-
 llvm/utils/schedcover.py |  2 +-
 llvm/utils/shuffle_select_fuzz_tester.py | 12 ++--
 mlir/test/python/ir/affine_expr.py   |  2 +-
 mlir/test/python/ir/attributes.py|  8 
 mlir/test/python/ir/builtin_types.py |  8 
 openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py |  2 +-
 polly/lib/External/isl/libisl-gdb.py |  4 ++--
 polly/lib/External/isl/python/isl.py.top |  4 ++--
 polly/utils/pyscop/isl.py|  8 
 50 files changed, 75 insertions(+), 75 deletions(-)

diff --git 
a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py 
b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
index 6545a3906fa50..53ecb60dec539 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
+++ b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
@@ -47,7 +47,7 @@ def get_checkers(checkers_td, checkers_rst):
 parent_package_ = package["ParentPackage"]
 hidden = (checker["Hidden"] != 0) or (package["Hidden"] != 0)
 
-while parent_package_ != None:
+while parent_package_ is not None:
 parent_package = table_entries[parent_package_["def"]]
 checker_package_prefix = (
 parent_package["PackageName"] + "." + checker_package_prefix
diff --git a/clang/docs/DebuggingCoroutines.rst 
b/clang/docs/DebuggingCoroutines.rst
index 53bdd08fdbc02..7f464c1f4f28c 100644
--- a/clang/docs/DebuggingCoroutines.rst
+++ b/clang/docs/DebuggingCoroutines.rst
@@ -513,7 +513,7 @@ So we can use the ``continuation`` field to construct the 
asynchronous stack:
   self.coro_frame = coro_frame
   self.resume_func = dereference(self.coro_frame.resume_addr)
   self.resume_func_block = gdb.block_for_pc(self.resume_func)
-  if 

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-11 Thread Eisuke Kawashima via lldb-commits

e-kwsm wrote:

Commit message is updated/

https://github.com/llvm/llvm-project/pull/91857
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-11 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm updated 
https://github.com/llvm/llvm-project/pull/91858

>From 12e8ea6a0e104efbe130dd15d4d9051a7d86d50e Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sun, 12 May 2024 00:06:53 +0900
Subject: [PATCH] fix(python): fix comparison to True/False

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or is not, 
> never the equality operators.
---
 clang/tools/scan-build/bin/set-xcode-analyzer   | 2 +-
 clang/utils/check_cfc/check_cfc.py  | 4 ++--
 lldb/examples/python/crashlog.py| 2 +-
 lldb/examples/python/disasm-stress-test.py  | 4 ++--
 lldb/examples/summaries/cocoa/CFString.py   | 6 +++---
 lldb/examples/summaries/pysummary.py| 2 +-
 lldb/examples/synthetic/bitfield/example.py | 2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 +-
 lldb/test/API/commands/command/script/welcome.py| 2 +-
 .../commands/expression/call-throws/TestCallThatThrows.py   | 6 +++---
 .../disassemble/aarch64-adrp-add/TestAArch64AdrpAdd.py  | 2 +-
 .../gdb_remote_client/TestNoWatchpointSupportInfo.py| 2 +-
 lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py | 2 +-
 lldb/test/API/tools/lldb-server/TestLldbGdbServer.py| 2 +-
 llvm/utils/indirect_calls.py| 2 +-
 openmp/libompd/gdb-plugin/ompd/ompd.py  | 2 +-
 openmp/tools/archer/tests/lit.cfg   | 2 +-
 .../External/isl/imath/tests/gmp-compat-test/genpytest.py   | 2 +-
 18 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/clang/tools/scan-build/bin/set-xcode-analyzer 
b/clang/tools/scan-build/bin/set-xcode-analyzer
index f8c3f775ef7de..8d797bee4ae3b 100755
--- a/clang/tools/scan-build/bin/set-xcode-analyzer
+++ b/clang/tools/scan-build/bin/set-xcode-analyzer
@@ -107,7 +107,7 @@ def main():
 foundSpec = True
 ModifySpec(x, isBuiltinAnalyzer, path)
 
-  if foundSpec == False:
+  if foundSpec is False:
   print "(-) No compiler configuration file was found.  Xcode's analyzer 
has not been updated."
 
 if __name__ == '__main__':
diff --git a/clang/utils/check_cfc/check_cfc.py 
b/clang/utils/check_cfc/check_cfc.py
index 27d732d91030c..d4ddcb5bbb6a3 100755
--- a/clang/utils/check_cfc/check_cfc.py
+++ b/clang/utils/check_cfc/check_cfc.py
@@ -156,7 +156,7 @@ def get_output_file(args):
 elif arg.startswith("-o"):
 # Specified conjoined with -o
 return arg[2:]
-assert grabnext == False
+assert grabnext is False
 
 return None
 
@@ -182,7 +182,7 @@ def replace_output_file(args, new_name):
 if replaceidx is None:
 raise Exception
 replacement = new_name
-if attached == True:
+if attached is True:
 replacement = "-o" + new_name
 args[replaceidx] = replacement
 return args
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 641b2e64d53b1..62bd73643a46e 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -166,7 +166,7 @@ def dump_symbolicated(self, crash_log, options):
 this_thread_crashed = self.app_specific_backtrace
 if not this_thread_crashed:
 this_thread_crashed = self.did_crash()
-if options.crashed_only and this_thread_crashed == False:
+if options.crashed_only and this_thread_crashed is False:
 return
 
 print("%s" % self)
diff --git a/lldb/examples/python/disasm-stress-test.py 
b/lldb/examples/python/disasm-stress-test.py
index 2d3314ee8e8ff..8487b24fdcba7 100755
--- a/lldb/examples/python/disasm-stress-test.py
+++ b/lldb/examples/python/disasm-stress-test.py
@@ -95,13 +95,13 @@ def GetLLDBFrameworkPath():
 
 debugger = lldb.SBDebugger.Create()
 
-if debugger.IsValid() == False:
+if debugger.IsValid() is False:
 print("Couldn't create an SBDebugger")
 sys.exit(-1)
 
 target = debugger.CreateTargetWithFileAndArch(None, arg_ns.arch)
 
-if target.IsValid() == False:
+if target.IsValid() is False:
 print("Couldn't create an SBTarget for architecture " + arg_ns.arch)
 sys.exit(-1)
 
diff --git a/lldb/examples/summaries/cocoa/CFString.py 
b/lldb/examples/summaries/cocoa/CFString.py
index 13c294ca34122..fdea2c48870cb 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -253,9 +253,9 @@ def get_child_at_index(self, index):
 elif (
 self.inline
 and self.explicit
-and self.unicode == False
-and self.special == False
-and self.mutable == False
+and self.unicode is False
+and self.special is False
+and self.mutable is False
 

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-11 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm updated 
https://github.com/llvm/llvm-project/pull/91857

>From 7cec823d9a87b90bf8d9ae5c975f4492076e0abb Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sat, 11 May 2024 23:57:11 +0900
Subject: [PATCH] fix(python): fix comparison to None

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or is not, 
> never the equality operators.
---
 .../clang-tidy/checks/gen-static-analyzer-docs.py|  2 +-
 clang/docs/DebuggingCoroutines.rst   |  8 
 clang/tools/include-mapping/gen_std.py   |  2 +-
 clang/utils/check_cfc/obj_diff.py|  2 +-
 clang/utils/module-deps-to-rsp.py|  2 +-
 compiler-rt/test/asan/lit.cfg.py |  2 +-
 compiler-rt/test/builtins/Unit/lit.cfg.py|  2 +-
 compiler-rt/test/ctx_profile/lit.cfg.py  |  2 +-
 compiler-rt/test/lsan/lit.common.cfg.py  |  2 +-
 compiler-rt/test/memprof/lit.cfg.py  |  2 +-
 compiler-rt/test/profile/lit.cfg.py  |  2 +-
 .../android_commands/android_compile.py  |  2 +-
 .../sanitizer_common/ios_commands/iossim_compile.py  |  2 +-
 compiler-rt/test/ubsan/lit.common.cfg.py |  2 +-
 compiler-rt/test/ubsan_minimal/lit.common.cfg.py |  2 +-
 .../dexter/dex/command/ParseCommand.py   |  2 +-
 .../DebuggerControllers/ConditionalController.py |  4 ++--
 .../DebuggerControllers/ControllerHelpers.py |  2 +-
 .../debuginfo-tests/dexter/dex/debugger/Debuggers.py |  2 +-
 .../dexter/dex/debugger/visualstudio/VisualStudio.py |  2 +-
 .../debuginfo-tests/dexter/dex/tools/test/Tool.py|  2 +-
 cross-project-tests/lit.cfg.py   |  2 +-
 lldb/docs/use/python.rst |  4 ++--
 .../python/armv7_cortex_m_target_defintion.py|  2 +-
 lldb/packages/Python/lldbsuite/test/dotest.py|  2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py  |  6 +++---
 lldb/packages/Python/lldbsuite/test/lldbutil.py  |  6 +++---
 .../lldbsuite/test/tools/intelpt/intelpt_testcase.py |  2 +-
 .../address_breakpoints/TestBadAddressBreakpoints.py |  2 +-
 .../step_scripted/TestStepScripted.py|  2 +-
 .../TestStopOnSharedlibraryEvents.py |  2 +-
 lldb/test/API/lua_api/TestLuaAPI.py  |  2 +-
 .../thread_suspend/TestInternalThreadSuspension.py   |  2 +-
 lldb/test/API/python_api/event/TestEvents.py |  2 +-
 .../process/read-mem-cstring/TestReadMemCString.py   |  2 +-
 lldb/test/API/python_api/type/TestTypeList.py|  2 +-
 .../API/python_api/was_interrupted/interruptible.py  |  2 +-
 lldb/test/Shell/lit.cfg.py   |  2 +-
 llvm/utils/indirect_calls.py |  2 +-
 llvm/utils/lit/lit/TestRunner.py |  2 +-
 llvm/utils/lit/lit/util.py   |  2 +-
 llvm/utils/schedcover.py |  2 +-
 llvm/utils/shuffle_select_fuzz_tester.py | 12 ++--
 mlir/test/python/ir/affine_expr.py   |  2 +-
 mlir/test/python/ir/attributes.py|  8 
 mlir/test/python/ir/builtin_types.py |  8 
 openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py |  2 +-
 polly/lib/External/isl/libisl-gdb.py |  4 ++--
 polly/lib/External/isl/python/isl.py.top |  4 ++--
 polly/utils/pyscop/isl.py|  8 
 50 files changed, 75 insertions(+), 75 deletions(-)

diff --git 
a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py 
b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
index 6545a3906fa50..53ecb60dec539 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
+++ b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
@@ -47,7 +47,7 @@ def get_checkers(checkers_td, checkers_rst):
 parent_package_ = package["ParentPackage"]
 hidden = (checker["Hidden"] != 0) or (package["Hidden"] != 0)
 
-while parent_package_ != None:
+while parent_package_ is not None:
 parent_package = table_entries[parent_package_["def"]]
 checker_package_prefix = (
 parent_package["PackageName"] + "." + checker_package_prefix
diff --git a/clang/docs/DebuggingCoroutines.rst 
b/clang/docs/DebuggingCoroutines.rst
index 53bdd08fdbc02..7f464c1f4f28c 100644
--- a/clang/docs/DebuggingCoroutines.rst
+++ b/clang/docs/DebuggingCoroutines.rst
@@ -513,7 +513,7 @@ So we can use the ``continuation`` field to construct the 
asynchronous stack:
   self.coro_frame = coro_frame
   self.resume_func = dereference(self.coro_frame.resume_addr)
   self.resume_func_block = gdb.block_for_pc(self.resume_func)
-  if 

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] fix(python): fix invalid escape sequences (PR #91856)

2024-05-11 Thread Eisuke Kawashima via lldb-commits

e-kwsm wrote:

> Why do we need to make this change?

The valid escape sequences in Python are listed 
[here](https://docs.python.org/3/reference/lexical_analysis.html#escape-sequences):
 `\t`, `\n`, etc.

Invalid ones fixed here seem to be used for regular expression, 
[re](https://docs.python.org/3/library/re.html), e.g. `\.` for literal dot, 
`\d` for a digit `[0-9]`.

I use [flake8](https://flake8.pycqa.org/en/latest/) for check.

> Did you use a script to generate this patch?

No. We have choices to fix these:

1. escape backslashes: `"\s"` -> `"\\s"`
2. use raw string: `"\s"` -> `r"\s"`

I thought 2 is simple but actually it does not work for e.g.:

```diff
--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
+++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
@@ -242,7 +242,7 @@ def main():
 filename = None
 lines_by_file = {}
 for line in sys.stdin:
-match = re.search('^\+\+\+\ "?(.*?/){%s}([^ \t\n"]*)' % args.p, line)
+match = re.search('^\\+\\+\\+\\ "?(.*?/){%s}([^ \t\n"]*)' % args.p, 
line)
 if match:
 filename = match.group(2)
 if filename is None:
```

Here `\t\n` is valid whereas `\+` is not.

So I manually fixed them.

https://github.com/llvm/llvm-project/pull/91856
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-11 Thread Eisuke Kawashima via lldb-commits

e-kwsm wrote:

>From [PEP8](https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with `is` or `is 
> not`, never the equality operators.

[flake8](https://flake8.pycqa.org/en/latest/) is used here.


https://github.com/llvm/llvm-project/pull/91857
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-11 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm created 
https://github.com/llvm/llvm-project/pull/91858

None

>From 1e31186c01024c63fa4c0bd378fec7131ce84d56 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sun, 12 May 2024 00:06:53 +0900
Subject: [PATCH] fix(python): fix comparison to True/False

---
 clang/tools/scan-build/bin/set-xcode-analyzer   | 2 +-
 clang/utils/check_cfc/check_cfc.py  | 4 ++--
 lldb/examples/python/crashlog.py| 2 +-
 lldb/examples/python/disasm-stress-test.py  | 4 ++--
 lldb/examples/summaries/cocoa/CFString.py   | 6 +++---
 lldb/examples/summaries/pysummary.py| 2 +-
 lldb/examples/synthetic/bitfield/example.py | 2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 +-
 lldb/test/API/commands/command/script/welcome.py| 2 +-
 .../commands/expression/call-throws/TestCallThatThrows.py   | 6 +++---
 .../disassemble/aarch64-adrp-add/TestAArch64AdrpAdd.py  | 2 +-
 .../gdb_remote_client/TestNoWatchpointSupportInfo.py| 2 +-
 lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py | 2 +-
 lldb/test/API/tools/lldb-server/TestLldbGdbServer.py| 2 +-
 llvm/utils/indirect_calls.py| 2 +-
 openmp/libompd/gdb-plugin/ompd/ompd.py  | 2 +-
 openmp/tools/archer/tests/lit.cfg   | 2 +-
 .../External/isl/imath/tests/gmp-compat-test/genpytest.py   | 2 +-
 18 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/clang/tools/scan-build/bin/set-xcode-analyzer 
b/clang/tools/scan-build/bin/set-xcode-analyzer
index f8c3f775ef7de..8d797bee4ae3b 100755
--- a/clang/tools/scan-build/bin/set-xcode-analyzer
+++ b/clang/tools/scan-build/bin/set-xcode-analyzer
@@ -107,7 +107,7 @@ def main():
 foundSpec = True
 ModifySpec(x, isBuiltinAnalyzer, path)
 
-  if foundSpec == False:
+  if foundSpec is False:
   print "(-) No compiler configuration file was found.  Xcode's analyzer 
has not been updated."
 
 if __name__ == '__main__':
diff --git a/clang/utils/check_cfc/check_cfc.py 
b/clang/utils/check_cfc/check_cfc.py
index 27d732d91030c..d4ddcb5bbb6a3 100755
--- a/clang/utils/check_cfc/check_cfc.py
+++ b/clang/utils/check_cfc/check_cfc.py
@@ -156,7 +156,7 @@ def get_output_file(args):
 elif arg.startswith("-o"):
 # Specified conjoined with -o
 return arg[2:]
-assert grabnext == False
+assert grabnext is False
 
 return None
 
@@ -182,7 +182,7 @@ def replace_output_file(args, new_name):
 if replaceidx is None:
 raise Exception
 replacement = new_name
-if attached == True:
+if attached is True:
 replacement = "-o" + new_name
 args[replaceidx] = replacement
 return args
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 641b2e64d53b1..62bd73643a46e 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -166,7 +166,7 @@ def dump_symbolicated(self, crash_log, options):
 this_thread_crashed = self.app_specific_backtrace
 if not this_thread_crashed:
 this_thread_crashed = self.did_crash()
-if options.crashed_only and this_thread_crashed == False:
+if options.crashed_only and this_thread_crashed is False:
 return
 
 print("%s" % self)
diff --git a/lldb/examples/python/disasm-stress-test.py 
b/lldb/examples/python/disasm-stress-test.py
index 2d3314ee8e8ff..8487b24fdcba7 100755
--- a/lldb/examples/python/disasm-stress-test.py
+++ b/lldb/examples/python/disasm-stress-test.py
@@ -95,13 +95,13 @@ def GetLLDBFrameworkPath():
 
 debugger = lldb.SBDebugger.Create()
 
-if debugger.IsValid() == False:
+if debugger.IsValid() is False:
 print("Couldn't create an SBDebugger")
 sys.exit(-1)
 
 target = debugger.CreateTargetWithFileAndArch(None, arg_ns.arch)
 
-if target.IsValid() == False:
+if target.IsValid() is False:
 print("Couldn't create an SBTarget for architecture " + arg_ns.arch)
 sys.exit(-1)
 
diff --git a/lldb/examples/summaries/cocoa/CFString.py 
b/lldb/examples/summaries/cocoa/CFString.py
index 13c294ca34122..fdea2c48870cb 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -253,9 +253,9 @@ def get_child_at_index(self, index):
 elif (
 self.inline
 and self.explicit
-and self.unicode == False
-and self.special == False
-and self.mutable == False
+and self.unicode is False
+and self.special is False
+and self.mutable is False
 ):
 return self.handle_inline_explicit()
 elif self.unicode:
diff --git a/lldb/examples/summaries/pysummary.py 

[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-11 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm created 
https://github.com/llvm/llvm-project/pull/91857

None

>From c450df191a6b96591d7c7a7454b6e15cb925520f Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sat, 11 May 2024 23:57:11 +0900
Subject: [PATCH] fix(python): fix comparison to None

---
 .../clang-tidy/checks/gen-static-analyzer-docs.py|  2 +-
 clang/docs/DebuggingCoroutines.rst   |  8 
 clang/tools/include-mapping/gen_std.py   |  2 +-
 clang/utils/check_cfc/obj_diff.py|  2 +-
 clang/utils/module-deps-to-rsp.py|  2 +-
 compiler-rt/test/asan/lit.cfg.py |  2 +-
 compiler-rt/test/builtins/Unit/lit.cfg.py|  2 +-
 compiler-rt/test/ctx_profile/lit.cfg.py  |  2 +-
 compiler-rt/test/lsan/lit.common.cfg.py  |  2 +-
 compiler-rt/test/memprof/lit.cfg.py  |  2 +-
 compiler-rt/test/profile/lit.cfg.py  |  2 +-
 .../android_commands/android_compile.py  |  2 +-
 .../sanitizer_common/ios_commands/iossim_compile.py  |  2 +-
 compiler-rt/test/ubsan/lit.common.cfg.py |  2 +-
 compiler-rt/test/ubsan_minimal/lit.common.cfg.py |  2 +-
 .../dexter/dex/command/ParseCommand.py   |  2 +-
 .../DebuggerControllers/ConditionalController.py |  4 ++--
 .../DebuggerControllers/ControllerHelpers.py |  2 +-
 .../debuginfo-tests/dexter/dex/debugger/Debuggers.py |  2 +-
 .../dexter/dex/debugger/visualstudio/VisualStudio.py |  2 +-
 .../debuginfo-tests/dexter/dex/tools/test/Tool.py|  2 +-
 cross-project-tests/lit.cfg.py   |  2 +-
 lldb/docs/use/python.rst |  4 ++--
 .../python/armv7_cortex_m_target_defintion.py|  2 +-
 lldb/packages/Python/lldbsuite/test/dotest.py|  2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py  |  6 +++---
 lldb/packages/Python/lldbsuite/test/lldbutil.py  |  6 +++---
 .../lldbsuite/test/tools/intelpt/intelpt_testcase.py |  2 +-
 .../address_breakpoints/TestBadAddressBreakpoints.py |  2 +-
 .../step_scripted/TestStepScripted.py|  2 +-
 .../TestStopOnSharedlibraryEvents.py |  2 +-
 lldb/test/API/lua_api/TestLuaAPI.py  |  2 +-
 .../thread_suspend/TestInternalThreadSuspension.py   |  2 +-
 lldb/test/API/python_api/event/TestEvents.py |  2 +-
 .../process/read-mem-cstring/TestReadMemCString.py   |  2 +-
 lldb/test/API/python_api/type/TestTypeList.py|  2 +-
 .../API/python_api/was_interrupted/interruptible.py  |  2 +-
 lldb/test/Shell/lit.cfg.py   |  2 +-
 llvm/utils/indirect_calls.py |  2 +-
 llvm/utils/lit/lit/TestRunner.py |  2 +-
 llvm/utils/lit/lit/util.py   |  2 +-
 llvm/utils/schedcover.py |  2 +-
 llvm/utils/shuffle_select_fuzz_tester.py | 12 ++--
 mlir/test/python/ir/affine_expr.py   |  2 +-
 mlir/test/python/ir/attributes.py|  8 
 mlir/test/python/ir/builtin_types.py |  8 
 openmp/libompd/gdb-plugin/ompd/ompd_callbacks.py |  2 +-
 polly/lib/External/isl/libisl-gdb.py |  4 ++--
 polly/lib/External/isl/python/isl.py.top |  4 ++--
 polly/utils/pyscop/isl.py|  8 
 50 files changed, 75 insertions(+), 75 deletions(-)

diff --git 
a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py 
b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
index 6545a3906fa50..53ecb60dec539 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
+++ b/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
@@ -47,7 +47,7 @@ def get_checkers(checkers_td, checkers_rst):
 parent_package_ = package["ParentPackage"]
 hidden = (checker["Hidden"] != 0) or (package["Hidden"] != 0)
 
-while parent_package_ != None:
+while parent_package_ is not None:
 parent_package = table_entries[parent_package_["def"]]
 checker_package_prefix = (
 parent_package["PackageName"] + "." + checker_package_prefix
diff --git a/clang/docs/DebuggingCoroutines.rst 
b/clang/docs/DebuggingCoroutines.rst
index 53bdd08fdbc02..7f464c1f4f28c 100644
--- a/clang/docs/DebuggingCoroutines.rst
+++ b/clang/docs/DebuggingCoroutines.rst
@@ -513,7 +513,7 @@ So we can use the ``continuation`` field to construct the 
asynchronous stack:
   self.coro_frame = coro_frame
   self.resume_func = dereference(self.coro_frame.resume_addr)
   self.resume_func_block = gdb.block_for_pc(self.resume_func)
-  if self.resume_func_block == None:
+  if self.resume_func_block is None:
   raise Exception('Not stackless coroutine.')
   self.line_info = gdb.find_pc_line(self.resume_func)