Skip to content

Commit 598210e

Browse files
authored
Use python deadcode module to help find dead code. NFC (#25349)
I'm removed a few obvious dead declarations, hopefully more to follow.
1 parent fd0df37 commit 598210e

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

emcc.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,6 @@ def make_relative(filename):
165165
reproduce_file.add(rsp_name, os.path.join(root, 'response.txt'))
166166

167167

168-
def cxx_to_c_compiler(cxx):
169-
# Convert C++ compiler name into C compiler name
170-
dirname, basename = os.path.split(cxx)
171-
basename = basename.replace('clang++', 'clang').replace('g++', 'gcc').replace('em++', 'emcc')
172-
return os.path.join(dirname, basename)
173-
174-
175168
def get_library_basename(filename):
176169
"""Similar to get_file_suffix this strips off all numeric suffixes and then
177170
then final non-numeric one. For example for 'libz.so.1.2.8' returns 'libz'"""

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,6 @@ ignore_errors = true
108108
[[tool.mypy.overrides]]
109109
module = ["psutil", "win32con", "win32gui", "win32process"]
110110
ignore_missing_imports = true
111+
112+
[tool.deadcode]
113+
exclude = ["out", "third_party", "test/third_party"]

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ psutil==7.0.0
1010
ruff==0.11.7
1111
types-requests==2.32.0.20241016
1212
unittest-xml-reporting==3.2.0
13+
deadcode==2.3.1
1314

1415
# This version is mentioned in `site/source/docs/site/about.rst`.
1516
# Please keep them in sync.

tools/shared.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,7 @@ def init():
745745
EMXX = bat_suffix(path_from_root('em++'))
746746
EMAR = bat_suffix(path_from_root('emar'))
747747
EMRANLIB = bat_suffix(path_from_root('emranlib'))
748-
EM_NM = bat_suffix(path_from_root('emnm'))
749748
FILE_PACKAGER = bat_suffix(path_from_root('tools/file_packager'))
750-
WASM_SOURCEMAP = bat_suffix(path_from_root('tools/wasm-sourcemap'))
751749
# Windows .dll suffix is not included in this list, since those are never
752750
# linked to directly on the command line.
753751
DYLIB_EXTENSIONS = ['.dylib', '.so']

0 commit comments

Comments
 (0)