diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2024-03-12 10:25:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-12 10:25:58 +0000 |
commit | 9997e0397156ff7e01aecbd17bdeb7bfe5fb15b0 (patch) | |
tree | b5a4694dd558a6a59bc05ba4644d6689b0a30d26 /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | ce1fd9281707c2163728085d126ff83041e1db51 (diff) | |
download | llvm-9997e0397156ff7e01aecbd17bdeb7bfe5fb15b0.zip llvm-9997e0397156ff7e01aecbd17bdeb7bfe5fb15b0.tar.gz llvm-9997e0397156ff7e01aecbd17bdeb7bfe5fb15b0.tar.bz2 |
[RemoveDIs] Update DIBuilder to conditionally insert DbgRecords (#84739)
Have DIBuilder conditionally insert either debug intrinsics or DbgRecord
depending on the module's IsNewDbgInfoFormat flag. The insertion methods
now return a `DbgInstPtr` (a `PointerUnion<Instruction *, DbgRecord
*>`).
Add a unittest for both modes (I couldn't find an existing test testing
insertion behaviours specifically).
This patch changes the existing assumption that DbgRecords are only ever
inserted if there's an instruction to insert-before because clang
currently inserts debug intrinsics while CodeGening (like any other
instruction) meaning it'll try inserting to the end of a block without a
terminator. We already have machinery in place to maintain the
DbgRecords when a terminator is removed - these become "trailing
DbgRecords" which are re-attached when a new instruction is inserted.
All I've done is allow this state to occur while inserting DbgRecords
too, i.e., it's not only removing terminators that causes this valid
transient state, but inserting DbgRecords into incomplete blocks too.
The C API will be updated in follow up patches.
---
Note: this doesn't mean clang is emitting DbgRecords yet, because the
modules it creates are still always in the old debug mode. That will
come in a future patch.
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions