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

@ -8,7 +8,19 @@ __version__ = '0.9.1'
from weakref import WeakValueDictionary
from llvm._utils.finalizer import track as track_resource
from llvm._utils.finalizer import OwnerMixin as _OwnerMixin
from llvm import _core
#===----------------------------------------------------------------------===
# LLVM Version
#===----------------------------------------------------------------------===
version = _core.LLVMGetVersion()
def require_version_at_least(major, minor):
'''Sentry to guard version requirement
'''
if version < (major, minor):
raise Exception(major, minor)
#===----------------------------------------------------------------------===
# Exceptions