[pypy-svn] r66056 - pypy/branch/pyjitpl5/pypy/translator
arigo at codespeak.net
arigo at codespeak.net
Tue Jun 30 16:38:23 CEST 2009
Author: arigo
Date: Tue Jun 30 16:38:22 2009
New Revision: 66056
Added:
pypy/branch/pyjitpl5/pypy/translator/driver.py.merge.tmp
- copied, changed from r66039, pypy/branch/pyjitpl5/pypy/translator/driver.py
Log:
merging of svn+ssh://codespeak.net/svn/pypy/trunk/pypy/translator/driver.py
revisions 62865 to 66039:
------------------------------------------------------------------------
r66014 | fijal | 2009-06-28 20:35:34 +0200 (Sun, 28 Jun 2009) | 2 lines
minor adjustment for reuse of libdef in C backend
------------------------------------------------------------------------
r65525 | pedronis | 2009-06-01 08:22:12 +0200 (Mon, 01 Jun 2009) | 5 lines
reverting 65522, it broke a couple tests in applevel and lib-python tests
not completely clear why, in general our error code is not that well tested by our own tests
------------------------------------------------------------------------
r65522 | benjamin | 2009-06-01 02:00:54 +0200 (Mon, 01 Jun 2009) | 1 line
normalize raise statements
------------------------------------------------------------------------
r64224 | pedronis | 2009-04-17 11:15:18 +0200 (Fri, 17 Apr 2009) | 3 lines
kill more llvm related code
------------------------------------------------------------------------
Copied: pypy/branch/pyjitpl5/pypy/translator/driver.py.merge.tmp (from r66039, pypy/branch/pyjitpl5/pypy/translator/driver.py)
==============================================================================
--- pypy/branch/pyjitpl5/pypy/translator/driver.py (original)
+++ pypy/branch/pyjitpl5/pypy/translator/driver.py.merge.tmp Tue Jun 30 16:38:22 2009
@@ -33,7 +33,6 @@
_BACKEND_TO_TYPESYSTEM = {
'c': 'lltype',
- 'llvm': 'lltype'
}
def backend_to_typesystem(backend):
@@ -305,6 +304,7 @@
assert self.libdef is not None
for func, inputtypes in self.libdef.functions:
annotator.build_types(func, inputtypes)
+ func.c_name = func.func_name
self.sanity_check_annotation()
annotator.simplify()
#
@@ -452,15 +452,20 @@
if translator.annotator is not None:
translator.frozen = True
- standalone = self.standalone
-
- if standalone:
- from pypy.translator.c.genc import CStandaloneBuilder as CBuilder
+ if self.libdef is not None:
+ cbuilder = self.libdef.getcbuilder(self.translator, self.config)
+ self.standalone = False
+ standalone = False
else:
- from pypy.translator.c.genc import CExtModuleBuilder as CBuilder
- cbuilder = CBuilder(self.translator, self.entry_point,
- config=self.config)
- cbuilder.stackless = self.config.translation.stackless
+ standalone = self.standalone
+
+ if standalone:
+ from pypy.translator.c.genc import CStandaloneBuilder as CBuilder
+ else:
+ from pypy.translator.c.genc import CExtModuleBuilder as CBuilder
+ cbuilder = CBuilder(self.translator, self.entry_point,
+ config=self.config)
+ cbuilder.stackless = self.config.translation.stackless
if not standalone: # xxx more messy
cbuilder.modulename = self.extmod_name
database = cbuilder.build_database()
@@ -507,7 +512,7 @@
def task_compile_c(self): # xxx messy
cbuilder = self.cbuilder
cbuilder.compile()
-
+
if self.standalone:
self.c_entryp = cbuilder.executable_name
self.create_exe()
@@ -550,62 +555,6 @@
[STACKCHECKINSERTION, '?'+BACKENDOPT, RTYPE],
"LLInterpreting")
- def task_source_llvm(self):
- translator = self.translator
- if translator.annotator is None:
- raise ValueError, "llvm requires annotation."
-
- from pypy.translator.llvm import genllvm
-
- self.llvmgen = genllvm.GenLLVM(translator, self.standalone)
-
- llvm_filename = self.llvmgen.gen_source(self.entry_point)
- self.log.info("written: %s" % (llvm_filename,))
- #
- task_source_llvm = taskdef(task_source_llvm,
- [STACKCHECKINSERTION, BACKENDOPT, RTYPE],
- "Generating llvm source")
-
- def task_compile_llvm(self):
- gen = self.llvmgen
- if self.standalone:
- exe_name = (self.exe_name or 'testing') % self.get_info()
- self.c_entryp = gen.compile_standalone(exe_name)
- self.create_exe()
- else:
- self.c_module, self.c_entryp = gen.compile_module()
- #
- task_compile_llvm = taskdef(task_compile_llvm,
- ['source_llvm'],
- "Compiling llvm source")
-
- def task_run_llvm(self):
- self.backend_run('llvm')
- #
- task_run_llvm = taskdef(task_run_llvm, ['compile_llvm'],
- "Running compiled llvm source",
- idemp=True)
-
- def task_source_js(self):
- from pypy.translator.js.js import JS
- self.gen = JS(self.translator, functions=[self.entry_point],
- stackless=self.config.translation.stackless)
- filename = self.gen.write_source()
- self.log.info("Wrote %s" % (filename,))
- task_source_js = taskdef(task_source_js,
- [OOTYPE],
- 'Generating Javascript source')
-
- def task_compile_js(self):
- pass
- task_compile_js = taskdef(task_compile_js, ['source_js'],
- 'Skipping Javascript compilation')
-
- def task_run_js(self):
- pass
- task_run_js = taskdef(task_run_js, ['compile_js'],
- 'Please manually run the generated code')
-
def task_source_cli(self):
from pypy.translator.cli.gencli import GenCli
from pypy.translator.cli.entrypoint import get_entrypoint
More information about the Pypy-commit
mailing list