Added User class, moved operands to User, cleanup

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@69 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2009-02-25 11:04:25 +00:00
commit 8b6109d8eb
7 changed files with 144 additions and 154 deletions

View file

@ -237,21 +237,6 @@ unsigned LLVMInstGetOpcode(LLVMValueRef inst)
return instp->getOpcode();
}
unsigned LLVMInstGetNumOperands(LLVMValueRef inst)
{
llvm::Instruction *instp = llvm::unwrap<llvm::Instruction>(inst);
assert(instp);
return instp->getNumOperands();
}
LLVMValueRef LLVMInstGetOperand(LLVMValueRef inst, unsigned idx)
{
llvm::Instruction *instp = llvm::unwrap<llvm::Instruction>(inst);
assert(instp);
llvm::Value *operand = instp->getOperand(idx);
return llvm::wrap(operand);
}
/* llvm::unwrap a set of `n' wrapped objects starting at `values',
* into a vector of pointers to llvm::unwrapped objects `out'. */
template <typename W, typename UW>
@ -314,6 +299,21 @@ unsigned LLVMValueGetID(LLVMValueRef value)
return valuep->getValueID();
}
unsigned LLVMUserGetNumOperands(LLVMValueRef user)
{
llvm::User *userp = llvm::unwrap<llvm::User>(user);
assert(userp);
return userp->getNumOperands();
}
LLVMValueRef LLVMUserGetOperand(LLVMValueRef user, unsigned idx)
{
llvm::User *userp = llvm::unwrap<llvm::User>(user);
assert(userp);
llvm::Value *operand = userp->getOperand(idx);
return llvm::wrap(operand);
}
LLVMValueRef LLVMGetIntrinsic(LLVMModuleRef module, int id,
LLVMTypeRef *types, unsigned n_types)
{