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:
parent
df4365921d
commit
da0a10662e
8 changed files with 674 additions and 13 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue