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:
parent
10843ec2ec
commit
8b6109d8eb
7 changed files with 144 additions and 154 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue