Skip to content

Commit e83c573

Browse files
authored
[link.py] Simplify process_libraries. NFC (#23318)
These is no need for the second argument here since the only user of this argument can simply use `new_flags` instead. Both `new_flags` and `linker_inputs` get combined in the link command in any case and they are ordered by the index element of the tuples so that ordering doesn't change here.
1 parent 306e714 commit e83c573

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/link.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,7 +2805,7 @@ def map_to_js_libs(library_name):
28052805
return None
28062806

28072807

2808-
def process_libraries(state, linker_inputs):
2808+
def process_libraries(state):
28092809
new_flags = []
28102810
libraries = []
28112811
suffixes = STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS
@@ -2843,7 +2843,7 @@ def process_libraries(state, linker_inputs):
28432843
break
28442844

28452845
if path:
2846-
linker_inputs.append((i, path))
2846+
new_flags.append((i, path))
28472847
continue
28482848

28492849
new_flags.append((i, flag))
@@ -3087,7 +3087,7 @@ def phase_calculate_linker_inputs(options, state, linker_inputs):
30873087
state.link_flags = filter_link_flags(state.link_flags, using_lld)
30883088

30893089
# Decide what we will link
3090-
process_libraries(state, linker_inputs)
3090+
process_libraries(state)
30913091

30923092
# Interleave the linker inputs with the linker flags while maintainging their
30933093
# relative order on the command line (both of these list are pairs, with the
@@ -3111,8 +3111,8 @@ def phase_calculate_linker_inputs(options, state, linker_inputs):
31113111

31123112
def run_post_link(wasm_input, options, state):
31133113
settings.limit_settings(None)
3114-
target, wasm_target = phase_linker_setup(options, state )
3115-
process_libraries(state, [])
3114+
target, wasm_target = phase_linker_setup(options, state)
3115+
process_libraries(state)
31163116
phase_post_link(options, state, wasm_input, wasm_target, target, {})
31173117

31183118

0 commit comments

Comments
 (0)