diff options
author | Robert Widmann <devteam.codafi@gmail.com> | 2018-04-23 22:31:49 +0000 |
---|---|---|
committer | Robert Widmann <devteam.codafi@gmail.com> | 2018-04-23 22:31:49 +0000 |
commit | 21fc15d55387151f9b15a0e3b96cdda92c18e31a (patch) | |
tree | 6fc7c0cc08b73818b4c5067eea310e0ff6d3451e /llvm/include/llvm-c | |
parent | 3c6ea7e28c957bdaf03df8a3a4ff00c46e9315f6 (diff) | |
download | bcm5719-llvm-21fc15d55387151f9b15a0e3b96cdda92c18e31a.tar.gz bcm5719-llvm-21fc15d55387151f9b15a0e3b96cdda92c18e31a.zip |
[LLVM-C] DIBuilder Bindings For Variable Expressions
Summary: Add DIBuilder bindings for (global) variable expressions, variable value expressions, and debug value intrinsic insertion.
Reviewers: harlanhaskins, deadalnix, whitequark
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45979
llvm-svn: 330661
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r-- | llvm/include/llvm-c/DebugInfo.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h index cdd1c1758e4..d079d2c1c62 100644 --- a/llvm/include/llvm-c/DebugInfo.h +++ b/llvm/include/llvm-c/DebugInfo.h @@ -717,6 +717,78 @@ LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder, int64_t *Addr, size_t Length); /** + * Create a new descriptor for the specified variable that does not have an + * address, but does have a constant value. + * \param Builder The DIBuilder. + * \param Value The constant value. + */ +LLVMMetadataRef +LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder, + int64_t Value); + +/** + * Create a new descriptor for the specified variable. + * \param Scope Variable scope. + * \param Name Name of the variable. + * \param NameLen The length of the C string passed to \c Name. + * \param Linkage Mangled name of the variable. + * \param LinkLen The length of the C string passed to \c Linkage. + * \param File File where this variable is defined. + * \param LineNo Line number. + * \param Ty Variable Type. + * \param LocalToUnit Boolean flag indicate whether this variable is + * externally visible or not. + * \param Expr The location of the global relative to the attached + * GlobalVariable. + * \param Decl Reference to the corresponding declaration. + * \param AlignInBits Variable alignment(or 0 if no alignment attr was + * specified) + */ +LLVMMetadataRef +LLVMDIBuilderCreateGlobalVariableExpression(LLVMDIBuilderRef Builder, + LLVMMetadataRef Scope, + const char *Name, size_t NameLen, + const char *Linkage, size_t LinkLen, + LLVMMetadataRef File, + unsigned LineNo, + LLVMMetadataRef Ty, + LLVMBool LocalToUnit, + LLVMMetadataRef Expr, + LLVMMetadataRef Decl, + uint32_t AlignInBits); + +/** + * Create a new descriptor for the specified global variable that is temporary + * and meant to be RAUWed. + * \param Scope Variable scope. + * \param Name Name of the variable. + * \param NameLen The length of the C string passed to \c Name. + * \param Linkage Mangled name of the variable. + * \param LnkLen The length of the C string passed to \c Linkage. + * \param File File where this variable is defined. + * \param LineNo Line number. + * \param Ty Variable Type. + * \param LocalToUnit Boolean flag indicate whether this variable is + * externally visible or not. + * \param Expr The location of the global relative to the attached + * GlobalVariable. + * \param Decl Reference to the corresponding declaration. + * \param AlignInBits Variable alignment(or 0 if no alignment attr was + * specified) + */ +LLVMMetadataRef +LLVMDIBuilderCreateTempGlobalVariableFwdDecl(LLVMDIBuilderRef Builder, + LLVMMetadataRef Scope, + const char *Name, size_t NameLen, + const char *Linkage, size_t LnkLen, + LLVMMetadataRef File, + unsigned LineNo, + LLVMMetadataRef Ty, + LLVMBool LocalToUnit, + LLVMMetadataRef Decl, + uint32_t AlignInBits); + +/** * Insert a new llvm.dbg.declare intrinsic call before the given instruction. * \param Builder The DIBuilder. * \param Storage The storage of the variable to declare. @@ -745,6 +817,40 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd( LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); /** + * Insert a new llvm.dbg.value intrinsic call before the given instruction. + * \param Builder The DIBuilder. + * \param Val The value of the variable. + * \param VarInfo The variable's debug info descriptor. + * \param Expr A complex location expression for the variable. + * \param DebugLoc Debug info location. + * \param Instr Instruction acting as a location for the new intrinsic. + */ +LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, + LLVMValueRef Val, + LLVMMetadataRef VarInfo, + LLVMMetadataRef Expr, + LLVMMetadataRef DebugLoc, + LLVMValueRef Instr); + +/** + * Insert a new llvm.dbg.value intrinsic call at the end of the given basic + * block. If the basic block has a terminator instruction, the intrinsic is + * inserted before that terminator instruction. + * \param Builder The DIBuilder. + * \param Val The value of the variable. + * \param VarInfo The variable's debug info descriptor. + * \param Expr A complex location expression for the variable. + * \param DebugLoc Debug info location. + * \param Block Basic block acting as a location for the new intrinsic. + */ +LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder, + LLVMValueRef Val, + LLVMMetadataRef VarInfo, + LLVMMetadataRef Expr, + LLVMMetadataRef DebugLoc, + LLVMBasicBlockRef Block); + +/** * Create a new descriptor for a local auto variable. * \param Builder The DIBuilder. * \param Scope The local scope the variable is declared in. |