about summary refs log tree commit diff stats
path: root/miasm2/jitter/jitcore_gcc.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/jitter/jitcore_gcc.py')
-rw-r--r--miasm2/jitter/jitcore_gcc.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/miasm2/jitter/jitcore_gcc.py b/miasm2/jitter/jitcore_gcc.py
index 7f72d8e7..e2f308e6 100644
--- a/miasm2/jitter/jitcore_gcc.py
+++ b/miasm2/jitter/jitcore_gcc.py
@@ -28,16 +28,6 @@ def gen_core(arch, attrib):
     return txt
 
 
-def gen_C_source(ir_arch, func_code):
-    c_source = ""
-    c_source += "\n".join(func_code)
-
-    c_source = gen_core(ir_arch.arch, ir_arch.attrib) + c_source
-    c_source = "#include <Python.h>\n" + c_source
-
-    return c_source
-
-
 class myresolver(object):
 
     def __init__(self, offset):
@@ -131,7 +121,7 @@ class JitCore_Gcc(jitcore.JitCore):
         out = [f_declaration + '{'] + out + ['}\n']
         c_code = out
 
-        return gen_C_source(self.ir_arch, c_code)
+        return self.gen_C_source(self.ir_arch, c_code)
 
     def add_bloc(self, block):
         """Add a bloc to JiT and JiT it.
@@ -166,3 +156,13 @@ class JitCore_Gcc(jitcore.JitCore):
             os.remove(fname_in)
 
         self.load_code(block.label, fname_out)
+
+    @staticmethod
+    def gen_C_source(ir_arch, func_code):
+        c_source = ""
+        c_source += "\n".join(func_code)
+
+        c_source = gen_core(ir_arch.arch, ir_arch.attrib) + c_source
+        c_source = "#include <Python.h>\n" + c_source
+
+        return c_source