Fix breakage of LLVM 3.1.

Add LLVM version number in llvmpy.
This commit is contained in:
Siu Kwan Lam 2013-01-04 14:24:26 -06:00
commit 5b6a1d75f8
7 changed files with 50 additions and 8 deletions

View file

@ -1,13 +1,17 @@
from llvm.core import *
from llvm.passes import *
from llvm.ee import *
import llvm
from os.path import dirname, join as join_path
import unittest
import re
class TestLoopVectorizer(unittest.TestCase):
def test_loop_vectorizer(self):
if llvm.version <= (3, 1):
return # SKIP
re_vector = re.compile("<\d+ x \w+>")

View file

@ -1,6 +1,7 @@
from llvm.core import *
from llvm.passes import *
from llvm.ee import *
import llvm
import unittest
class TestPass(unittest.TestCase):
@ -26,11 +27,12 @@ class TestPass(unittest.TestCase):
self.assertTrue(tli.description)
pm.add(tli)
tti = TargetTransformInfo.new(tm)
self.assertFalse(tti.name)
self.assertTrue(tti.description)
if llvm.version >= (3, 2):
tti = TargetTransformInfo.new(tm)
self.assertFalse(tti.name)
self.assertTrue(tti.description)
pm.add(tti)
pm.add(tti)
pmb = PassManagerBuilder.new()
pmb.opt_level = 3