summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2019-04-17 13:29:14 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2019-04-17 13:29:14 +0000
commitd909a5ed8d603ec771d441308d964ac6522b9ab8 (patch)
tree277c21d4104034f198b507a7a24de626ae0b0752 /llvm/include/llvm-c
parentf2879d8a4877eafcdb12c852030746d175f8abbd (diff)
downloadbcm5719-llvm-d909a5ed8d603ec771d441308d964ac6522b9ab8.tar.gz
bcm5719-llvm-d909a5ed8d603ec771d441308d964ac6522b9ab8.zip
[LLVM-C] Add DIFile Field Accesssors
Summary: Add accessors for the file, directory, source file name (curiously, an `Optional` value?), of a DIFile. This is intended to replace the LLVMValueRef-based accessors used in D52239 Reviewers: whitequark, jberdine, deadalnix Reviewed By: whitequark, jberdine Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60489 llvm-svn: 358577
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r--llvm/include/llvm-c/DebugInfo.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h
index 414a5bf0805..33c8110a863 100644
--- a/llvm/include/llvm-c/DebugInfo.h
+++ b/llvm/include/llvm-c/DebugInfo.h
@@ -459,6 +459,40 @@ LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location);
*/
LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location);
+/**
+ * Get the metadata of the file associated with a given scope.
+ * \param Scope The scope object.
+ *
+ * @see DIScope::getFile()
+ */
+LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope);
+
+/**
+ * Get the directory of a given file.
+ * \param File The file object.
+ * \param Len The length of the returned string.
+ *
+ * @see DIFile::getDirectory()
+ */
+const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len);
+
+/**
+ * Get the name of a given file.
+ * \param File The file object.
+ * \param Len The length of the returned string.
+ *
+ * @see DIFile::getFilename()
+ */
+const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len);
+
+/**
+ * Get the source of a given file.
+ * \param File The file object.
+ * \param Len The length of the returned string.
+ *
+ * @see DIFile::getSource()
+ */
+const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len);
/**
* Create a type array.
OpenPOWER on IntegriCloud