Index: include/llvm-c/DebugInfo.h =================================================================== --- include/llvm-c/DebugInfo.h +++ include/llvm-c/DebugInfo.h @@ -883,6 +883,12 @@ size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags); +/** + * Retrieve the DWARF tag associated with a given metadata node. + * \param Node The DINode. + */ +unsigned LLVMDIMetadataGetTag(LLVMMetadataRef Node); + /** * Get the metadata of the subprogram attached to a function. * Index: lib/IR/DebugInfo.cpp =================================================================== --- lib/IR/DebugInfo.cpp +++ lib/IR/DebugInfo.cpp @@ -1158,6 +1158,10 @@ return wrap(unwrap(Builder)->getOrCreateArray({DataValue, Length}).get()); } +unsigned LLVMDIMetadataGetTag(LLVMMetadataRef Node) { + return unwrapDI(Node)->getTag(); +} + LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func) { return wrap(unwrap(Func)->getSubprogram()); }