scons: Get rid of some unused or unnecessary PySource members.
These were either not used at all, or were unnecessary since they, for instance, were used to name a variable in an anonymous namespace where the actual name is hidden and largely irrelevant. Change-Id: I738960cf0d84017ccc133428aef56701c1d40b03 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48139 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -347,10 +347,8 @@ class Source(SourceFile):
|
||||
|
||||
class PySource(SourceFile):
|
||||
'''Add a python source file to the named package'''
|
||||
invalid_sym_char = re.compile('[^A-z0-9_]')
|
||||
modules = {}
|
||||
tnodes = {}
|
||||
symnames = {}
|
||||
|
||||
def __init__(self, package, source, tags=None, add_tags=None):
|
||||
'''specify the python package, the source file, and any tags'''
|
||||
@@ -380,13 +378,10 @@ class PySource(SourceFile):
|
||||
self.modpath = modpath
|
||||
self.arcname = os.path.join(*arcpath)
|
||||
self.abspath = abspath
|
||||
self.compiled = File(self.filename + 'c')
|
||||
self.cpp = File(self.filename + '.cc')
|
||||
self.symname = PySource.invalid_sym_char.sub('_', modpath)
|
||||
|
||||
PySource.modules[modpath] = self
|
||||
PySource.tnodes[self.tnode] = self
|
||||
PySource.symnames[self.symname] = self
|
||||
|
||||
class SimObject(PySource):
|
||||
'''Add a SimObject python file as a python source object and add
|
||||
@@ -1205,7 +1200,6 @@ def embedPyFile(target, source, env):
|
||||
compressed = zlib.compress(marshalled)
|
||||
data = compressed
|
||||
pysource = PySource.tnodes[source[1]]
|
||||
sym = pysource.symname
|
||||
|
||||
code = code_formatter()
|
||||
code('''\
|
||||
@@ -1217,13 +1211,16 @@ namespace
|
||||
{
|
||||
|
||||
''')
|
||||
bytesToCppArray(code, 'data_{}'.format(sym), data)
|
||||
bytesToCppArray(code, 'embedded_module_data', data)
|
||||
# The name of the EmbeddedPython object doesn't matter since it's in an
|
||||
# anonymous namespace, and it's constructor takes care of installing it
|
||||
# into a global list.
|
||||
code('''
|
||||
EmbeddedPython embedded_${sym}(
|
||||
EmbeddedPython embedded_module_info(
|
||||
${{c_str(pysource.arcname)}},
|
||||
${{c_str(pysource.abspath)}},
|
||||
${{c_str(pysource.modpath)}},
|
||||
data_${sym},
|
||||
embedded_module_data,
|
||||
${{len(data)}},
|
||||
${{len(marshalled)}});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user