Commits

Philip Jenvey committed da1f74c Merge

merge default

  • Participants
  • Parent commits 82f1bb4, d41d471
  • Branches py3k

Comments (0)

Files changed (4)

File rpython/translator/backendopt/merge_if_blocks.py

     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

File rpython/translator/platform/__init__.py

                 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))

File rpython/translator/platform/posix.py

         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()))

File rpython/translator/platform/windows.py

         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