Index: include/llvm-c/DebugInfo.h =================================================================== --- include/llvm-c/DebugInfo.h +++ include/llvm-c/DebugInfo.h @@ -468,6 +468,14 @@ LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope); /** + * Get the line associated with a given subprogram. + * \param Subprogram The subprogram object. + * + * @see DISubprogram::getLine() + */ +unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram); + +/** * Get the directory of a given file. * \param Scope The file object. * \param Len The length of the returned string. Index: lib/IR/DebugInfo.cpp =================================================================== --- lib/IR/DebugInfo.cpp +++ lib/IR/DebugInfo.cpp @@ -907,6 +907,10 @@ return wrap(unwrapDI(Scope)->getFile()); } +unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram) { + return unwrapDI(Subprogram)->getLine(); +} + const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len) { auto Dir = unwrapDI(File)->getDirectory(); *Len = Dir.size();