diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2023-11-21 00:01:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-21 00:01:00 +0000 |
commit | eaffcc85ea53d7d90ac0271490f62526f91a5af6 (patch) | |
tree | dffb411210cd15a6780e7b2a3be81122a346c61b /llvm/lib/IR/DebugInfo.cpp | |
parent | 5271d330770573d2df772aa0fa50d958f44400aa (diff) | |
download | llvm-eaffcc85ea53d7d90ac0271490f62526f91a5af6.zip llvm-eaffcc85ea53d7d90ac0271490f62526f91a5af6.tar.gz llvm-eaffcc85ea53d7d90ac0271490f62526f91a5af6.tar.bz2 |
[DebugInfo][RemoveDIs] Make dropping variable locations explicit (#72399)
In present-day debug-info, when you delete all instructions, you delete
all their debug-info with it because debug-info is stored in
instructions. With debug-info stored in DPValue objects however,
deleting instructions causes DPValue objects to clump together into a
large blob of debug-info that hangs around in the block, as nothing has
explicitly deleted it.
To restore this behaviour, scatter calls to dropDbgValues around in
places that used to delete chunks of dbg.values, for example during
stripDebugInfo and in the code that deletes everything after an
Unreachable instruction. DCE is another example.
The tests with --try... added to them are new scenarios where we can now
correctly replicate the "normal" debug-info behaviour. Alas, there's no
explicit test for the opt -strip-debug option though (in dbg.value mode
or DPValue mode).
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 6006437..4f9073f 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -547,6 +547,7 @@ bool llvm::stripDebugInfo(Function &F) { // DIAssignID are debug info metadata primitives. I.setMetadata(LLVMContext::MD_DIAssignID, nullptr); } + I.dropDbgValues(); } } return Changed; |