summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2019-04-16 21:39:48 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2019-04-16 21:39:48 +0000
commitd6eb4bb8010752c0f51c391bb050725c0484a208 (patch)
tree56bfe6ae0bf89d20a2f90d1c7db4e3adf550cff2 /llvm/include/llvm-c
parente8de5cd6023feee263ced0586155947f219f1c96 (diff)
downloadbcm5719-llvm-d6eb4bb8010752c0f51c391bb050725c0484a208.tar.gz
bcm5719-llvm-d6eb4bb8010752c0f51c391bb050725c0484a208.zip
[LLVM-C] Add Accessors For Global Variable Metadata Properties
Summary: Metadata for a global variable is really a (GlobalVariable, Expression) tuple. Allow access to these, then allow retrieving the file, scope, and line for a DIVariable, whether global or local. This should be the last of the accessors required for uniform access to location and file information metadata. Reviewers: jberdine, whitequark, deadalnix Reviewed By: jberdine, whitequark Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60725 llvm-svn: 358532
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r--llvm/include/llvm-c/DebugInfo.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h
index 54de41c8e1f..414a5bf0805 100644
--- a/llvm/include/llvm-c/DebugInfo.h
+++ b/llvm/include/llvm-c/DebugInfo.h
@@ -1038,6 +1038,48 @@ LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression(
size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File,
unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
LLVMMetadataRef Expr, LLVMMetadataRef Decl, uint32_t AlignInBits);
+
+/**
+ * Retrieves the \c DIVariable associated with this global variable expression.
+ * \param GVE The global variable expression.
+ *
+ * @see llvm::DIGlobalVariableExpression::getVariable()
+ */
+LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE);
+
+/**
+ * Retrieves the \c DIExpression associated with this global variable expression.
+ * \param GVE The global variable expression.
+ *
+ * @see llvm::DIGlobalVariableExpression::getExpression()
+ */
+LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression(
+ LLVMMetadataRef GVE);
+
+/**
+ * Get the metadata of the file associated with a given variable.
+ * \param Var The variable object.
+ *
+ * @see DIVariable::getFile()
+ */
+LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var);
+
+/**
+ * Get the metadata of the scope associated with a given variable.
+ * \param Var The variable object.
+ *
+ * @see DIVariable::getScope()
+ */
+LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var);
+
+/**
+ * Get the source line where this \c DIVariable is declared.
+ * \param Var The DIVariable.
+ *
+ * @see DIVariable::getLine()
+ */
+unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var);
+
/**
* Create a new temporary \c MDNode. Suitable for use in constructing cyclic
* \c MDNode structures. A temporary \c MDNode is not uniqued, may be RAUW'd,
@@ -1202,6 +1244,14 @@ LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func);
void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP);
/**
+ * Get the line associated with a given subprogram.
+ * \param Subprogram The subprogram object.
+ *
+ * @see DISubprogram::getLine()
+ */
+unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram);
+
+/**
* Get the debug location for the given instruction.
*
* @see llvm::Instruction::getDebugLoc()
OpenPOWER on IntegriCloud