[pypy-svn] r42301 - pypy/dist/pypy/translator/llvm

ericvrp at codespeak.net ericvrp at codespeak.net
Wed Apr 25 09:12:39 CEST 2007


Author: ericvrp
Date: Wed Apr 25 09:12:38 2007
New Revision: 42301

Modified:
   pypy/dist/pypy/translator/llvm/buildllvm.py
Log:
Allow genllvm tests to be run with llvm >= 2.0 by using the -std-compile-opts option instead of the optionlist requested from gccas.


Modified: pypy/dist/pypy/translator/llvm/buildllvm.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/buildllvm.py	(original)
+++ pypy/dist/pypy/translator/llvm/buildllvm.py	Wed Apr 25 09:12:38 2007
@@ -69,17 +69,21 @@
         self.cmds = []
 
     def optimizations(self):
-        cmd = "gccas /dev/null -o /dev/null -debug-pass=Arguments 2>&1"
-        gccas_output = os.popen(cmd)
-        opts = gccas_output.read()[17:-1] + " "
-
-        # these were added by Chris Lattner for some old verison of llvm
+        if llvm_version() < 2.0:
+            cmd = "gccas /dev/null -o /dev/null -debug-pass=Arguments 2>&1"
+            gccas_output = os.popen(cmd)
+            opts = gccas_output.read()[17:-1] + " "
+        else:
+            opts = '-std-compile-opts'
+            
+        # these were added by Chris Lattner for some old version of llvm
         #    opts += "-globalopt -constmerge -ipsccp -deadargelim -inline " \
         #            "-instcombine -scalarrepl -globalsmodref-aa -licm -load-vn " \
         #            "-gcse -instcombine -simplifycfg -globaldce "
 
         # added try to reduce the amount of excessive inlining by us, llvm and gcc
         #    opts += "-inline-threshold=175 "   #default: 200
+
         return opts
 
     def compile_bytecode(self, b):



More information about the Pypy-commit mailing list