aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2025-05-22 17:35:49 +0100
committerGitHub <noreply@github.com>2025-05-22 17:35:49 +0100
commit0ee40ca5ccbf036179ee11530cc91de7d31131aa (patch)
tree9f7c2058c143da7d8ca89cd870064a4ea2ed29d5 /clang/lib/CodeGen/CodeGenFunction.h
parent28046438ed2f8c81d1dd5c49be0ea6c2bf169b64 (diff)
downloadllvm-0ee40ca5ccbf036179ee11530cc91de7d31131aa.zip
llvm-0ee40ca5ccbf036179ee11530cc91de7d31131aa.tar.gz
llvm-0ee40ca5ccbf036179ee11530cc91de7d31131aa.tar.bz2
[KeyInstr][Clang] Aggregate init + copy (#134639)
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.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 1743f558..78d71fc 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -258,6 +258,20 @@ template <> struct DominatingValue<RValue> {
}
};
+/// A scoped helper to set the current source atom group for
+/// CGDebugInfo::addInstToCurrentSourceAtom. 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.
+class ApplyAtomGroup {
+ uint64_t OriginalAtom = 0;
+ CGDebugInfo *DI = nullptr;
+
+public:
+ ApplyAtomGroup(CGDebugInfo *DI);
+ ~ApplyAtomGroup();
+};
+
/// CodeGenFunction - This class organizes the per-function state that is used
/// while generating LLVM code.
class CodeGenFunction : public CodeGenTypeCache {
@@ -3035,6 +3049,7 @@ public:
/// Emit an aggregate assignment.
void EmitAggregateAssign(LValue Dest, LValue Src, QualType EltTy) {
+ ApplyAtomGroup Grp(getDebugInfo());
bool IsVolatile = hasVolatileMember(EltTy);
EmitAggregateCopy(Dest, Src, EltTy, AggValueSlot::MayOverlap, IsVolatile);
}