Skip to content

Commit 268d2ad

Browse files
committed
Rename internal USER_EXPORTED_FUNCTIONS setting. NFC
In preparation for emscripten-core#8380
1 parent 5654715 commit 268d2ad

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

emcc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def apply_user_settings():
292292

293293
if key == 'EXPORTED_FUNCTIONS':
294294
# used for warnings in emscripten.py
295-
settings.USER_EXPORTED_FUNCTIONS = settings.EXPORTED_FUNCTIONS.copy()
295+
settings.USER_EXPORTS = settings.EXPORTED_FUNCTIONS.copy()
296296

297297
# TODO(sbc): Remove this legacy way.
298298
if key == 'WASM_OBJECT_FILES':

src/settings_internal.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ var EMIT_NAME_SECTION = false;
125125
// Whether we are emitting a symbol map.
126126
var EMIT_SYMBOL_MAP = false;
127127

128-
// List of function explicitly exported by user on the command line.
129-
var USER_EXPORTED_FUNCTIONS = [];
128+
// List of symbols explicitly exported by user on the command line.
129+
var USER_EXPORTS = [];
130130

131131
// name of the file containing wasm binary, if relevant
132132
var WASM_BINARY_FILE = '';

tools/emscripten.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def set_memory(static_bump):
230230
def report_missing_exports_wasm_only(metadata):
231231
if diagnostics.is_enabled('undefined'):
232232
defined_symbols = set(asmjs_mangle(e) for e in metadata.all_exports)
233-
missing = set(settings.USER_EXPORTED_FUNCTIONS) - defined_symbols
233+
missing = set(settings.USER_EXPORTS) - defined_symbols
234234
for symbol in sorted(missing):
235235
diagnostics.warning('undefined', f'undefined exported symbol: "{symbol}"')
236236

@@ -240,7 +240,7 @@ def report_missing_exports(js_symbols):
240240
# Report any symbol that was explicitly exported but is present neither
241241
# as a native function nor as a JS library function.
242242
defined_symbols = set(asmjs_mangle(e) for e in settings.WASM_EXPORTS).union(js_symbols)
243-
missing = set(settings.USER_EXPORTED_FUNCTIONS) - defined_symbols
243+
missing = set(settings.USER_EXPORTS) - defined_symbols
244244
for symbol in sorted(missing):
245245
diagnostics.warning('undefined', f'undefined exported symbol: "{symbol}"')
246246

@@ -600,7 +600,7 @@ def finalize_wasm(infile, outfile, js_syms):
600600
unexpected_exports = [e for e in unexpected_exports if e not in expected_exports]
601601

602602
if not settings.STANDALONE_WASM and 'main' in metadata.all_exports or '__main_argc_argv' in metadata.all_exports:
603-
if 'EXPORTED_FUNCTIONS' in user_settings and '_main' not in settings.USER_EXPORTED_FUNCTIONS:
603+
if 'EXPORTED_FUNCTIONS' in user_settings and '_main' not in settings.USER_EXPORTS:
604604
# If `_main` was unexpectedly exported we assume it was added to
605605
# EXPORT_IF_DEFINED by `phase_linker_setup` in order that we can detect
606606
# it and report this warning. After reporting the warning we explicitly

tools/link.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ def phase_linker_setup(options, state, newargs):
807807
# 2. If the user doesn't export anything we default to exporting `_main` (unless `--no-entry`
808808
# is specified (see above).
809809
if 'EXPORTED_FUNCTIONS' in user_settings:
810-
if '_main' in settings.USER_EXPORTED_FUNCTIONS:
810+
if '_main' in settings.USER_EXPORTS:
811811
settings.EXPORTED_FUNCTIONS.remove('_main')
812812
settings.EXPORT_IF_DEFINED.append('main')
813813
else:
@@ -998,7 +998,7 @@ def phase_linker_setup(options, state, newargs):
998998
if settings.MAIN_MODULE == 1 or settings.SIDE_MODULE == 1:
999999
settings.LINKABLE = 1
10001000

1001-
if settings.LINKABLE and settings.USER_EXPORTED_FUNCTIONS:
1001+
if settings.LINKABLE and settings.USER_EXPORTS:
10021002
diagnostics.warning('unused-command-line-argument', 'EXPORTED_FUNCTIONS is not valid with LINKABLE set (normally due to SIDE_MODULE=1/MAIN_MODULE=1) since all functions are exported this mode. To export only a subset use SIDE_MODULE=2/MAIN_MODULE=2')
10031003

10041004
if settings.MAIN_MODULE:

0 commit comments

Comments
 (0)