[PATCH] D60795: [LLVM-C] Add LLVMDISubprogramGetLine accessor

Josh Berdine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 13:35:35 PDT 2019


jberdine created this revision.
jberdine added a reviewer: CodaFi.
Herald added a reviewer: deadalnix.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Addition to D60725 <https://reviews.llvm.org/D60725>, exposing DISubprogram::getLine().


Repository:
  rL LLVM

https://reviews.llvm.org/D60795

Files:
  include/llvm-c/DebugInfo.h
  lib/IR/DebugInfo.cpp


Index: lib/IR/DebugInfo.cpp
===================================================================
--- lib/IR/DebugInfo.cpp
+++ lib/IR/DebugInfo.cpp
@@ -907,6 +907,10 @@
   return wrap(unwrapDI<DIScope>(Scope)->getFile());
 }
 
+unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram) {
+  return unwrapDI<DISubprogram>(Subprogram)->getLine();
+}
+
 const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len) {
   auto Dir = unwrapDI<DIFile>(File)->getDirectory();
   *Len = Dir.size();
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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60795.195446.patch
Type: text/x-patch
Size: 1101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190416/7bc36ab6/attachment.bin>


More information about the llvm-commits mailing list