Add support for accessing an MDNode's operands via the C binding. Patch by
[oota-llvm.git] / include / llvm-c / Core.h
index 6587e77080078ae652eee5d1242d1edc44323725..4d3374958b5fbc4e97ddf4a80249703fde5375d4 100644 (file)
@@ -1868,6 +1868,27 @@ LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
  */
 const char  *LLVMGetMDString(LLVMValueRef V, unsigned* Len);
 
+/**
+ * Obtain the number of operands from an MDNode value.
+ *
+ * @param V MDNode to get number of operands from.
+ * @return Number of operands of the MDNode.
+ */
+unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V);
+
+/**
+ * Obtain the given MDNode's operands.
+ *
+ * The passed LLVMValueRef pointer should point to enough memory to hold all of
+ * the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
+ * LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
+ * MDNode's operands.
+ *
+ * @param V MDNode to get the operands from.
+ * @param Dest Destination array for operands.
+ */
+void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest);
+
 /**
  * @}
  */