diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2025-05-06 16:15:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-06 16:15:26 +0100 |
commit | a363ccaf18da166a51206070f074360ca35462ca (patch) | |
tree | e1ae6acee54e5341cbccdc6cf88a114094f2369e /llvm/lib/Transforms/Utils/Debugify.cpp | |
parent | 0eeabd4b302cf52c4a585664ed9bc4a81ef91105 (diff) | |
download | llvm-a363ccaf18da166a51206070f074360ca35462ca.zip llvm-a363ccaf18da166a51206070f074360ca35462ca.tar.gz llvm-a363ccaf18da166a51206070f074360ca35462ca.tar.bz2 |
[KeyInstr][debugify] Add --debugify-atoms to add key instructions metadata (#133483)
RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Debugify.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp index d67a563..3e323cc 100644 --- a/llvm/lib/Transforms/Utils/Debugify.cpp +++ b/llvm/lib/Transforms/Utils/Debugify.cpp @@ -35,6 +35,8 @@ using namespace llvm; namespace { +cl::opt<bool> ApplyAtomGroups("debugify-atoms", cl::init(false)); + cl::opt<bool> Quiet("debugify-quiet", cl::desc("Suppress verbose debugify output")); @@ -142,8 +144,13 @@ bool llvm::applyDebugifyMetadata( for (BasicBlock &BB : F) { // Attach debug locations. - for (Instruction &I : BB) - I.setDebugLoc(DILocation::get(Ctx, NextLine++, 1, SP)); + for (Instruction &I : BB) { + uint64_t AtomGroup = ApplyAtomGroups ? NextLine : 0; + uint8_t AtomRank = ApplyAtomGroups ? 1 : 0; + uint64_t Line = NextLine++; + I.setDebugLoc(DILocation::get(Ctx, Line, 1, SP, nullptr, false, + AtomGroup, AtomRank)); + } if (DebugifyLevel < Level::LocationsAndVariables) continue; |