More changes to get llvm-py to compile with LLVM 3.0

This commit is contained in:
Travis E. Oliphant 2012-02-08 09:23:58 -06:00
commit 3120dbf29e
3 changed files with 12 additions and 10 deletions

View file

@ -135,7 +135,8 @@ class _ObjectCache(type):
# Cacheables
#===----------------------------------------------------------------------===
class Cacheable(object, metaclass=_ObjectCache):
class Cacheable(object):
__metaclass__ = _ObjectCache
"""Objects that can be cached.
Objects that wrap a PyCObject are cached to avoid "aliasing", i.e.,

View file

@ -929,9 +929,9 @@ _wrap_pass( SingleLoopExtractor )
_wrap_pass( StripDeadPrototypes )
_wrap_pass( StripNonDebugSymbols )
_wrap_pass( StripSymbols )
_wrap_pass( StructRetPromotion )
//_wrap_pass( StructRetPromotion )
_wrap_pass( TailCallElimination )
_wrap_pass( TailDuplication )
//_wrap_pass( TailDuplication )
_wrap_pass( UnifyFunctionExitNodes )
_wrap_pass( Internalize2 )
@ -1743,9 +1743,9 @@ static PyMethodDef core_methods[] = {
_pass( StripDeadPrototypes )
_pass( StripNonDebugSymbols )
_pass( StripSymbols )
_pass( StructRetPromotion )
//_pass( StructRetPromotion )
_pass( TailCallElimination )
_pass( TailDuplication )
//_pass( TailDuplication )
_pass( UnifyFunctionExitNodes )
_pass( Internalize2 )

View file

@ -325,19 +325,20 @@ void LLVMSetDoesNotThrow(LLVMValueRef fn, int DoesNotThrow)
return fnp->setDoesNotThrow((bool)DoesNotThrow);
}
LLVMValueRef LLVMGetIntrinsic(LLVMModuleRef module, int id,
LLVMTypeRef *types, unsigned n_types)
{
assert(types);
std::vector< llvm::ArrayRef<llvm::Type*> > types_vec;
unwrap_cvec(types, n_types, types_vec);
std::vector< llvm::Type* > types_vec;
unwrap_vec(types, n_types, types_vec);
llvm::Module *modulep = llvm::unwrap(module);
assert(modulep);
llvm::Function *intfunc = llvm::Intrinsic::getDeclaration(modulep,
llvm::Intrinsic::ID(id), &types_vec[0], types_vec.size());
llvm::Intrinsic::ID(id), types_vec[0]);
return wrap(intfunc);
}
@ -501,8 +502,8 @@ void LLVMAdd ## P ## Pass (LLVMPassManagerRef passmgr) { \
define_pass( AAEval )
define_pass( AliasAnalysisCounter )
define_pass( AlwaysInliner )
define_pass( BasicAliasAnalysis )
//define_pass( AlwaysInliner )
//define_pass( BasicAliasAnalysis )
define_pass( BlockPlacement )
define_pass( BreakCriticalEdges )
define_pass( CodeGenPrepare )