-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RemoveDIs] Update DIBuilder C API with DbgRecord functions. #95535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b40d1e8
6ea846a
2cd67a1
018cac9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,7 +220,38 @@ Changes to the C API | |
* ``LLVMConstICmp`` | ||
* ``LLVMConstFCmp`` | ||
|
||
* Added ``LLVMPositionBuilderBeforeDbgRecords`` and ``LLVMPositionBuilderBeforeInstrAndDbgRecords``. Same as ``LLVMPositionBuilder`` and ``LLVMPositionBuilderBefore`` except the insertion position is set to before the debug records that precede the target instruction. See the `debug info migration guide <https://llvm.org/docs/RemoveDIsDebugInfo.html>`_ for more info. ``LLVMPositionBuilder`` and ``LLVMPositionBuilderBefore`` are unchanged; they insert before the indicated instruction but after any attached debug records. | ||
* Added the following functions to insert before the indicated instruction but | ||
after any attached debug records. | ||
|
||
* ``LLVMPositionBuilderBeforeDbgRecords`` | ||
* ``LLVMPositionBuilderBeforeInstrAndDbgRecords`` | ||
|
||
Same as ``LLVMPositionBuilder`` and ``LLVMPositionBuilderBefore`` except the | ||
insertion position is set to before the debug records that precede the target | ||
instruction. ``LLVMPositionBuilder`` and ``LLVMPositionBuilderBefore`` are | ||
unchanged. | ||
|
||
See the `debug info migration guide <https://llvm.org/docs/RemoveDIsDebugInfo.html>`_ for more info. | ||
OCHyams marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* Added the following functions to get/set the new non-instruction debug info format. | ||
OCHyams marked this conversation as resolved.
Show resolved
Hide resolved
|
||
They will be deprecated in the future and they are just a transition aid. | ||
|
||
* ``LLVMIsNewDbgInfoFormat`` | ||
* ``LLVMSetIsNewDbgInfoFormat`` | ||
|
||
* Added the following functions to insert a debug record (new debug info format). | ||
|
||
* ``LLVMDIBuilderInsertDeclareRecordBefore`` | ||
* ``LLVMDIBuilderInsertDeclareRecordAtEnd`` | ||
* ``LLVMDIBuilderInsertDbgValueRecordBefore`` | ||
* ``LLVMDIBuilderInsertDbgValueRecordAtEnd`` | ||
|
||
* Deleted the following functions that inserted a debug intrinsic (old debug info format) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: missing full stop. It's a bit repetitive but we probably want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I would suggest is something like this: Changes to the C API...
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That moves the info further away from the place someone would be looking, and requires these changes always sit at the bottom of the list. These are very minor concerns though so I'm happy to go with whatever you prefer here (don't forget the full stop). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These notes are for a group of related changes. The "Note" seems okay to me. Another tactic would be to put this group of changes into a new subsection, which could help other release-note writers realize what's going on. That said, C API changes aren't super common and I'm equally fine with just having the Note. |
||
|
||
* ``LLVMDIBuilderInsertDeclareBefore`` | ||
* ``LLVMDIBuilderInsertDeclareAtEnd`` | ||
* ``LLVMDIBuilderInsertDbgValueBefore`` | ||
* ``LLVMDIBuilderInsertDbgValueAtEnd`` | ||
|
||
Changes to the CodeGen infrastructure | ||
------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1261,44 +1261,12 @@ LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl( | |
unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit, | ||
LLVMMetadataRef Decl, uint32_t AlignInBits); | ||
|
||
/* | ||
* Insert a new Declare DbgRecord before the given instruction. | ||
* | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* Use LLVMSetIsNewDbgInfoFormat(LLVMBool) to convert between formats. | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* \param Builder The DIBuilder. | ||
* \param Storage The storage of the variable to declare. | ||
* \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. | ||
*/ | ||
LLVMDbgRecordRef | ||
LLVMDIBuilderInsertDeclareBefore(LLVMDIBuilderRef Builder, LLVMValueRef Storage, | ||
LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, | ||
LLVMMetadataRef DebugLoc, LLVMValueRef Instr); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "old debug mode" (LLVMIsNewDbgInfoFormat() is false). | ||
* Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* 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. | ||
* \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 LLVMDIBuilderInsertDeclareIntrinsicBefore( | ||
LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, | ||
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* The debug format can be switched later after inserting the records using | ||
* LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. | ||
* | ||
* Insert a Declare DbgRecord before the given instruction. | ||
* \param Builder The DIBuilder. | ||
|
@@ -1313,46 +1281,11 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore( | |
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); | ||
|
||
/** | ||
* Insert a new Declare DbgRecord at the end of the given basic block. If the | ||
* basic block has a terminator instruction, the intrinsic is inserted before | ||
* that terminator instruction. | ||
* | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* Use LLVMSetIsNewDbgInfoFormat(LLVMBool) to convert between formats. | ||
* Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* \param Builder The DIBuilder. | ||
* \param Storage The storage of the variable to declare. | ||
* \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. | ||
*/ | ||
LLVMDbgRecordRef LLVMDIBuilderInsertDeclareAtEnd( | ||
LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, | ||
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "old debug mode" (LLVMIsNewDbgInfoFormat() is false). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* Insert a new llvm.dbg.declare 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 Storage The storage of the variable to declare. | ||
* \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 LLVMDIBuilderInsertDeclareIntrinsicAtEnd( | ||
LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, | ||
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* The debug format can be switched later after inserting the records using | ||
* LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. | ||
* | ||
* Insert a Declare DbgRecord at the end of the given basic block. If the basic | ||
* block has a terminator instruction, the record is inserted before that | ||
|
@@ -1369,43 +1302,11 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd( | |
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); | ||
|
||
/** | ||
* Insert a new Value DbgRecord before the given instruction. | ||
* | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* Use LLVMSetIsNewDbgInfoFormat(LLVMBool) to convert between formats. | ||
* Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* \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. | ||
*/ | ||
LLVMDbgRecordRef | ||
LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, LLVMValueRef Val, | ||
LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, | ||
LLVMMetadataRef DebugLoc, LLVMValueRef Instr); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "old debug mode" (LLVMIsNewDbgInfoFormat() is false). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* 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 LLVMDIBuilderInsertDbgValueIntrinsicBefore( | ||
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, | ||
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* The debug format can be switched later after inserting the records using | ||
* LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. | ||
* | ||
* Insert a new llvm.dbg.value intrinsic call before the given instruction. | ||
* \param Builder The DIBuilder. | ||
|
@@ -1420,46 +1321,11 @@ LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordBefore( | |
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); | ||
|
||
/** | ||
* Insert a new Value DbgRecord at the end of the given basic block. If the | ||
* basic block has a terminator instruction, the intrinsic is inserted before | ||
* that terminator instruction. | ||
* | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* Use LLVMSetIsNewDbgInfoFormat(LLVMBool) to convert between formats. | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* \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. | ||
*/ | ||
LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueAtEnd( | ||
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, | ||
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "old debug mode" (LLVMIsNewDbgInfoFormat() is false). | ||
* Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* | ||
* 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 LLVMDIBuilderInsertDbgValueIntrinsicAtEnd( | ||
LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, | ||
LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); | ||
/** | ||
* Soon to be deprecated. | ||
* Only use in "new debug mode" (LLVMIsNewDbgInfoFormat() is true). | ||
* See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes | ||
* The debug format can be switched later after inserting the records using | ||
* LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. | ||
* | ||
* Insert a new llvm.dbg.value intrinsic call at the end of the given basic | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The doc comments for the record functions still refer to intrinsics... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nikic Thanks for your valuable review. Replaced the 'intrinsic' occurrences. |
||
* block. If the basic block has a terminator instruction, the intrinsic is | ||
|
Uh oh!
There was an error while loading. Please reload this page.