Access to MetaData operands

This is not available in the C API, so add functions to extra.cpp:

- `LLVMMetaDataGetOperand` wraps MDNode::getOperand
- `LLVMMetaDataGetNumOperands` wraps MDNode::getNumOperands
This commit is contained in:
Wladimir J. van der Laan 2012-09-12 20:58:53 +02:00
commit 7f69beb258
5 changed files with 40 additions and 1 deletions

View file

@ -65,6 +65,16 @@ void LLVMInstSetMetaData(LLVMValueRef instref, const char* mdkind,
LLVMValueRef LLVMMetaDataGet(LLVMModuleRef modref, LLVMValueRef * valrefs,
unsigned valct);
/*
* Wraps MDNode::getOperand()
*/
LLVMValueRef LLVMMetaDataGetOperand(LLVMValueRef mdref, unsigned index);
/*
* Wraps MDNode::getNumOperands()
*/
unsigned LLVMMetaDataGetNumOperands(LLVMValueRef mdref);
/*
* Wraps ConstantExpr::getOpcodeName()
*/