Skip to content

Commit

Permalink
Move STRUCT_INFO to settings_internal.js. NFC. (#12126)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Sep 8, 2020
1 parent aaa6773 commit 1eb50fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
19 changes: 9 additions & 10 deletions emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,23 +980,22 @@ def normalize_line_endings(text):


def generate_struct_info():
if not shared.Settings.STRUCT_INFO and not shared.Settings.BOOTSTRAPPING_STRUCT_INFO:
generated_struct_info_name = 'generated_struct_info.json'
generated_struct_info_name = 'generated_struct_info.json'

def generate_struct_info():
with ToolchainProfiler.profile_block('gen_struct_info'):
out = shared.Cache.get_path(generated_struct_info_name)
gen_struct_info.main(['-q', '-c', '-o', out])
return out
def generate_struct_info():
with ToolchainProfiler.profile_block('gen_struct_info'):
out = shared.Cache.get_path(generated_struct_info_name)
gen_struct_info.main(['-q', '-c', '-o', out])
return out

shared.Settings.STRUCT_INFO = shared.Cache.get(generated_struct_info_name, generate_struct_info)
# do we need an else, to define it for the bootstrap case?
shared.Settings.STRUCT_INFO = shared.Cache.get(generated_struct_info_name, generate_struct_info)


def run(infile, outfile, memfile):
temp_files = shared.configuration.get_temp_files()
infile, outfile = substitute_response_files([infile, outfile])
generate_struct_info()
if not shared.Settings.BOOTSTRAPPING_STRUCT_INFO:
generate_struct_info()

outfile_obj = open(outfile, 'w')

Expand Down
3 changes: 0 additions & 3 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,9 +1051,6 @@ var RUNNING_JS_OPTS = 0;
// whether we are in the generate struct_info bootstrap phase
var BOOTSTRAPPING_STRUCT_INFO = 0;

// struct_info that is either generated or cached
var STRUCT_INFO = '';

// Add some calls to emscripten tracing APIs
var EMSCRIPTEN_TRACING = 0;

Expand Down
3 changes: 3 additions & 0 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,6 @@ var EXPECT_MAIN = 1;
var EXPORT_READY_PROMISE = 1;

var USE_LEGACY_DYNCALLS = 0;

// struct_info that is either generated or cached
var STRUCT_INFO = '';

0 comments on commit 1eb50fb

Please sign in to comment.