diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-01-30 12:00:05 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-05-02 12:37:32 +0000 |
commit | b046be6858c0a9ea3df48ff77481577226dcd8e8 (patch) | |
tree | 15a2a4844b0d54b0280ed24c7cd3900274d01734 /src/sim/init.cc | |
parent | 8eb84518f15fcef59da90e7ec72e2bc88fb5b59d (diff) | |
download | gem5-b046be6858c0a9ea3df48ff77481577226dcd8e8.tar.xz |
base, sim, dev: Remove SWIG
Remove SWIG guards and SWIG-specific C++ code.
Change-Id: Icaad6720513b6f48153727ef3f70e0dba0df4bee
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2921
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src/sim/init.cc')
-rw-r--r-- | src/sim/init.cc | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/sim/init.cc b/src/sim/init.cc index 33cd4040f..70578197f 100644 --- a/src/sim/init.cc +++ b/src/sim/init.cc @@ -127,8 +127,7 @@ EmbeddedPython::addModule() const } /* - * Load and initialize all of the python parts of M5, including Swig - * and the embedded module importer. + * Load and initialize all of the python parts of M5. */ int EmbeddedPython::initAll() @@ -152,40 +151,6 @@ EmbeddedPython::initAll() return 0; } -EmbeddedSwig::EmbeddedSwig(void (*init_func)(), const string& _context) - : initFunc(init_func), context(_context) -{ - getList().push_back(this); -} - -list<EmbeddedSwig *> & -EmbeddedSwig::getList() -{ - static list<EmbeddedSwig *> the_list; - return the_list; -} - -void -EmbeddedSwig::initAll() -{ - char* old_context = _Py_PackageContext; - // initialize SWIG modules. initFunc() is autogenerated and calls - // all of the individual swig initialization functions. - for (auto i : getList()) { - // to ensure that the loaded modules are placed in the right - // package we have to be a bit unorthodox and directly - // manipulate the package context since swig simply calls - // Py_InitModule with nothing but the module name of the - // wrapper - char* cstr = new char[i->context.size() + 1]; - strcpy(cstr, i->context.c_str()); - _Py_PackageContext = cstr; - i->initFunc(); - delete[] cstr; - } - _Py_PackageContext = old_context; -} - EmbeddedPyBind::EmbeddedPyBind(const char *_name, void (*init_func)(py::module &), const char *_base) @@ -265,7 +230,6 @@ EmbeddedPyBind::initAll() int initM5Python() { - EmbeddedSwig::initAll(); EmbeddedPyBind::initAll(); return EmbeddedPython::initAll(); } |