[pypy-commit] pypy py3k: merge default

pjenvey noreply at buildbot.pypy.org
Sat Apr 27 21:43:32 CEST 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r63701:da1f74c2347f
Date: 2013-04-27 12:42 -0700
http://bitbucket.org/pypy/pypy/changeset/da1f74c2347f/

Log:	merge default

diff --git a/rpython/translator/backendopt/merge_if_blocks.py b/rpython/translator/backendopt/merge_if_blocks.py
--- a/rpython/translator/backendopt/merge_if_blocks.py
+++ b/rpython/translator/backendopt/merge_if_blocks.py
@@ -37,7 +37,7 @@
     default.args = [get_new_arg(arg) for arg in default.args]
     for block, case in chain:
         if case.value in values:
-            log.WARNING("unreachable code with value %s in graph %s" % (
+            log.WARNING("unreachable code with value %r in graph %s" % (
                         case.value, graph))
             continue
         values[case.value] = True
diff --git a/rpython/translator/platform/__init__.py b/rpython/translator/platform/__init__.py
--- a/rpython/translator/platform/__init__.py
+++ b/rpython/translator/platform/__init__.py
@@ -163,6 +163,15 @@
                 break
         return response_file
 
+    def _make_o_file(self, cfile, ext):
+        """Create a .o filename under the udir for a .c file"""
+        oname = cfile.new(ext=ext)
+        if oname.relto(udir):
+            return oname
+        ofile = udir.join(oname.relto(py.path.local()))
+        ofile.dirpath().ensure(dir=True)
+        return ofile
+
     def preprocess_include_dirs(self, include_dirs):
         if 'PYPY_LOCALBASE' in os.environ:
             dirs = list(self._preprocess_include_dirs(include_dirs))
diff --git a/rpython/translator/platform/posix.py b/rpython/translator/platform/posix.py
--- a/rpython/translator/platform/posix.py
+++ b/rpython/translator/platform/posix.py
@@ -31,7 +31,7 @@
         return list(link_files)
 
     def _compile_c_file(self, cc, cfile, compile_args):
-        oname = cfile.new(ext='o')
+        oname = self._make_o_file(cfile, ext='o')
         args = ['-c'] + compile_args + [str(cfile), '-o', str(oname)]
         self._execute_c_compiler(cc, args, oname,
                                  cwd=str(cfile.dirpath()))
diff --git a/rpython/translator/platform/windows.py b/rpython/translator/platform/windows.py
--- a/rpython/translator/platform/windows.py
+++ b/rpython/translator/platform/windows.py
@@ -197,7 +197,7 @@
         return ["@%s" % (response_file,)]
 
     def _compile_c_file(self, cc, cfile, compile_args):
-        oname = cfile.new(ext='obj')
+        oname = self._make_o_file(cfile, ext='obj')
         # notabene: (tismer)
         # This function may be called for .c but also .asm files.
         # The c compiler accepts any order of arguments, while


More information about the pypy-commit mailing list