diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2025-05-21 17:40:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-21 17:40:45 +0100 |
commit | 9459c8309c6768cf6aa7956885b2540e16582a93 (patch) | |
tree | 81388d1d4dddfcb4fcb62e0bb1cd6391495217ca /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 878c976c7e0a7f00b4175def9f1f90c88dfe9f96 (diff) | |
download | llvm-9459c8309c6768cf6aa7956885b2540e16582a93.zip llvm-9459c8309c6768cf6aa7956885b2540e16582a93.tar.gz llvm-9459c8309c6768cf6aa7956885b2540e16582a93.tar.bz2 |
[KeyInstr][Clang] Add ApplyAtomGroup (#134632)
This is a scoped helper similar to ApplyDebugLocation that creates a new source
location atom group which instructions can be added to.
A source atom is a source construct that is "interesting" for debug stepping
purposes. We use an atom group number to track the instruction(s) that implement
the functionality for the atom, plus backup instructions/source locations.
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.
RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668
The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 603e38d..1743f558 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -1740,6 +1740,14 @@ public: /// recently incremented counter. uint64_t getCurrentProfileCount() { return PGO.getCurrentRegionCount(); } + /// See CGDebugInfo::addInstToCurrentSourceAtom. + void addInstToCurrentSourceAtom(llvm::Instruction *KeyInstruction, + llvm::Value *Backup); + + /// See CGDebugInfo::addInstToSpecificSourceAtom. + void addInstToSpecificSourceAtom(llvm::Instruction *KeyInstruction, + llvm::Value *Backup, uint64_t Atom); + private: /// SwitchInsn - This is nearest current switch instruction. It is null if /// current context is not in a switch. |