Added support for intrinsincs; needs more testing.

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@24 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2008-07-21 16:21:14 +00:00
commit da0a10662e
8 changed files with 674 additions and 13 deletions

View file

@ -12,6 +12,7 @@
#include "llvm/ModuleProvider.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/CallSite.h"
#include "llvm/IntrinsicInst.h"
#include <cassert>
#include <cstdlib>
#include <cstring>
@ -85,3 +86,16 @@ LLVMValueRef LLVMBuildGetResult(LLVMBuilderRef B, LLVMValueRef V,
return wrap(unwrap(B)->CreateGetResult(unwrap(V), Index, Name));
}
LLVMValueRef LLVMGetIntrinsic(LLVMModuleRef M, int ID,
LLVMTypeRef *Types, unsigned Count)
{
std::vector<const Type*> Tys;
for (LLVMTypeRef *I = Types, *E = Types + Count; I != E; ++I)
Tys.push_back(unwrap(*I));
Function *intfunc = Intrinsic::getDeclaration(unwrap(M),
Intrinsic::ID(ID), &Tys[0], Count);
return wrap(intfunc);
}