Commit fab8bad9 authored by Eduardo Souza's avatar Eduardo Souza

Allowing to export context only.

parent 8c60cb4b
......@@ -178,6 +178,7 @@ class TranslationDriver(SimpleTaskEngine):
def setup(self, entry_point, inputtypes, policy=None, extra={}, empty_translator=None):
standalone = inputtypes is None
self.standalone = standalone
self.export_context = False
if standalone:
# the 'argv' parameter
......@@ -614,7 +615,7 @@ class TranslationDriver(SimpleTaskEngine):
self.translator.mu_bdlgen = MuBundleGen(self.translator.mu_db)
if self.standalone:
target_name = self.compute_exe_name()
return self.translator.mu_bdlgen.gen_boot_image(str(target_name))
return self.translator.mu_bdlgen.gen_boot_image(str(target_name), self.export_context)
else:
return self.translator.mu_bdlgen.build_and_load_bundle()
......
......@@ -157,7 +157,7 @@ class MuBundleGen:
self.log.check_reloc_object('%d glocal cells created for pointer relocation objects...' %
len(self.db.objtracer.fixed_objs))
def gen_boot_image(self, targetname):
def gen_boot_image(self, targetname, export_context):
self.build_and_load_bundle()
if self.mu_config.testjit:
......@@ -166,11 +166,13 @@ class MuBundleGen:
else:
hmain = self.ctx.handle_from_func(self._id_of(self.db.tlc.entry_point_graph))
topdefs = []
topdefs.extend(self._ids_of(self.db.types))
topdefs.extend(self._ids_of(self.db.consts))
topdefs.extend(self._ids_of(self.db.extern_fncs))
topdefs.extend(self._ids_of(self.db.gcells))
topdefs.extend(self._ids_of(self.db.graphs))
if not export_context:
topdefs.extend(self._ids_of(self.db.types))
topdefs.extend(self._ids_of(self.db.consts))
topdefs.extend(self._ids_of(self.db.extern_fncs))
topdefs.extend(self._ids_of(self.db.gcells))
topdefs.extend(self._ids_of(self.db.graphs))
reloc_sym_strs = []
reloc_hgcls = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment